03 Oct, 2016

1 commit


05 Sep, 2016

1 commit

  • The mxs_chan->chan_irq variable is guaranteed to never be NO_IRQ,
    as it gets assigned the result of platform_get_irq() that returns
    either a valid positive interrupt number, or a negative failure
    code that leads to the channel not being used.

    This removes the redundant check, eliminating one more instance
    of NO_IRQ.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Vinod Koul

    Arnd Bergmann
     

08 Aug, 2016

1 commit

  • This is in preperation of moving to a callback that provides results to the
    callback for the transaction. The conversion will maintain current behavior
    and the driver must convert to new callback mechanism at a later time in
    order to receive results.

    Signed-off-by: Dave Jiang
    Reviewed-by: Lars-Peter Clausen
    Signed-off-by: Vinod Koul

    Dave Jiang
     

04 May, 2015

1 commit


14 Jan, 2015

1 commit

  • Since ecc19d17868be9c ("dmaengine: Add a warning for drivers not using the
    generic slave caps retrieval") the following warning is observed:

    [ 0.113023] ------------[ cut here ]------------
    [ 0.113053] WARNING: CPU: 0 PID: 1 at drivers/dma/dmaengine.c:830 dma_async_device_register+0x2a0/0x4c8()
    [ 0.113063] this driver doesn't support generic slave capabilities reporting

    Declare the slave capabilities to avoid such warning.

    Signed-off-by: Fabio Estevam
    Acked-by: Maxime Ripard
    Signed-off-by: Vinod Koul

    Fabio Estevam
     

22 Dec, 2014

4 commits


04 Aug, 2014

1 commit


15 Jul, 2014

1 commit


13 Nov, 2013

5 commits

  • mxs dma channel hardware reset command is not reliable and can cause
    a channel stall. The only way to fix the channel stall is a DMA engine
    reset.

    To avoid channel resets we use the hardware semaphore counter. For each
    transmitted segment, the DMA channel will decrease the counter by one.
    To use this mechanism with cyclic DMA, we need to increase the semaphore
    counter with each completed DMA command in the interrupt handler. To
    avoid any interruptions between the DMA transfers, the semaphore counter
    is initialized with 2. This way the counter can be increased in the
    interrupt handler without an influence on the transfer of the DMA
    engine.

    When disabling the channel, we stop increasing the semaphore counter in
    the interrupt handler.

    This patch was tested on i.MX28 with the SAIF DMA channel.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Vinod Koul

    Markus Pargmann
     
  • After a channel reset, the channel stops running automatically. The
    state update was missing so that a channel perperation right after a
    channel reset failed.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Vinod Koul

    Markus Pargmann
     
  • This is no official errata, but I noticed that the channel reset may
    stop working if the DMA state engine is in the READ_FLUSH state.

    This patch uses the channel debug1 register to wait for the DMA
    statemachine to leave the READ_FLUSH state. After that we can continue
    to reset the channel.

    Tested on i.MX28.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Vinod Koul

    Markus Pargmann
     
  • Use the channel's buffer address register to calculate correct residue
    value for tx_status.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Vinod Koul

    Markus Pargmann
     
  • The DMA interrupt handler uses its controll registers to handle all
    available channel interrupts it can find.

    This patch changes it to handle only one interrupt by directly mapping
    irq number to channel. It also includes a cleanup of the ctrl-register
    usage.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Vinod Koul

    Markus Pargmann
     

25 Oct, 2013

1 commit


19 Aug, 2013

1 commit


05 Aug, 2013

1 commit


05 Jul, 2013

1 commit


04 Apr, 2013

2 commits

  • Update mxs-dma driver to adopt generic DMA device tree binding. It
    calls of_dma_controller_register() with mxs specific of_dma_xlate to
    get the generic DMA device tree helper support. Then DMA clients only
    need to call dma_request_slave_channel() for requesting a DMA channel
    from dmaengine.

    The existing way of requesting channel, clients directly call
    dma_request_channel(), still work there, and will be removed after
    all mxs-dma clients get converted to generic DMA device tree helper.

    Signed-off-by: Shawn Guo
    Reviewed-by: Arnd Bergmann

    Shawn Guo
     
  • Use devm_* managed functions to simplify probe() error handling.

    Signed-off-by: Shawn Guo
    Reviewed-by: Arnd Bergmann

    Shawn Guo
     

08 Jan, 2013

1 commit

  • Fix the following warnings when building with W=1 option:

    drivers/dma/mxs-dma.c: In function 'mxs_dma_alloc_chan_resources':
    drivers/dma/mxs-dma.c:368:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    drivers/dma/mxs-dma.c: In function 'mxs_dma_prep_slave_sg':
    drivers/dma/mxs-dma.c:481:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    drivers/dma/mxs-dma.c:494:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    drivers/dma/mxs-dma.c:515:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    drivers/dma/mxs-dma.c: In function 'mxs_dma_prep_dma_cyclic':
    drivers/dma/mxs-dma.c:563:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

    Signed-off-by: Fabio Estevam
    Signed-off-by: Vinod Koul

    Fabio Estevam
     

10 Oct, 2012

1 commit

  • Pull slave-dmaengine updates from Vinod Koul:
    "This time we have Andy updates on dw_dmac which is attempting to make
    this IP block available as PCI and platform device though not fully
    complete this time.

    We also have TI EDMA moving the dma driver to use dmaengine APIs, also
    have a new driver for mmp-tdma, along with bunch of small updates.

    Now for your excitement the merge is little unusual here, while
    merging the auto merge on linux-next picks wrong choice for pl330
    (drivers/dma/pl330.c) and this causes build failure. The correct
    resolution is in linux-next. (DMA: PL330: Fix build error) I didn't
    back merge your tree this time as you are better than me so no point
    in doing that for me :)"

    Fixed the pl330 conflict as in linux-next, along with trivial header
    file conflicts due to changed includes.

    * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (29 commits)
    dma: tegra: fix interrupt name issue with apb dma.
    dw_dmac: fix a regression in dwc_prep_dma_memcpy
    dw_dmac: introduce software emulation of LLP transfers
    dw_dmac: autoconfigure data_width or get it via platform data
    dw_dmac: autoconfigure block_size or use platform data
    dw_dmac: get number of channels from hardware if possible
    dw_dmac: fill optional encoded parameters in register structure
    dw_dmac: mark dwc_dump_chan_regs as inline
    DMA: PL330: return ENOMEM instead of 0 from pl330_alloc_chan_resources
    DMA: PL330: Remove redundant runtime_suspend/resume functions
    DMA: PL330: Remove controller clock enable/disable
    dmaengine: use kmem_cache_zalloc instead of kmem_cache_alloc/memset
    DMA: PL330: Set the capability of pdm0 and pdm1 as DMA_PRIVATE
    ARM: EXYNOS: Set the capability of pdm0 and pdm1 as DMA_PRIVATE
    dma: tegra: use list_move_tail instead of list_del/list_add_tail
    mxs/dma: Enlarge the CCW descriptor area to 4 pages
    dw_dmac: utilize slave_id to pass request line
    dmaengine: mmp_tdma: add dt support
    dmaengine: mmp-pdma support
    spi: davici - make davinci select edma
    ...

    Linus Torvalds
     

