24 May, 2017

2 commits

  • Draining the transfers in terminate_all callback happens with IRQs disabled,
    therefore induces huge latency:

    irqsoff latency trace v1.1.5 on 4.11.0
    --------------------------------------------------------------------
    latency: 39770 us, #57/57, CPU#0 | (M:preempt VP:0, KP:0, SP:0 HP:0)
    -----------------
    | task: process-129 (uid:0 nice:0 policy:2 rt_prio:50)
    -----------------
    => started at: _snd_pcm_stream_lock_irqsave
    => ended at: snd_pcm_stream_unlock_irqrestore

    _------=> CPU#
    / _-----=> irqs-off
    | / _----=> need-resched
    || / _---=> hardirq/softirq
    ||| / _--=> preempt-depth
    |||| / delay
    cmd pid ||||| time | caller
    \ / ||||| \ | /
    process-129 0d.s. 3us : _snd_pcm_stream_lock_irqsave
    process-129 0d.s1 9us : snd_pcm_stream_lock
    => ep93xx_dma_tasklet
    => tasklet_action
    => __do_softirq
    => irq_exit
    => __handle_domain_irq
    => vic_handle_irq
    => __irq_usr
    => 0xb66c6668

    Just abort the transfers and warn if the HW state is not what we expect.
    Move draining into device_synchronize callback.

    Signed-off-by: Alexander Sverdlin
    Cc: stable@vger.kernel.org
    Signed-off-by: Vinod Koul

    Alexander Sverdlin
     
  • The current buffer is being reset to zero on device_free_chan_resources()
    but not on device_terminate_all(). It could happen that HW is restarted and
    expects BASE0 to be used, but the driver is not synchronized and will start
    from BASE1. One solution is to reset the buffer explicitly in
    m2p_hw_setup().

    Signed-off-by: Alexander Sverdlin
    Cc: stable@vger.kernel.org
    Signed-off-by: Vinod Koul

    Alexander Sverdlin
     

03 Oct, 2016

2 commits


27 Sep, 2016

2 commits

  • The driver uses same variable name in local and global context in a
    function, rename the local one for better readability.

    Signed-off-by: Vinod Koul

    Vinod Koul
     
  • This driver warns:

    drivers/dma/ep93xx_dma.c: In function 'ep93xx_dma_prep_slave_sg':
    drivers/dma/ep93xx_dma.c:1054:6: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]

    drivers/dma/ep93xx_dma.c: In function 'ep93xx_dma_prep_dma_cyclic':
    drivers/dma/ep93xx_dma.c:1129:5: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat=]

    We should use %zu to print 'size_t' values.

    Signed-off-by: Vinod Koul

    Vinod Koul
     

14 Sep, 2016

1 commit


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
     

25 Jan, 2016

1 commit

  • Debugging ALSA hangups it was found that EP9302 (latest E2 rev.) DMA controller
    sometimes asserts STALL interrupt instead of NFB interrupt. Simply ignoring the
    difference and simply acting upon the amount of data we still have to transfer
    seems to work fine. This somehow sounds similar to M2M issue which is already
    dealt with in the driver, when the controller asserts DONE interrupt too early.

    The issue is not documented in Cirrus Logic erratas for EP93XX, but original
    Cirrus DMA driver from 2003 (not based on DMA API) did the similar handling
    of STALL interrupt. In-tree driver (6d831c65) did it also, before conversion to
    DMA engine API.

    Signed-off-by: Alexander Sverdlin
    Signed-off-by: Vinod Koul

    Alexander Sverdlin
     

04 May, 2015

1 commit


22 Dec, 2014

2 commits


04 Aug, 2014

1 commit


15 Nov, 2013

1 commit

  • Remove support for DMA unmapping from drivers as it is no longer
    needed (DMA core code is now handling it).

    Cc: Vinod Koul
    Cc: Tomasz Figa
    Cc: Dave Jiang
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Kyungmin Park
    [djbw: fix up chan2parent() unused warning in drivers/dma/dw/core.c]
    Signed-off-by: Dan Williams

    Bartlomiej Zolnierkiewicz
     

