23 Jul, 2008

3 commits

  • This patch adds to ioatdma and dca modules
    support for Intel I/OAT DMA engine ver.3 (aka CB3 device).
    The main features of I/OAT ver.3 are:
    * 8 single channel DMA devices (8 channels total)
    * 8 DCA providers, each can accept 2 requesters
    * 8-bit TAG values and 32-bit extended APIC IDs

    Signed-off-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Maciej Sosnowski
     
  • I/OAT DMA performance tuning showed different optimal values of
    tcp_dma_copybreak for different I/OAT versions (4096 for 1.2 and 2048
    for 2.0). This patch lets ioatdma driver set tcp_dma_copybreak value
    according to these results.

    [dan.j.williams@intel.com: remove some ifdefs]
    Signed-off-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Maciej Sosnowski
     
  • Due to occasional DMA channel hangs observed for I/OAT versions 1.2 and 2.0
    a watchdog has been introduced to check every 2 seconds
    if all channels progress normally.
    If stuck channel is detected, driver resets it.
    The reset is done in two parts. The second part is scheduled
    by the first one to reinitialize the channel after the restart.

    Signed-off-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Maciej Sosnowski
     

18 Jul, 2008

2 commits


09 Jul, 2008

11 commits

  • This adds a driver for the Synopsys DesignWare DMA controller (aka
    DMACA on AVR32 systems.) This DMA controller can be found integrated
    on the AT32AP7000 chip and is primarily meant for peripheral DMA
    transfer, but can also be used for memory-to-memory transfers.

    This patch is based on a driver from David Brownell which was based on
    an older version of the DMA Engine framework. It also implements the
    proposed extensions to the DMA Engine API for slave DMA operations.

    The dmatest client shows no problems, but there may still be room for
    improvement performance-wise. DMA slave transfer performance is
    definitely "good enough"; reading 100 MiB from an SD card running at ~20
    MHz yields ~7.2 MiB/s average transfer rate.

    Full documentation for this controller can be found in the Synopsys
    DW AHB DMAC Databook:

    http://www.synopsys.com/designware/docs/iip/DW_ahb_dmac/latest/doc/dw_ahb_dmac_db.pdf

    The controller has lots of implementation options, so it's usually a
    good idea to check the data sheet of the chip it's intergrated on as
    well. The AT32AP7000 data sheet can be found here:

    http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

    Changes since v4:
    * Use client_count instead of dma_chan_is_in_use()
    * Add missing include
    * Unmap buffers unless client told us not to

    Changes since v3:
    * Update to latest DMA engine and DMA slave APIs
    * Embed the hw descriptor into the sw descriptor
    * Clean up and update MODULE_DESCRIPTION, copyright date, etc.

    Changes since v2:
    * Dequeue all pending transfers in terminate_all()
    * Rename dw_dmac.h -> dw_dmac_regs.h
    * Define and use controller-specific dma_slave data
    * Fix up a few outdated comments
    * Define hardware registers as structs (doesn't generate better
    code, unfortunately, but it looks nicer.)
    * Get number of channels from platform_data instead of hardcoding it
    based on CONFIG_WHATEVER_CPU.
    * Give slave clients exclusive access to the channel

    Acked-by: Maciej Sosnowski ,
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Haavard Skinnemoen
     
  • This patch adds the necessary interfaces to the DMA Engine framework
    to use functionality found on most embedded DMA controllers: DMA from
    and to I/O registers with hardware handshaking.

    In this context, hardware hanshaking means that the peripheral that
    owns the I/O registers in question is able to tell the DMA controller
    when more data is available for reading, or when there is room for
    more data to be written. This usually happens internally on the chip,
    but these signals may also be exported outside the chip for things
    like IDE DMA, etc.

    A new struct dma_slave is introduced. This contains information that
    the DMA engine driver needs to set up slave transfers to and from a
    slave device. Most engines supporting DMA slave transfers will want to
    extend this structure with controller-specific parameters. This
    additional information is usually passed from the platform/board code
    through the client driver.

    A "slave" pointer is added to the dma_client struct. This must point
    to a valid dma_slave structure iff the DMA_SLAVE capability is
    requested. The DMA engine driver may use this information in its
    device_alloc_chan_resources hook to configure the DMA controller for
    slave transfers from and to the given slave device.

    A new operation for preparing slave DMA transfers is added to struct
    dma_device. This takes a scatterlist and returns a single descriptor
    representing the whole transfer.

    Another new operation for terminating all pending transfers is added as
    well. The latter is needed because there may be errors outside the scope
    of the DMA Engine framework that may require DMA operations to be
    terminated prematurely.

    DMA Engine drivers may extend the dma_device, dma_chan and/or
    dma_slave_descriptor structures to allow controller-specific
    operations. The client driver can detect such extensions by looking at
    the DMA Engine's struct device, or it can request a specific DMA
    Engine device by setting the dma_dev field in struct dma_slave.

    dmaslave interface changes since v4:
    * Fix checkpatch errors
    * Fix changelog (there are no slave descriptors anymore)

    dmaslave interface changes since v3:
    * Use dma_data_direction instead of a new enum
    * Submit slave transfers as scatterlists
    * Remove the DMA slave descriptor struct

    dmaslave interface changes since v2:
    * Add a dma_dev field to struct dma_slave. If set, the client can
    only be bound to the DMA controller that corresponds to this
    device. This allows controller-specific extensions of the
    dma_slave structure; if the device matches, the controller may
    safely assume its extensions are present.
    * Move reg_width into struct dma_slave as there are currently no
    users that need to be able to set the width on a per-transfer
    basis.

    dmaslave interface changes since v1:
    * Drop the set_direction and set_width descriptor hooks. Pass the
    direction and width to the prep function instead.
    * Declare a dma_slave struct with fixed information about a slave,
    i.e. register addresses, handshake interfaces and such.
    * Add pointer to a dma_slave struct to dma_client. Can be NULL if
    the DMA_SLAVE capability isn't requested.
    * Drop the set_slave device hook since the alloc_chan_resources hook
    now has enough information to set up the channel for slave
    transfers.

    Acked-by: Maciej Sosnowski
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Haavard Skinnemoen
     
  • In some cases client code may need the dma-driver to skip the unmap of source
    and/or destination buffers. Setting these flags indicates to the driver to
    skip the unmap step. In this regard async_xor is currently broken in that it
    allows the destination buffer to be unmapped while an operation is still in
    progress, i.e. when the number of sources exceeds the hardware channel's
    maximum (fixed in a subsequent patch).

    Acked-by: Saeed Bishara
    Acked-by: Maciej Sosnowski
    Acked-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Dan Williams
     
  • A DMA controller capable of doing slave transfers may need to know a
    few things about the slave when preparing the channel. We don't want
    to add this information to struct dma_channel since the channel hasn't
    yet been bound to a client at this point.

    Instead, pass a reference to the client requesting the channel to the
    driver's device_alloc_chan_resources hook so that it can pick the
    necessary information from the dma_client struct by itself.

    [dan.j.williams@intel.com: fixed up fsldma and mv_xor]
    Acked-by: Maciej Sosnowski
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Haavard Skinnemoen
     
  • This client tests DMA memcpy using various lengths and various offsets
    into the source and destination buffers. It will initialize both
    buffers with a repeatable pattern and verify that the DMA engine copies
    the requested region and nothing more. It will also verify that the
    bytes aren't swapped around, and that the source buffer isn't modified.

    The dmatest module can be configured to test a specific device, a
    specific channel. It can also test multiple channels at the same time,
    and it can start multiple threads competing for the same channel.

    Changes since v2:
    * Support testing multiple channels at the same time
    * Support testing with multiple threads competing for the same channel
    * Use counting test patterns in order to catch byte ordering issues

    Changes since v1:
    * Remove extra dashes around "help"
    * Remove "default n" from Kconfig
    * Turn TEST_BUF_SIZE into a module parameter
    * Return DMA_NAK instead of DMA_DUP
    * Print unhandled events
    * Support testing specific channels and devices
    * Move to the end of the Makefile

    Acked-by: Maciej Sosnowski
    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Haavard Skinnemoen
     
  • The XOR engine found in Marvell's SoCs and system controllers
    provides XOR and DMA operation, iSCSI CRC32C calculation, memory
    initialization, and memory ECC error cleanup operation support.

    This driver implements the DMA engine API and supports the following
    capabilities:
    - memcpy
    - xor
    - memset

    The XOR engine can be used by DMA engine clients implemented in the
    kernel, one of those clients is the RAID module. In that case, I
    observed 20% improvement in the raid5 write throughput, and 40%
    decrease in the CPU utilization when doing array construction, those
    results obtained on an 5182 running at 500Mhz.

    When enabling the NET DMA client, the performance decreased, so
    meanwhile it is recommended to keep this client off.

    Signed-off-by: Saeed Bishara
    Signed-off-by: Lennert Buytenhek
    Signed-off-by: Nicolas Pitre
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Saeed Bishara
     
  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform
    modalias is prefixed with "platform:". Add MODULE_ALIAS() to most
    of the hotpluggable platform drivers, to re-enable auto loading.

    Cc:
    Signed-off-by: Kay Sievers
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Dan Williams

    Kay Sievers
     
  • Haavard's dma-slave interface would like to test for exclusive access to a
    channel. The standard channel refcounting is not sufficient in that it
    tracks more than just client references, it is also inaccurate as reference
    counts are percpu until the channel is removed.

    This change also enables a future fix to deallocate resources when a client
    declines to use a capable channel.

    Acked-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Dan Williams
     
  • The dependency is redundant since all drivers set their specific arch
    dependencies. The NET_DMA option is modified to be enabled only on platforms
    where it is known to have a positive effect. HAS_DMA is added as an explicit
    dependency for the DMADEVICES menu.

    Acked-by: Adrian Bunk
    Acked-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Set the 'parent' field of channel class devices to point to the
    physical DMA device initialized by the DMA engine driver.

    This allows drivers to use chan->dev.parent for syncing DMA buffers
    and adds a 'device' symlink to the real device in
    /sys/class/dma/dmaXchanY.

    Signed-off-by: Haavard Skinnemoen
    Signed-off-by: Dan Williams

    Haavard Skinnemoen
     
  • Signed-off-by: Li Yang
    Acked-by: Zhang Wei
    Signed-off-by: Dan Williams

    Li Yang
     