22 Sep, 2012

1 commit

  • Change the parameter list of device_prep_dma_cyclic() so the DMA drivers
    can receive the flags coming from clients.
    This feature can be used during audio operation to disable all audio
    related interrupts when the DMA_PREP_INTERRUPT is cleared from the flags.

    Signed-off-by: Peter Ujfalusi
    Acked-by: Nicolas Ferre
    Acked-by: Shawn Guo
    Acked-by: Vinod Koul
    Signed-off-by: Mark Brown

    Peter Ujfalusi
     

14 Sep, 2012

1 commit

  • In case of a large SPI flash, the amount of DMA descriptors
    available to the DMA driver is not large enough anymore. For
    example 8MB SPI flash now needs 129 descriptors to be transfered
    in one long read. There are currently 53 descriptors available in
    one PAGE_SIZE-big block. Enlarge the allocated descriptor area to
    four PAGE_SIZE blocks to fulfill such requirements.

    Signed-off-by: Marek Vasut
    Cc: Dan Williams
    Cc: Fabio Estevam
    Cc: Shawn Guo
    Acked-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Marek Vasut
     

16 Jul, 2012

1 commit


07 Jun, 2012

1 commit


27 May, 2012

1 commit

  • Pull arm-soc device tree conversions (part 2) from Olof Johansson:
    "These continue the device tree work from part 1, this set is for the
    tegra, mxs and imx platforms, all of which have dependencies on clock
    or pinctrl changes submitted earlier."

    Fix up trivial conflicts due to nearby changes in
    drivers/{gpio/gpio,i2c/busses/i2c}-mxs.c

    * tag 'dt2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (73 commits)
    ARM: dt: tegra: invert status=disable vs status=okay
    ARM: dt: tegra: consistent basic property ordering
    ARM: dt: tegra: sort nodes based on bus order
    ARM: dt: tegra: remove duplicate device_type property
    ARM: dt: tegra: consistenly use lower-case for hex constants
    ARM: dt: tegra: format regs properties consistently
    ARM: dt: tegra: gpio comment cleanup
    ARM: dt: tegra: remove unnecessary unit addresses
    ARM: dt: tegra: whitespace cleanup
    ARM: dt: tegra cardhu: fix typo in SDHCI node name
    ARM: dt: tegra: cardhu: register core regulator tps62361
    ARM: dt: tegra30.dtsi: Add SMMU node
    ARM: dt: tegra20.dtsi: Add GART node
    ARM: dt: tegra30.dtsi: Add Memory Controller(MC) nodes
    ARM: dt: tegra20.dtsi: Add Memory Controller(MC) nodes
    ARM: dt: tegra: Add device tree support for AHB
    ARM: dts: enable audio support for imx28-evk
    ARM: dts: enable i2c device for imx28-evk
    i2c: mxs: add device tree probe support
    ARM: dts: enable mmc for imx28-evk
    ...

    Linus Torvalds
     