14 Nov, 2013

1 commit

  • Add a hook for a common dma unmap implementation to enable removal of
    the per driver custom unmap code. (A reworked version of Bartlomiej
    Zolnierkiewicz's patches to remove the custom callbacks and the size
    increase of dma_async_tx_descriptor for drivers that don't care about
    raid).

    Cc: Vinod Koul
    Cc: Tomasz Figa
    Cc: Dave Jiang
    [bzolnier: prepare pl330 driver for adding missing unmap while at it]
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Dan Williams

    Dan Williams
     

05 Aug, 2013

1 commit


12 Jan, 2013

1 commit


09 Oct, 2012

1 commit

  • Pull sound updates from Takashi Iwai:
    "This contains pretty many small commits covering fairly large range of
    files in sound/ directory. Partly because of additional API support
    and partly because of constantly developed ASoC and ARM stuff.

    Some highlights:

    - Introduced the helper function and documentation for exposing the
    channel map via control API, as discussed in Plumbers; most of PCI
    drivers are covered, will follow more drivers later

    - Most of drivers have been replaced with the new PM callbacks (if
    the bus is supported)

    - HD-audio controller got the support of runtime PM and the support
    of D3 clock-stop. Also changing the power_save option in sysfs
    kicks off immediately to enable / disable the power-save mode.

    - Another significant code change in HD-audio is the rewrite of
    firmware loading code. Other than that, most of changes in
    HD-audio are continued cleanups and standardization for the generic
    auto parser and bug fixes (HBR, device-specific fixups), in
    addition to the support of channel-map API.

    - Addition of ASoC bindings for the compressed API, used by the
    mid-x86 drivers.

    - Lots of cleanups and API refreshes for ASoC codec drivers and
    DaVinci.

    - Conversion of OMAP to dmaengine.

    - New machine driver for Wolfson Microelectronics Bells.

    - New CODEC driver for Wolfson Microelectronics WM0010.

    - Enhancements to the ux500 and wm2000 drivers

    - A new driver for DA9055 and the support for regulator bypass mode."

    Fix up various arm soc header file reorg conflicts.

    * tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (339 commits)
    ALSA: hda - Add new codec ALC283 ALC290 support
    ALSA: hda - avoid unneccesary indices on "Headphone Jack" controls
    ALSA: hda - fix indices on boost volume on Conexant
    ALSA: aloop - add locking to timer access
    ALSA: hda - Fix hang caused by race during suspend.
    sound: Remove unnecessary semicolon
    ALSA: hda/realtek - Fix detection of ALC271X codec
    ALSA: hda - Add inverted internal mic quirk for Lenovo IdeaPad U310
    ALSA: hda - make Realtek/Sigmatel/Conexant use the generic unsol event
    ALSA: hda - make a generic unsol event handler
    ASoC: codecs: Add DA9055 codec driver
    ASoC: eukrea-tlv320: Convert it to platform driver
    ALSA: ASoC: add DT bindings for CS4271
    ASoC: wm_hubs: Ensure volume updates are handled during class W startup
    ASoC: wm5110: Adding missing volume update bits
    ASoC: wm5110: Add OUT3R support
    ASoC: wm5110: Add AEC loopback support
    ASoC: wm5110: Rename EPOUT to HPOUT3
    ASoC: arizona: Add more clock rates
    ASoC: arizona: Add more DSP options for mixer input muxes
    ...

    Linus Torvalds
     

02 Oct, 2012