21 May, 2008

1 commit

  • 1) Remove an explicit memset(.., 0, ...) to a variable allocated with
    kzalloc (i.e. 'dest').

    2) Allocate 'src' with kmalloc instead of kzalloc as all elements of the
    'src' buffer are initialized in a 'for(...)' loop just after.

    3) remove useless 'sizeof(u8)', which always returns 1, when computing the
    size of the memory to be allocated.

    Signed-off-by: Christophe Jaillet
    Signed-off-by: Dan Williams

    Christophe Jaillet
     

22 Apr, 2008

1 commit


18 Apr, 2008

6 commits


01 Apr, 2008

1 commit


31 Mar, 2008

2 commits


19 Mar, 2008

1 commit

  • The DMA_INTERRUPT async_tx is a NULL transfer, thus the BCR(count register)
    is 0. When the transfer started with a byte count of zero, the DMA
    controller will triger a PE(programming error) event and halt, not a normal
    interrupt. I add special codes for PE event and DMA_INTERRUPT
    async_tx testing.

    Signed-off-by: Zhang Wei
    Signed-off-by: Andrew Morton
    Signed-off-by: Dan Williams

    Zhang Wei
     

14 Mar, 2008

5 commits

  • __FUNCTION__ is gcc-specific, use __func__

    Signed-off-by: Harvey Harrison
    Signed-off-by: Dan Williams

    Harvey Harrison
     
  • The patch 'fsldma: do not cleanup descriptors in hardirq context'
    (commit 222ccf9ab838a1ca7163969fabd2cddc10403fb5) removed descriptors
    cleanup function to tasklet but the completed cookie do not updated.
    Thus, the DMA controller will get lots of duplicated transfer
    interrupts. Just make a completed cookie update in interrupt handler.
    And keep other cleanup jobs in tasklet function.

    Tested-by: Sebastian Siewior
    Signed-off-by: Zhang Wei
    Signed-off-by: Dan Williams

    Zhang Wei
     
  • This is a bug that I assigned DMA_INTERRUPT capability to fsldma
    but missing device_prep_dma_interrupt function. For a bug in
    dmaengine.c the driver passed BUG_ON() checking. The patch fixes it.

    Signed-off-by: Zhang Wei
    Signed-off-by: Dan Williams

    Zhang Wei
     
  • The device->device_prep_dma_interrupt function is used by
    DMA_INTERRUPT capability, not DMA_ZERO_SUM.

    Signed-off-by: Zhang Wei
    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Zhang Wei
     
  • There are warning messages reported by Stephen Rothwell with
    ARCH=powerpc allmodconfig build:

    drivers/dma/fsldma.c: In function 'fsl_dma_prep_memcpy':
    drivers/dma/fsldma.c:439: warning: comparison of distinct pointer types
    lacks a cast
    drivers/dma/fsldma.c: In function 'fsl_chan_xfer_ld_queue':
    drivers/dma/fsldma.c:584: warning: format '%016llx' expects type 'long long
    unsigned int', but argument 4 has type 'dma_addr_t'
    drivers/dma/fsldma.c: In function 'fsl_dma_chan_do_interrupt':
    drivers/dma/fsldma.c:668: warning: format '%x' expects type 'unsigned int',
    but argument 5 has type 'dma_addr_t'
    drivers/dma/fsldma.c:684: warning: format '%016llx' expects type 'long long
    unsigned int', but argument 4 has type 'dma_addr_t'
    drivers/dma/fsldma.c:684: warning: format '%016llx' expects type 'long long
    unsigned int', but argument 5 has type 'dma_addr_t'
    drivers/dma/fsldma.c:701: warning: format '%02x' expects type 'unsigned
    int', but argument 4 has type 'dma_addr_t'
    drivers/dma/fsldma.c: In function 'fsl_dma_self_test':
    drivers/dma/fsldma.c:840: warning: format '%d' expects type 'int', but
    argument 5 has type 'size_t'
    drivers/dma/fsldma.c: In function 'of_fsl_dma_probe':
    drivers/dma/fsldma.c:1010: warning: format '%08x' expects type 'unsigned
    int', but argument 5 has type 'resource_size_t'

    This patch fixed the above warning messages.

    Signed-off-by: Zhang Wei
    Signed-off-by: Dan Williams

    Zhang Wei
     