12 May, 2012

4 commits


11 May, 2012

1 commit

  • sg->length may or may not contain the length of the dma region to transfer,
    depending on the architecture - dma_sg_len(sg) always will though. For the
    architectures which use the drivers modified by this patch it probably is the
    case that sg->length contains the dma transfer length. But to be consistent and
    future proof change them to use dma_sg_len.

    To quote Russel King:
    sg->length is meaningless to something performing DMA.

    In cases where sg_dma_len(sg) and sg->length are the same storage, then
    there's no problem. But scatterlists _can_ (and one some architectures) do
    split them - especially when you have an IOMMU which can allow you to
    combine a scatterlist into fewer entries.

    So, anything using sg->length for the size of a scatterlist's DMA transfer
    _after_ a call to dma_map_sg() is almost certainly buggy.

    The patch has been generated using the following coccinelle patch:

    @@
    struct scatterlist *sg;
    expression X;
    @@
    -sg[X].length
    +sg_dma_len(&sg[X])
    @@
    struct scatterlist *sg;
    @@
    -sg->length
    +sg_dma_len(sg)

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Lars-Peter Clausen
     

20 Apr, 2012

1 commit

  • Enable channel in device_issue_pending call, so that the order between
    cookie assignment and channel enabling can be ensured naturally.

    It fixes the mxs gpmi-nand breakage which is caused by the incorrect
    order of cookie assigning and channel enabling.

    Suggested-by: Russell King
    Signed-off-by: Shawn Guo
    Tested-by: Huang Shijie
    Tested-by
    Signed-off-by: Vinod Koul

    Shawn Guo
     

31 Mar, 2012

1 commit

  • Pull MTD changes from David Woodhouse:
    - Artem's cleanup of the MTD API continues apace.
    - Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst
    others.
    - More work on DiskOnChip G3, new driver for DiskOnChip G4.
    - Clean up debug/warning printks in JFFS2 to use pr_.

    Fix up various trivial conflicts, largely due to changes in calling
    conventions for things like dmaengine_prep_slave_sg() (new inline
    wrapper to hide new parameter, clashing with rewrite of previously last
    parameter that used to be an 'append' flag, and is now a bitmap of
    'unsigned long flags').

    (Also some header file fallout - like so many merges this merge window -
    and silly conflicts with sparse fixes)

    * tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits)
    mtd: docg3 add protection against concurrency
    mtd: docg3 refactor cascade floors structure
    mtd: docg3 increase write/erase timeout
    mtd: docg3 fix inbound calculations
    mtd: nand: gpmi: fix function annotations
    mtd: phram: fix section mismatch for phram_setup
    mtd: unify initialization of erase_info->fail_addr
    mtd: support ONFI multi lun NAND
    mtd: sm_ftl: fix typo in major number.
    mtd: add device-tree support to spear_smi
    mtd: spear_smi: Remove default partition information from driver
    mtd: Add device-tree support to fsmc_nand
    mtd: fix section mismatch for doc_probe_device
    mtd: nand/fsmc: Remove sparse warnings and errors
    mtd: nand/fsmc: Add DMA support
    mtd: nand/fsmc: Access the NAND device word by word whenever possible
    mtd: nand/fsmc: Use dev_err to report error scenario
    mtd: nand/fsmc: Use devm routines
    mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform
    mtd: fsmc_nand: add pm callbacks to support hibernation
    ...

    Linus Torvalds
     

