20 Jan, 2017

1 commit

  • commit 836c3ce2566fb8c1754f8d7c9534cad9bc8a6879 upstream.

    The original patch did not done what it was supposed to be doing and even
    worst it broke legacy boot (OMAP1).

    The lch_map size should be the number of available logical channels in sDMA
    and the od->dma_requests should store the number of available DMA request
    lines usable in sDMA.

    In legacy mode we do not have a way to get the DMA request count, in that
    case we use OMAP_SDMA_REQUESTS (127), despite the fact that OMAP1510 have
    only 31 DMA request line.

    Fixes: 2d1a9a946fae ("dmaengine: omap-dma: Dynamically allocate memory for lch_map")
    Reported-by: Aaro Koskinen
    Signed-off-by: Peter Ujfalusi
    Tested-by: Aaro Koskinen
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Peter Ujfalusi
     

01 Oct, 2016

1 commit

  • Enable the burst and data pack modes for the scatter-gather
    in order to improve the throughput of the data transfers.

    The improvement has been verified with MMC HS200 mode in
    the DRA72 EVM using the iozone tool to compare the read
    throughput (in kB/s) with and without burst/pack for
    different reclens (in kB).

    With
    reclen Baseline sDMA burst/pack
    ------ -------- ---------------
    64 46568 50820
    128 57564 63413
    256 65634 74937
    512 72427 83483
    1024 74563 84504
    2048 76265 86079
    4096 78045 87335
    8192 78989 88154
    16384 81265 91034

    Signed-off-by: Misael Lopez Cruz
    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Misael Lopez Cruz
     

14 Sep, 2016

1 commit


11 Aug, 2016

6 commits


28 Jul, 2016

1 commit


24 Jul, 2016

1 commit


16 Jul, 2016

1 commit

  • dmaengine device should explicitly call devm_free_irq() when using
    devm_request_irq().

    The irq is still ON when devices remove is executed and irq should be
    quiesced before remove is completed.

    Signed-off-by: Vinod Koul
    Acked-by: Peter Ujfalusi

    Vinod Koul
     

06 Apr, 2016

2 commits

  • If the client queues up more transfers the driver will not able to move to
    the next transfer without knowing that the previous descriptor is
    completed.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     
  • When based on the CCR_ENABLE bit the channel is stopped we should not call
    omap_dma_callback(), only change the return value to DMA_COMPLETE. Client
    drivers will do the right thing to clean up the channel after the transfer
    has been completed.
    Check the CCR_ENABLE only if the channel is running and not paused since
    pause in sDMA means that the channel is stopped.
    This will fix one hard to reproduce race condition when the channel is
    terminated during transfer (affecting cyclic operation).

    Fixes: 1a7cf7b26f25 ("dmaengine: omap-dma: Handle cases when the channel is polled for completion")

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     

22 Feb, 2016

1 commit


06 Jan, 2016

1 commit


18 Dec, 2015

1 commit


05 Dec, 2015

4 commits

  • When a DMA client driver decides that it is not providing callback for
    completion of a transfer (and/or does not set the DMA_PREP_INTERRUPT) but
    it will poll the status of the transfer (in case of short memcpy for
    example) we will not get interrupt for the completion of the transfer and
    will not mark the transaction as done.
    Check the channel enable bit in the CCR when the status is queried and if
    the channel is no longer active, we call the omap_dma_callback() to handle
    the transfer completion.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     
  • The use of tasklet to actually start the DMA transfer slightly decreases the
    DMA throughput since it adds small scheduling delay when the transfer is
    started. In normal use, even with high I/O load the tasklet would start
    one transaction at a time, however running the DMAtest for memcpy on all
    available channels will cause the tasklet to start about 15 transfers.
    The performance numbers on OMAP4 PandaBoard-es (test_buf_size = 6553):
    With the tasklet:
    dmatest: dma0chan30-copy: summary 5000 tests, 0 failures 186 iops 593 KB/s (0)
    dmatest: dma0chan8-copy0: summary 5000 tests, 0 failures 184 iops 584 KB/s (0)
    dmatest: dma0chan13-copy: summary 5000 tests, 0 failures 184 iops 585 KB/s (0)
    dmatest: dma0chan12-copy: summary 5000 tests, 0 failures 184 iops 585 KB/s (0)
    dmatest: dma0chan7-copy0: summary 5000 tests, 0 failures 183 iops 581 KB/s (0)

    With this patch (no tasklet):
    dmatest: dma0chan4-copy0: summary 5000 tests, 0 failures 199 iops 644 KB/s (0)
    dmatest: dma0chan5-copy0: summary 5000 tests, 0 failures 199 iops 645 KB/s (0)
    dmatest: dma0chan6-copy0: summary 5000 tests, 0 failures 199 iops 637 KB/s (0)
    dmatest: dma0chan24-copy: summary 5000 tests, 0 failures 199 iops 638 KB/s (0)
    dmatest: dma0chan16-copy: summary 5000 tests, 0 failures 199 iops 638 KB/s (0)

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     
  • The for_each_sg() macro's last parameter is inteded to be used as counter.
    We can use 'i' instead of 'j' within the loop for indexes.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     
  • During mem copy both src and dst position moves at the same pace. Check the
    dst position for progress reporting.

    Signed-off-by: Peter Ujfalusi
    Tested-by: Tomi Valkeinen
    Signed-off-by: Jyri Sarha
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     

05 Oct, 2015