05 Mar, 2008

3 commits

  • Initialize 'ack' to zero in case the descriptor has been recycled.

    Prevents "kernel BUG at crypto/async_tx/async_xor.c:185!"

    Signed-off-by: Dan Williams
    Acked-by: Shannon Nelson
    Cc: stable@kernel.org

    Dan Williams
     
  • "Cleaning" descriptors involves calling pending callbacks and clients
    assume that their callback will only ever happen in softirq context.
    Delay cleanup to the tasklet.

    Signed-off-by: Dan Williams
    Acked-by: Zhang Wei

    Dan Williams
     
  • The driver implements DMA engine API for Freescale MPC85xx DMA controller,
    which could be used by devices in the silicon. The driver supports the
    Basic mode of Freescale MPC85xx DMA controller. The MPC85xx processors
    supported include MPC8540/60, MPC8555, MPC8548, MPC8641 and so on.

    The MPC83xx(MPC8349, MPC8360) are also supported.

    [kamalesh@linux.vnet.ibm.com: build fix]
    [dan.j.williams@intel.com: merge mm fixes, rebase on async_tx-2.6.25]
    Signed-off-by: Zhang Wei
    Signed-off-by: Ebony Zhu
    Acked-by: Kumar Gala
    Cc: Shannon Nelson
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Dan Williams

    Zhang Wei
     