27 Mar, 2012

2 commits

  • [1] Background :
    The GPMI does ECC read page operation with a DMA chain consist of three DMA
    Command Structures. The middle one of the chain is used to enable the BCH,
    and read out the NAND page.

    The WAIT4END(wait for command end) is a comunication signal between
    the GPMI and MXS-DMA.

    [2] The current DMA code sets the WAIT4END bit at the last one, such as:

    +-----+ +-----+ +-----+
    | cmd | ------------> | cmd | ------------------> | cmd |
    +-----+ +-----+ +-----+
    ^
    |
    |
    set WAIT4END here

    This chain works fine in the mx23/mx28.

    [3] But in the new GPMI version (used in MX50/MX60), the WAIT4END bit should
    be set not only at the last DMA Command Structure,
    but also at the middle one, such as:

    +-----+ +-----+ +-----+
    | cmd | ------------> | cmd | ------------------> | cmd |
    +-----+ +-----+ +-----+
    ^ ^
    | |
    | |
    set WAIT4END here too set WAIT4END here

    If we do not set WAIT4END, the BCH maybe stalls in "ECC reading page" state.
    In the next ECC write page operation, a DMA-timeout occurs.
    This has been catched in the MX6Q board.

    [4] In order to fix the bug, rewrite the last parameter of mxs_dma_prep_slave_sg(),
    and use the dma_ctrl_flags:
    ---------------------------------------------------------
    DMA_PREP_INTERRUPT : append a new DMA Command Structrue.
    DMA_CTRL_ACK : set the WAIT4END bit for this DMA Command Structure.
    ---------------------------------------------------------

    [5] changes to the relative drivers:
    For mxs-mmc driver, just use the new flags, do not change any logic.
    For gpmi-nand driver, and use the new flags to set the DMA
    chain, especially for ecc read page.

    Acked-by: Shawn Guo
    Signed-off-by: Huang Shijie
    Acked-by: Vinod Koul
    Signed-off-by: David Woodhouse

    Huang Shijie
     
  • Move the header to a more common place.
    The mxs dma engine is not only used in mx23/mx28, but also used
    in mx50/mx6q. It will also be used in the future chips.

    Rename it to mxs-dma.h, and create a new folder include/linux/fsl/ to
    store the Freescale's header files.

    change mxs-dma driver, mxs-mmc driver, gpmi-nand driver, mxs-saif driver
    to the new header file.

    Acked-by: Shawn Guo
    Acked-by: Mark Brown
    Signed-off-by: Huang Shijie
    Acked-by: Vinod Koul
    Acked-by: Chris Ball
    Signed-off-by: David Woodhouse

    Huang Shijie
     

21 Mar, 2012

1 commit


13 Mar, 2012

1 commit

  • Ensure all DMA engine drivers initialize their cookies in the same way,
    so that they all behave in a similar fashion. This means their first
    issued cookie will be 2 rather than 1, and will increment to INT_MAX
    before returning 1 and starting over.

    In connection with this, Dan Williams said:
    > Russell King wrote:
    > > Secondly, some DMA engine drivers initialize the dma_chan cookie to 0,
    > > others to 1.  Is there a reason for this, or are these all buggy?
    >
    > I know that ioat and iop-adma expect 0 to mean "I have cleaned up this
    > descriptor and it is idle", and would break if zero was an in-flight
    > cookie value. The reserved usage of zero is an driver internal
    > concern, but I have no problem formalizing it as a reserved value.

    Signed-off-by: Russell King
    Tested-by: Linus Walleij
    Reviewed-by: Linus Walleij
    Acked-by: Jassi Brar
    [imx-sdma.c & mxs-dma.c]
    Tested-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Russell King - ARM Linux