1 commit

  • The L3 throughput can be higher than expected when packed access
    is not enabled. The ratio depends on the number of bytes in a
    transaction and the EMIF interface width.

    The throughput was measured for the following settings/cases:

    * Case 1: Burst size of 64 bytes, packed access disabled
    * Case 2: Burst size of 64 bytes, packed access enabled
    * Case 3: Burst disabled, packed access disabled

    Throughput measurements were done during McASP-based audio
    playback on the Jacinto6 EVM using the omapconf tool [1]:
    $ omapconf trace bw -m sdma_rd

    ---------------------------------------------------------
    Throughput (MB/s)
    Audio parameters Case 1 Case 2 Case 3
    ---------------------------------------------------------
    44.1kHz, 16-bits, stereo 1.41 0.18 1.41
    44.1kHz, 32-bits, stereo 1.41 0.35 1.41
    44.1kHz, 16-bits, 4-chan 2.82 0.35 2.82
    44.1kHz, 16-bits, 6-chan 4.23 0.53 4.23
    44.1kHz, 16-bits, 8-chan 5.64 0.71 5.64
    ---------------------------------------------------------

    From above measurements, case 2 is the only one that delivers
    the expected throughput for the given audio parameters. For
    that reason, the packed accesses are now enabled.

    It's worth to mention that packed accesses cannot be enabled
    for all addressing modes. In cyclic transfers, it can be
    enabled in the source for MEM_TO_DEV and in dest for DEV_TO_MEM,
    as they use post-increment mode which supports packed accesses.

    Peter Ujfalusi:
    From the TRM regarding to this:
    "NOTE: Except in the constant addressing mode, the source or
    destination must be specified as packed for burst transactions
    to occur."

    So w/o the packed setting the burst on the MEM side was not
    enabled, this explains the numbers.

    [1] https://github.com/omapconf/omapconf

    Signed-off-by: Misael Lopez Cruz
    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Misael Lopez Cruz
     

25 Jun, 2015

1 commit


09 May, 2015

4 commits


04 May, 2015

1 commit

  • The sDMA controller is capable of performing memory copy operation. It need
    to be configured to software triggered mode and without HW synchronization.
    The sDMA can copy data which is aligned to 8, 16 or 32 bits.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     

31 Mar, 2015

1 commit

  • In omap_dma_start_desc the vdesc->node is removed from the virt-dma
    framework managed lists (to be precise from the desc_issued list).
    If a terminate_all comes before the transfer finishes the omap_desc will
    not be freed up because it is not in any of the lists and we stopped the
    DMA channel so the transfer will not going to complete.
    There is no special sequence for leaking memory when using cyclic (audio)
    transfer: with every start and stop of a cyclic transfer the driver leaks
    struct omap_desc worth of memory.

    Free up the allocated memory directly in omap_dma_terminate_all() since the
    framework will not going to do that for us.

    Signed-off-by: Peter Ujfalusi
    CC:
    CC:
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     

22 Dec, 2014

4 commits


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

06 Nov, 2014

1 commit


20 Oct, 2014

1 commit


23 Sep, 2014

2 commits

  • When the audio stream is paused or suspended we stop the sDMA and when it
    is unpaused/resumed we start the channel without reconfiguring it.
    The omap_dma_stop() clears the link configuration when we pause the dma, but
    it is not setting it back on start. This will result only one audio buffer
    to be played back and the DMA will stop, since the linking is disabled.
    We need to restore the CLINK_CTRL register in case of resume.

    Signed-off-by: Peter Ujfalusi
    Acked-by: Russell King
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     
  • Add mb() call to resume path to ensure the necessary barrier.
    Resume can happen after waking up from suspend for example.

    Signed-off-by: Peter Ujfalusi
    Acked-by: Russell King
    Signed-off-by: Vinod Koul

    Peter Ujfalusi
     

04 Aug, 2014

1 commit


10 Apr, 2014

1 commit

  • Pull slave-dmaengine updates from Vinod Koul:
    - New driver for Qcom bam dma
    - New driver for RCAR peri-peri
    - New driver for FSL eDMA
    - Various odd fixes and updates thru the subsystem

    * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (29 commits)
    dmaengine: add Qualcomm BAM dma driver
    shdma: add R-Car Audio DMAC peri peri driver
    dmaengine: sirf: enable generic dt binding for dma channels
    dma: omap-dma: Implement device_slave_caps callback
    dmaengine: qcom_bam_dma: Add device tree binding
    dma: dw: Add suspend and resume handling for PCI mode DW_DMAC.
    dma: dw: allocate memory in two stages in probe
    Add new line to test result strings produced in verbose mode
    dmaengine: pch_dma: use tasklet_kill in teardown
    dmaengine: at_hdmac: use tasklet_kill in teardown
    dma: cppi41: start tear down only if channel is busy
    usb: musb: musb_cppi41: Dont reprogram DMA if tear down is initiated
    dmaengine: s3c24xx-dma: make phy->irq signed for error handling
    dma: imx-dma: Add missing module owner field
    dma: imx-dma: Replace printk with dev_*
    dma: fsl-edma: fix static checker warning of NULL dereference
    dma: Remove comment about embedding dma_slave_config into custom structs
    dma: mmp_tdma: move to generic device tree binding
    dma: mmp_pdma: add IRQF_SHARED when request irq
    dma: edma: Fix memory leak in edma_prep_dma_cyclic()
    ...

    Linus Torvalds