07 Feb, 2008

3 commits

  • Pass a full set of flags to drivers' per-operation 'prep' routines.
    Currently the only flag passed is DMA_PREP_INTERRUPT. The expectation is
    that arch-specific async_tx_find_channel() implementations can exploit this
    capability to find the best channel for an operation.

    Signed-off-by: Dan Williams
    Acked-by: Shannon Nelson
    Reviewed-by: Haavard Skinnemoen

    Dan Williams
     
  • The tx_set_src and tx_set_dest methods were originally implemented to allow
    an array of addresses to be passed down from async_xor to the dmaengine
    driver while minimizing stack overhead. Removing these methods allows
    drivers to have all transaction parameters available at 'prep' time, saves
    two function pointers in struct dma_async_tx_descriptor, and reduces the
    number of indirect branches..

    A consequence of moving this data to the 'prep' routine is that
    multi-source routines like async_xor need temporary storage to convert an
    array of linear addresses into an array of dma addresses. In order to keep
    the same stack footprint of the previous implementation the input array is
    reused as storage for the dma addresses. This requires that
    sizeof(dma_addr_t) be less than or equal to sizeof(void *). As a
    consequence CONFIG_DMADEVICES now depends on !CONFIG_HIGHMEM64G. It also
    requires that drivers be able to make descriptor resources available when
    the 'prep' routine is polled.

    Signed-off-by: Dan Williams
    Acked-by: Shannon Nelson

    Dan Williams
     
  • these three list_head are all local variables, but can also use LIST_HEAD.

    Signed-off-by: Denis Cheng
    Signed-off-by: Andrew Morton
    Signed-off-by: Dan Williams

    Denis Cheng
     

25 Jan, 2008

1 commit