1 commit

  • Pull ARM soc multiplatform enablement from Olof Johansson:
    "This is a pretty significant branch. It's the introduction of the
    first multiplatform support on ARM, and with this (and the later
    branch) merged, it is now possible to build one kernel that contains
    support for highbank, vexpress, mvebu, socfpga, and picoxcell. More
    platforms will be convered over in the next few releases.

    Two critical last things had to be done for this to be practical and
    possible:
    * Today each platform has its own include directory under
    mach-/include/mach/*, and traditionally that is where a lot
    of driver/platform shared definitions have gone, such as platform
    data structures. They now need to move out to a common location
    instead, and this branch moves a large number of those out to
    include/linux/platform_data.
    * Each platform used to list the device trees to compile for its
    boards in mach-/Makefile.boot.

    Both of the above changes will mean that there are some merge
    conflicts to come (and some to resolve here). It's a one-time move
    and once it settles in, we should be good for quite a while. Sorry
    for the overhead."

    Fix conflicts as per Olof.

    * tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (51 commits)
    ARM: add v7 multi-platform defconfig
    ARM: msm: Move core.h contents into common.h
    ARM: highbank: call highbank_pm_init from .init_machine
    ARM: dtb: move all dtb targets to common Makefile
    ARM: spear: move platform_data definitions
    ARM: samsung: move platform_data definitions
    ARM: orion: move platform_data definitions
    ARM: vexpress: convert to multi-platform
    ARM: initial multiplatform support
    ARM: mvebu: move armada-370-xp.h in mach dir
    ARM: vexpress: remove dependency on mach/* headers
    ARM: picoxcell: remove dependency on mach/* headers
    ARM: move all dtb targets out of Makefile.boot
    ARM: picoxcell: move debug macros to include/debug
    ARM: socfpga: move debug macros to include/debug
    ARM: mvebu: move debug macros to include/debug
    ARM: vexpress: move debug macros to include/debug
    ARM: highbank: move debug macros to include/debug
    ARM: move debug macros to common location
    ARM: make mach/gpio.h headers optional
    ...

    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

  • Platform data for device drivers should be defined in
    include/linux/platform_data/*.h, not in the architecture
    and platform specific directories.

    This moves such data out of the ep93xx include directories

    Signed-off-by: Arnd Bergmann
    Acked-by: Mark Brown
    Acked-by: Greg Kroah-Hartman
    Acked-by: Nicolas Pitre
    Acked-by: Hartley Sweeten
    Acked-by: Ryan Mallon
    Acked-by: Vinod Koul
    Cc: Grant Likely
    Cc: Jeff Garzik
    Cc: Dan Williams
    Cc: Dmitry Torokhov
    Cc: Florian Tobias Schandinat
    Cc: Liam Girdwood
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Mika Westerberg
    Cc: Axel Lin

    Arnd Bergmann
     

01 Sep, 2012

1 commit


27 May, 2012

1 commit

  • Pull arm-soc driver specific updates from Olof Johansson:
    "These changes are specific to some driver that may be used by multiple
    boards or socs. The most significant change in here is the move of
    the samsung iommu code from a platform specific in-kernel interface to
    the generic iommu subsystem."

    Fix up trivial conflicts in arch/arm/mach-exynos/Kconfig

    * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits)
    mmc: dt: Consolidate DT bindings
    iommu/exynos: Add iommu driver for EXYNOS Platforms
    ARM: davinci: optimize the DMA ISR
    ARM: davinci: implement DEBUG_LL port choice
    ARM: tegra: Add SMMU enabler in AHB
    ARM: tegra: Add Tegra AHB driver
    Input: pxa27x_keypad add choice to set direct_key_mask
    Input: pxa27x_keypad direct key may be low active
    Input: pxa27x_keypad bug fix for direct_key_mask
    Input: pxa27x_keypad keep clock on as wakeup source
    ARM: dt: tegra: pinmux changes for USB ULPI
    ARM: tegra: add USB ULPI PHY reset GPIO to device tree
    ARM: tegra: don't hard-code USB ULPI PHY reset_gpio
    ARM: tegra: change pll_p_out4's rate to 24MHz
    ARM: tegra: fix pclk rate
    ARM: tegra: reparent sclk to pll_c_out1
    ARM: tegra: Add pllc clock init table
    ARM: dt: tegra cardhu: basic audio support
    ARM: dt: tegra30.dtsi: Add audio-related nodes
    ARM: tegra: add AUXDATA required for audio
    ...

    Linus Torvalds
     

15 May, 2012

1 commit

  • for cyclic dma, dont makr the descriptor as complte. Fix the remaining users of
    cyclic dma which do so

    Signed-off-by: Vinod Koul
    Tested-by: Nicolas Ferre
    Acked-by: Nicolas Ferre
    Tested-by: Mika Westerberg

    Vinod Koul
     

20 Apr, 2012

1 commit


21 Mar, 2012

1 commit


13 Mar, 2012

6 commits

  • Provide a common function to initialize a channels cookie values.

    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
     
  • Now that we have the completed cookie in the dma_chan structure, we
    can consolidate the tx_status functions by providing a function to set
    the txstate structure and returning the DMA status. We also provide
    a separate helper to set the residue for cookies which are still in
    progress.

    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
     
  • Provide a common function to do the cookie mechanics for completing
    a DMA descriptor.

    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
     
  • Everyone deals with assigning DMA cookies in the same way (it's part of
    the API so they should be), so lets consolidate the common code into a
    helper function to avoid this duplication.

    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
     
  • Add a local private header file to contain definitions and declarations
    which should only be used by DMA engine drivers.

    We also fix linux/dmaengine.h to use LINUX_DMAENGINE_H to guard against
    multiple inclusion.

    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
     
  • Every DMA engine implementation declares a last completed dma cookie
    in their private dma channel structures. This is pointless, and
    forces driver specific code. Move this out into the common dma_chan
    structure.

    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
     

05 Dec, 2011

2 commits

  • If dma_terminate_all() is called before the ep93xx_dma_tasklet() gets to run,
    it tries to access an empty ->active list which results following OOPS:

    Internal error: Oops - undefined instruction: 0 [#1]
    CPU: 0 Not tainted (3.2.0-rc1EP-1+ #1008)
    PC is at 0xc184c868
    LR is at ep93xx_dma_tasklet+0xec/0x164
    pc : [] lr : [] psr: 00000013
    sp : c02b7e70 ip : ffffffff fp : c02b7ea4
    r10: 00000100 r9 : 80000013 r8 : c02b7e50
    r7 : c02b7e70 r6 : c02b7ea4 r5 : 000000a4 r4 : c02b7e70
    r3 : c02b751d r2 : 8ae34598 r1 : c184c6e0 r0 : c02b7ea4
    Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
    Control: c000717f Table: c0004000 DAC: 00000017
    Process swapper (pid: 0, stack limit = 0xc02b6270)
    Stack: (0xc02b7e70 to 0xc02b8000)
    7e60: c02b7ea4 c02b7e70 c0008b64 c02bd5c4
    7e80: c02d60e0 00000000 00000000 c02bd44c c02d60e0 00000100 c02b7ec4 c02b7ea8
    7ea0: c001c49c c012b44c 00000018 00000001 c02d60e0 c02b6000 c02b7f04 c02b7ec8
    7ec0: c001cbc0 c001c3e4 c02b7eec c02b7ed8 00000006 0000000a c02bf674 c02c458c
    7ee0: 00000011 00000000 c02b7f7c c0004000 41129200 c02b0c80 c02b7f14 c02b7f08
    7f00: c001cdd0 c001cb38 c02b7f34 c02b7f18 c000983c c001cd98 c0009a60 60000013
    7f20: fefb0001 c02b7f7c c02b7f44 c02b7f38 c0008190 c0009810 c02b7f9c c02b7f48
    7f40: c0008b64 c0008190 c02c2bf8 00000002 c02b7f90 60000013 c02b6000 c02d1504
    7f60: c02baa88 c02baa80 c0004000 41129200 c02b0c80 c02b7f9c c02b7fa0 c02b7f90
    7f80: c0009a54 c0009a60 60000013 ffffffff c02b7fbc c02b7fa0 c000a03c c0009a40
    7fa0: c02b80b0 c02b19dc c02b19d8 c02baa80 c02b7fcc c02b7fc0 c02384e4 c0009fd4
    7fc0: c02b7ff4 c02b7fd0 c029d924 c0238494 c029d49c 00000000 00000000 c02b19dc
    7fe0: c0007175 c02b803c 00000000 c02b7ff8 c000803c c029d700 00000000 00000000
    Backtrace:
    [] (ep93xx_dma_tasklet+0x0/0x164) from [] (tasklet_action+0xc8/0xdc)
    [] (tasklet_action+0x0/0xdc) from [] (__do_softirq+0x98/0x154)
    r7:c02b6000 r6:c02d60e0 r5:00000001 r4:00000018
    [] (__do_softirq+0x0/0x154) from [] (irq_exit+0x48/0x50)
    [] (irq_exit+0x0/0x50) from [] (handle_IRQ+0x3c/0x8c)
    [] (handle_IRQ+0x0/0x8c) from [] (asm_do_IRQ+0x10/0x14)
    r7:c02b7f7c r6:fefb0001 r5:60000013 r4:c0009a60
    [] (asm_do_IRQ+0x0/0x14) from [] (__irq_svc+0x24/0xc0)
    Exception stack(0xc02b7f48 to 0xc02b7f90)
    7f40: c02c2bf8 00000002 c02b7f90 60000013 c02b6000 c02d1504
    7f60: c02baa88 c02baa80 c0004000 41129200 c02b0c80 c02b7f9c c02b7fa0 c02b7f90
    7f80: c0009a54 c0009a60 60000013 ffffffff
    [] (default_idle+0x0/0x34) from [] (cpu_idle+0x78/0xb0)
    [] (cpu_idle+0x0/0xb0) from [] (rest_init+0x60/0x78)
    r7:c02baa80 r6:c02b19d8 r5:c02b19dc r4:c02b80b0
    [] (rest_init+0x0/0x78) from [] (start_kernel+0x234/0x278)
    [] (start_kernel+0x0/0x278) from [] (0xc000803c)
    r5:c02b803c r4:c0007175
    Code: 42555300 54535953 643d4d45 65766972 (53007372)

    To make the code a bit more robust against things like these, we modify
    ep93xx_dma_get_active() to return NULL in case of empty ->active list and make
    sure that callers handle this correctly.

    Reported-by: Rafal Prylowski
    Signed-off-by: Mika Westerberg
    Acked-by: H Hartley Sweeten
    Signed-off-by: Vinod Koul

    Mika Westerberg
     
  • Setting the flags in case of IDE didn't have any effect since the control
    register is overwritten few lines below. So move these to be after the control
    register is initialized.

    Signed-off-by: Rafal Prylowski
    Signed-off-by: Mika Westerberg
    Acked-by: H Hartley Sweeten
    Signed-off-by: Vinod Koul

    Rafal Prylowski
     

27 Oct, 2011

1 commit

  • fixup usage of dma direction by introducing dma_transfer_direction,
    this patch moves dma/drivers/* to use new enum

    Cc: Jassi Brar
    Cc: Russell King
    Cc: Viresh Kumar
    Cc: Linus Walleij
    Cc: Nicolas Ferre
    Cc: Mika Westerberg
    Cc: H Hartley Sweeten
    Cc: Li Yang
    Cc: Zhang Wei
    Cc: Sascha Hauer
    Cc: Guennadi Liakhovetski
    Cc: Shawn Guo
    Cc: Yong Wang
    Cc: Tomoya MORINAGA
    Cc: Boojin Kim
    Cc: Barry Song
    Acked-by: Mika Westerberg
    Acked-by: Linus Walleij
    Acked-by: Viresh Kumar
    Acked-by: Nicolas Ferre
    Signed-off-by: Vinod Koul

    Vinod Koul
     

16 Oct, 2011

1 commit


16 Jun, 2011

1 commit


06 Jun, 2011

1 commit

  • The ep93xx DMA controller has 10 independent memory to peripheral (M2P)
    channels, and 2 dedicated memory to memory (M2M) channels. M2M channels can
    also be used by SPI and IDE to perform DMA transfers to/from their memory
    mapped FIFOs.

    This driver supports both M2P and M2M channels with DMA_SLAVE, DMA_CYCLIC and
    DMA_MEMCPY (M2M only) capabilities.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Ryan Mallon
    Acked-by: H Hartley Sweeten
    Acked-by: Vinod Koul
    Cc: Dan Williams
    Signed-off-by: Vinod Koul

    Mika Westerberg