14 Jan, 2015

1 commit

  • In case of PCI driver we will get a warning:
    dw_dmac_pci 0000:00:18.0: Unbalanced pm_runtime_enable!
    dw_dmac_pci 0000:00:18.0: DesignWare DMA Controller, 8 channels

    This happens due to pm_runtime_enable() call from the driver when PM runtime is
    enabled by core.

    This patch moves that call to the platform driver where it might make sense.

    Fixes: bb32baf76e56 (dmaengine: dw: enable runtime PM)
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Vinod Koul

    Andy Shevchenko
     

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
     

13 Dec, 2014

2 commits

  • Pull ARM updates from Russell King:
    "The major updates included in this update are:

    - Clang compatible stack pointer accesses by Behan Webster.
    - SA11x0 updates from Dmitry Eremin-Solenikov.
    - kgdb handling of breakpoints with read-only text/modules
    - Support for Privileged-no-execute feature on ARMv7 to prevent
    userspace code execution by the kernel.
    - AMBA primecell bus handling of irq-safe runtime PM
    - Unwinding support for memset/memzero/memmove/memcpy functions
    - VFP fixes for Krait CPUs and improvements in detecting the VFP
    architecture
    - A number of code cleanups (using pr_*, removing or reducing the
    severity of a couple of kernel messages, splitting ftrace asm code
    out to a separate file, etc.)
    - Add machine name to stack dump output"

    * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (62 commits)
    ARM: 8247/2: pcmcia: sa1100: make use of device clock
    ARM: 8246/2: pcmcia: sa1111: provide device clock
    ARM: 8245/1: pcmcia: soc-common: enable/disable socket clocks
    ARM: 8244/1: fbdev: sa1100fb: make use of device clock
    ARM: 8243/1: sa1100: add a clock alias for sa1111 pcmcia device
    ARM: 8242/1: sa1100: add cpu clock
    ARM: 8221/1: PJ4: allow building in Thumb-2 mode
    ARM: 8234/1: sa1100: reorder IRQ handling code
    ARM: 8233/1: sa1100: switch to hwirq usage
    ARM: 8232/1: sa1100: merge GPIO multiplexer IRQ to "normal" irq domain
    ARM: 8231/1: sa1100: introduce irqdomains support
    ARM: 8230/1: sa1100: shift IRQs by one
    ARM: 8229/1: sa1100: replace irq numbers with names in irq driver
    ARM: 8228/1: sa1100: drop entry-macro.S
    ARM: 8227/1: sa1100: switch to MULTI_IRQ_HANDLER
    ARM: 8241/1: Update processor_modes for hyp and monitor mode
    ARM: 8240/1: MCPM: document mcpm_sync_init()
    ARM: 8239/1: Introduce {set,clear}_pte_bit
    ARM: 8238/1: mm: Refine set_memory_* functions
    ARM: 8237/1: fix flush_pfn_alias
    ...

    Linus Torvalds
     
  • Pull dmaengine updates from Vinod Koul:
    "Main features this time are:

    - BAM v1.3.0 support form qcom bam dma
    - support for Allwinner sun8i dma
    - atmels eXtended DMA Controller driver
    - chancnt cleanup by Maxime
    - fixes spread over drivers"

    * 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma: (56 commits)
    dmaenegine: Delete a check before free_percpu()
    dmaengine: ioatdma: fix dma mapping errors
    dma: cppi41: add a delay while setting the TD bit
    dma: cppi41: wait longer for the HW to return the descriptor
    dmaengine: fsl-edma: fixup reg offset and hw S/G support in big-endian model
    dmaengine: fsl-edma: fix calculation of remaining bytes
    drivers/dma/pch_dma: declare pch_dma_id_table as static
    dmaengine: ste_dma40: fix error return code
    dma: imx-sdma: clarify about firmware not found error
    Documentation: devicetree: Fix Xilinx VDMA specification
    dmaengine: pl330: update author info
    dmaengine: clarify the issue_pending expectations
    dmaengine: at_xdmac: Add DMA_PRIVATE
    ARM: dts: at_xdmac: fix bad value of dma-cells in documentation
    dmaengine: at_xdmac: fix missing spin_unlock
    dmaengine: at_xdmac: fix a bug in transfer residue computation
    dmaengine: at_xdmac: fix software lockup at_xdmac_tx_status()
    dmaengine: at_xdmac: remove chancnt affectation
    dmaengine: at_xdmac: prefer usage of readl/writel_relaxed
    dmaengine: xdmac: fix print warning on dma_addr_t variable
    ...

    Linus Torvalds
     

12 Dec, 2014

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is an unusually large pull request for MIPS - in parts because
    lots of patches missed the 3.18 deadline but primarily because some
    folks opened the flood gates.

    - Retire the MIPS-specific phys_t with the generic phys_addr_t.
    - Improvments for the backtrace code used by oprofile.
    - Better backtraces on SMP systems.
    - Cleanups for the Octeon platform code.
    - Cleanups and fixes for the Loongson platform code.
    - Cleanups and fixes to the firmware library.
    - Switch ATH79 platform to use the firmware library.
    - Grand overhault to the SEAD3 and Malta interrupt code.
    - Move the GIC interrupt code to drivers/irqchip
    - Lots of GIC cleanups and updates to the GIC code to use modern IRQ
    infrastructures and features of the kernel.
    - OF documentation updates for the GIC bindings
    - Move GIC clocksource driver to drivers/clocksource
    - Merge GIC clocksource driver with clockevent driver.
    - Further updates to bring the GIC clocksource driver up to date.
    - R3000 TLB code cleanups
    - Improvments to the Loongson 3 platform code.
    - Convert pr_warning to pr_warn.
    - Merge a bunch of small lantiq and ralink fixes that have been
    staged/lingering inside the openwrt tree for a while.
    - Update archhelp for IP22/IP32
    - Fix a number of issues for Loongson 1B.
    - New clocksource and clockevent driver for Loongson 1B.
    - Further work on clk handling for Loongson 1B.
    - Platform work for Broadcom BMIPS.
    - Error handling cleanups for TurboChannel.
    - Fixes and optimization to the microMIPS support.
    - Option to disable the FTLB.
    - Dump more relevant information on machine check exception
    - Change binfmt to allow arch to examine PT_*PROC headers
    - Support for new style FPU register model in O32
    - VDSO randomization.
    - BCM47xx cleanups
    - BCM47xx reimplement the way the kernel accesses NVRAM information.
    - Random cleanups
    - Add support for ATH25 platforms
    - Remove pointless locking code in some PCI platforms.
    - Some improvments to EVA support
    - Minor Alchemy cleanup"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (185 commits)
    MIPS: Add MFHC0 and MTHC0 instructions to uasm.
    MIPS: Cosmetic cleanups of page table headers.
    MIPS: Add CP0 macros for extended EntryLo registers
    MIPS: Remove now unused definition of phys_t.
    MIPS: Replace use of phys_t with phys_addr_t.
    MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT
    PCMCIA: Alchemy Don't select 64BIT_PHYS_ADDR in Kconfig.
    MIPS: lib: memset: Clean up some MIPS{EL,EB} ifdefery
    MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO
    MIPS: fix indentation.
    MAINTAINERS: Add entry for BMIPS multiplatform kernel
    MIPS: Enable VDSO randomization
    MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration
    MIPS: Remove declaration of obsolete arch_init_clk_ops()
    MIPS: atomic.h: Reformat to fit in 79 columns
    MIPS: Apply `.insn' to fixup labels throughout
    MIPS: Fix microMIPS LL/SC immediate offsets
    MIPS: Kconfig: Only allow 32-bit microMIPS builds
    MIPS: signal.c: Fix an invalid cast in ISA mode bit handling
    MIPS: mm: Only build one microassembler that is suitable
    ...

    Linus Torvalds
     

09 Dec, 2014

5 commits

  • The free_percpu() function tests whether its argument is NULL and then
    returns immediately. Thus the test around the call is not needed.

    This issue was detected by using the Coccinelle software.

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

    Markus Elfring
     
  • Several systems are showing the following stack trace:

    WARNING: CPU: 0 PID: 2352 at lib/dma-debug.c:1140 check_unmap+0x4ee/0x9e0()
    ioatdma 0000:00:04.0: DMA-API: device driver failed to check map error[device address=0x0000000465bad000] [size=4096 bytes] [mapped as page]
    Modules linked in: ioatdma(E+) nfsv3 rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache cfg80211 rfkill x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel cdc_ether ses ghash_clmulni_intel usbnet mii enclosure aesni_intel lrw gf128mul glue_helper iTCO_wdt shpchp ablk_helper iTCO_vendor_support cryptd pcspkr ipmi_devintf sb_edac lpc_ich edac_core mfd_core ipmi_si i2c_i801 wmi ipmi_msghandler nfsd auth_rpcgss nfs_acl lockd sunrpc xfs libcrc32c sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt drm_kms_helper ttm igb drm ptp pps_core dca i2c_algo_bit i2ccore megaraid_sas dm_mirror dm_region_hash dm_log dm_mod [last unloaded: ioatdma]
    CPU: 0 PID: 2352 Comm: insmod Tainted: G E 3.17.0-rc4+ #14
    Hardware name: HP ProLiant m300 Server Cartridge/, BIOS H02 01/30/2014
    0000000000000009 ffff88007994b7d8 ffffffff816e7225 ffff88007994b820
    ffff88007994b810 ffffffff8107e51d ffff88045fc56c00 ffff88046643ee90
    ffffffff8338ccd0 0000000000000286 ffffffff81956629 ffff88007994b870
    Call Trace:
    [] dump_stack+0x4d/0x66
    [] warn_slowpath_common+0x7d/0xa0
    [] warn_slowpath_fmt+0x4c/0x50
    [] check_unmap+0x4ee/0x9e0
    [] debug_dma_unmap_page+0x5f/0x70
    [] ioat_xor_val_self_test+0x498/0xcf0 [ioatdma]
    [] ? kfree+0xda/0x2b0
    [] ? ioat_dma_setup_interrupts+0x120/0x2d0 [ioatdma]
    [] ioat3_dma_self_test+0x1e/0x30 [ioatdma]
    [] ioat_probe+0xf4/0x110 [ioatdma]
    [] ioat3_dma_probe+0x198/0x3a0 [ioatdma]
    [] ioat_pci_probe+0x11e/0x1b0 [ioatdma]
    [] local_pci_probe+0x45/0xa0
    [] ? pci_match_device+0xe5/0x110
    [] pci_device_probe+0xd9/0x130
    [] driver_probe_device+0x90/0x3c0
    [] __driver_attach+0x93/0xa0
    [] ? __device_attach+0x40/0x40
    [] bus_for_each_dev+0x6b/0xb0
    [] driver_attach+0x1e/0x20
    [] bus_add_driver+0x188/0x260
    [] ? 0xffffffffa0423000
    [] driver_register+0x64/0xf0
    [] __pci_register_driver+0x60/0x70
    [] ioat_init_module+0x89/0x1000 [ioatdma]
    [] do_one_initcall+0xbc/0x200
    [] ? __vunmap+0xd2/0x120
    [] load_module+0x14ec/0x1b50
    [] ? store_uevent+0x40/0x40
    [] SyS_finit_module+0x86/0xb0
    [] system_call_fastpath+0x16/0x1b
    ---[ end trace 1052ccbbc3db4d08 ]---
    Mapped at:
    [] debug_dma_map_page+0x91/0x140
    [] ioat_xor_val_self_test+0x1ce/0xcf0 [ioatdma]
    [] ioat3_dma_self_test+0x1e/0x30 [ioatdma]
    [] ioat_probe+0xf4/0x110 [ioatdma]
    [] ioat3_dma_probe+0x198/0x3a0 [ioatdma]

    This happens because the current ioatdma DMA test code does not check the return
    value of dma_map_page() calls with dma_mapping_error(). In addition, it was
    noticed that mapping for the variable dest_dma is free'd before the last use.

    This patch fixes these errors by initializing the dma_srcs[] array and checking
    the returns with dma_mapping_error().

    Signed-off-by: Prarit Bhargava
    Signed-off-by: Vinod Koul

    Prarit Bhargava
     
  • The manual says that we need to (repeatedly) set the TearDown-bit for
    the endpoint in order to get the active transfer descriptor released.
    Doing this "real" quick over and over again seems to work but it also
    seems that the hardware might not have enough time to breathe. So I
    though, hey lets add a udelay() between between the individual sets
    of the bit.
    This change with the g_zero testcase resulted in a warning about missing
    transfer descriptor (we got the tear-down one). It seems that if the
    hardware has some time it manages to release the transfer-descriptor on
    the completion queue after the teaddown descriptor.
    With this change, I observe that the transfer descriptor is released
    after 20-30 retry loops.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Vinod Koul

    Sebastian Andrzej Siewior
     
  • For a "complete" teardown we have to wait until the teardown descriptor
    is returned by the hardware. The g_zero testcase "testusb -a -t 9" triggers
    the following warning quite reliable:

    |------------[ cut here ]------------
    |WARNING: CPU: 0 PID: 0 at drivers/dma/cppi41.c:609 cppi41_dma_control+0x198/0x304()
    |[] (warn_slowpath_null) from []
    |[] (cppi41_dma_control) from []
    |[] (cppi41_dma_channel_abort [musb_hdrc])
    |[] (nuke.constprop.10 [musb_hdrc])
    |[] (musb_gadget_disable [musb_hdrc])
    |[] (disable_endpoints [usb_f_ss_lb])
    |[] (disable_source_sink [usb_f_ss_lb])
    |[] (sourcesink_set_alt [usb_f_ss_lb])
    |[] (composite_setup [libcomposite])
    |[] (musb_g_ep0_irq [musb_hdrc])
    |[] (musb_interrupt [musb_hdrc])
    |[] (dsps_interrupt [musb_dsps])
    |[] (handle_irq_event_percpu)
    |[] (handle_irq_event)
    |[] (handle_level_irq)
    |[] (generic_handle_irq)
    |[] (handle_IRQ)
    |[] (omap3_intc_handle_irq)

    and complains about a TD descriptor which is not returned. I've been
    looking at several things and haven't noticed anything unusual that
    might lead to this.
    The manual says "to try again" until the descriptor comes out. I limited
    the amount of retries to 100 retries in order to avoid an infinite number
    of retries and so a busy-loop. Back then testing revealed that the
    number of retries were around 20-30 so 100 seemed a good upper limit.
    This g_zero test reaches without a problem 98 retries and it jumps
    sometimes to 101 on am335x-evm and so the WARN_ON() triggers. Same test
    run on beaglebone black and the retries start at 122 and my max value so
    far was at 128.
    So lets rise the limit to 500.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Vinod Koul

    Sebastian Andrzej Siewior
     
  • The offset of all 8-/16-bit registers in big-endian eDMA model are
    swapped in a 32-bit size opposite those in the little-endian model.

    The hardware Scatter/Gather requires the subsequent TCDs stored in memory
    in little endian independent of the register endian model, the eDMA engine
    will do the swap if need.

    This patch also use regular assignment for tcd variables r/w
    instead of with io function previously that may not always be true.

    Signed-off-by: Jingchang Lu
    Signed-off-by: Vinod Koul

    Jingchang Lu
     

08 Dec, 2014

1 commit


06 Dec, 2014

4 commits

  • After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
    selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
    depending on CONFIG_PM_RUNTIME may now be changed to depend on
    CONFIG_PM.

    Replace CONFIG_PM_RUNTIME with CONFIG_PM in drivers/dma/nbpfaxi.c
    and drivers/dma/tegra20-apb-dma.c.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Vinod Koul

    Rafael J. Wysocki
     
  • pch_dma_id_table is used in pch_dma.c only, so declare
    it as static

    Signed-off-by: Michele Curti
    Signed-off-by: Vinod Koul

    Michele Curti
     
  • Return a negative error code on failure.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret; expression e1,e2;
    @@
    (
    if (\(ret < 0\|ret != 0\))
    { ... return ret; }
    |
    ret = 0
    )
    ... when != ret = e1
    when != &ret
    *if(...)
    {
    ... when != ret = e2
    when forall
    return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Acked-by: Linus Walleij
    Signed-off-by: Vinod Koul

    Julia Lawall
     
  • When a firmware cannot be found for the SDMA engine then we can
    continue with the internal ROM firmware.

    The meaning of this message is frequently asked for, so make clear
    that the driver still works with the internal ROM firmware and reduce
    the loglevel from err to info.

    Signed-off-by: Sascha Hauer
    Signed-off-by: Fabio Estevam
    Acked-by: Shawn Guo
    Acked-by: Sascha Hauer
    Signed-off-by: Vinod Koul

    Sascha Hauer
     

05 Dec, 2014

2 commits


04 Dec, 2014

2 commits

  • The SET_PM_RUNTIME_PM_OPS() and SET_RUNTIME_PM_OPS() macros are
    identical except that one of them is not empty for CONFIG_PM set,
    while the other one is not empty for CONFIG_PM_RUNTIME set,
    respectively.

    However, after commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if
    PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so one
    of these macros is now redundant.

    For this reason, replace SET_PM_RUNTIME_PM_OPS() with
    SET_RUNTIME_PM_OPS() everywhere and redefine the SET_PM_RUNTIME_PM_OPS
    symbol as SET_RUNTIME_PM_OPS in case new code is starting to use the
    macro being removed here.

    Reviewed-by: Ulf Hansson
    Acked-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Rafael J. Wysocki
     

28 Nov, 2014

1 commit


25 Nov, 2014

1 commit


22 Nov, 2014

1 commit

  • Pull dmaengine fixes from Vinod Koul:
    "We have couple of fixes for dmaengine queued up:
    - dma mempcy fix for dma configuration of sun6i by Maxime
    - pl330 fixes: First the fixing allocation for data buffers by Liviu
    and then Jon's fixe for fifo width and usage"

    * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
    dmaengine: Fix allocation size for PL330 data buffer depth.
    dmaengine: pl330: Limit MFIFO usage for memcpy to avoid exhausting entries
    dmaengine: pl330: Align DMA memcpy operations to MFIFO width
    dmaengine: sun6i: Fix memcpy operation

    Linus Torvalds
     

18 Nov, 2014

1 commit

  • This patch adds runtime PM support to pl330 DMA engine driver.

    The runtime power management for pl330 DMA driver allows gating of AMBA
    clock (PDMA) in FSYS clock domain, when the device is not processing any
    requests. This is necessary to enter low power modes on Exynos SoCs
    (e.g. LPA on Exynos4x12 or W-AFTR on Exynos3250).

    Runtime PM resuming of the device may happen in atomic context (during
    call device_issue_pending()) so pm_runtime_irq_safe() is used. This will
    lead only to disabling/enabling of the clock but this is sufficient for
    gating the clock and for reducing energy usage.

    Driver uses runtime PM callbacks from amba/bus.c driver only.

    Suggested-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Ulf Hansson
    Acked-by: Vinod Koul
    Signed-off-by: Russell King

    Krzysztof Kozlowski
     

17 Nov, 2014

17 commits

  • same issue as commit 7f5ae3553685:
    "Without DMA_PRIVATE the driver is not able to allocate more than one channel.
    Since it uses dma_get_any_slave_channel that calls private_candidate, the
    second allocation fails at
    /* some channels are already publicly allocated */
    "

    Signed-off-by: Ludovic Desroches
    Signed-off-by: Vinod Koul

    Ludovic Desroches
     
  • Lock taken when entering the function but unlock missing before it
    returns.

    Signed-off-by: Ludovic Desroches
    Reported-by: Dan Carpenter
    Signed-off-by: Vinod Koul

    Ludovic Desroches
     
  • The total size of the transfer was wrong in at_xdmac_prep_slave_sg()
    resulting in bad computation of the transfer residue by
    at_xdmac_tx_status().

    Signed-off-by: Cyrille Pitchen
    Signed-off-by: Ludovic Desroches
    Signed-off-by: Vinod Koul

    Cyrille Pitchen
     
  • According to the Atmel eXtended DMA controller datasheet, requesting a
    DMA transfer flush for a channel is only revelant when this transfer is
    source peripheral synchronized.

    So we have to check this condition before requesting a channel flush by
    writing the channel bit into the Global channel SoftWare Flush (GSWF)
    register then waiting for flush to complete by monitoring the end of
    Flush Interrupt Status (FIS) bit in the Channel Interrupt Status (CIS)
    register.

    Indeed, for non source peripheral synchronized transfer, writing the
    channel bit into the GSWF register does nothing. Especially, the FIS bit
    is never set into the CIS register. The former code looped forever
    waiting for this bit to be set.

    Signed-off-by: Cyrille Pitchen
    Signed-off-by: Ludovic Desroches
    Signed-off-by: Vinod Koul

    Cyrille Pitchen
     
  • Remove chancnt affectation since it is done in dma_async_device_regiser.

    Signed-off-by: Ludovic Desroches
    Signed-off-by: Vinod Koul

    Ludovic Desroches
     
  • _relaxed version of readl and writel are not implemented on all
    architecture so COMPILE_TEST has to be removed in order to not cause
    some build failures.

    Signed-off-by: Ludovic Desroches
    Signed-off-by: Vinod Koul

    Ludovic Desroches
     
  • As documented in printk-formats.txt the dma_addr_t should be printed with
    %pad specfiers. This way it works on all archs.

    make.cross ARCH=s390

    All warnings:

    drivers/dma/at_xdmac.c: In function 'at_xdmac_prep_slave_sg':
    >> drivers/dma/at_xdmac.c:621:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    >> drivers/dma/at_xdmac.c:621:3: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    >> drivers/dma/at_xdmac.c:628:4: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    drivers/dma/at_xdmac.c: In function 'at_xdmac_prep_dma_cyclic':
    >> drivers/dma/at_xdmac.c:663:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan), "%s: buf_addr=0x%08x, buf_len=%d, period_len=%d, dir=%s, flags=0x%lx\n",
    ^
    >> drivers/dma/at_xdmac.c:690:3: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    >> drivers/dma/at_xdmac.c:709:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    >> drivers/dma/at_xdmac.c:709:3: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    >> drivers/dma/at_xdmac.c:716:4: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),

    >> drivers/dma/at_xdmac.c:731:2: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    drivers/dma/at_xdmac.c: In function 'at_xdmac_prep_dma_memcpy':
    >> drivers/dma/at_xdmac.c:765:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan), "%s: src=0x%08x, dest=0x%08x, len=%d, flags=0x%lx\n",
    ^
    >> drivers/dma/at_xdmac.c:765:2: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan), "%s: remaining_size=%u\n", __func__, remaining_size);
    ^
    >> drivers/dma/at_xdmac.c:845:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    >> drivers/dma/at_xdmac.c:845:3: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    >> drivers/dma/at_xdmac.c:852:4: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),
    ^
    drivers/dma/at_xdmac.c: In function 'at_xdmac_tx_status':
    >> drivers/dma/at_xdmac.c:929:2: warning: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat=]
    dev_dbg(chan2dev(chan),

    Reported-by: kbuild test robot
    Signed-off-by: Vinod Koul

    Vinod Koul
     
  • As documented in printk-formats.txt the size_t should be printed with
    %zu/%zd specfiers. This way it works on all archs.

    make.cross ARCH=avr32

    All warnings:

    drivers/dma/at_xdmac.c: In function 'at_xdmac_prep_dma_cyclic':
    >> drivers/dma/at_xdmac.c:663: warning: format '%d' expects type 'int', but argument 6 has type 'size_t'
    >> drivers/dma/at_xdmac.c:663: warning: format '%d' expects type 'int', but argument 7 has type 'size_t'
    drivers/dma/at_xdmac.c: In function 'at_xdmac_prep_dma_memcpy':
    >> drivers/dma/at_xdmac.c:765: warning: format '%d' expects type 'int', but argument 7 has type 'size_t'
    >> drivers/dma/at_xdmac.c:794: warning: format '%u' expects type 'unsigned int', but argument 5 has type 'size_t'
    >> drivers/dma/at_xdmac.c:815: warning: format '%u' expects type 'unsigned int', but argument 5 has type 'size_t'

    Reported-by: kbuild test robot
    Signed-off-by: Vinod Koul

    Vinod Koul
     
  • This driver uses read_relaxed and writel_relaxed to read, write to IO
    memory. the config defines COMPILE_TEST so gets compiled on different archs.
    This causes issue as few archs like x86 etc don't define it.
    So use readl/writel which is defined in all archs

    Reported-by: kbuild test robot
    Signed-off-by: Vinod Koul

    Vinod Koul
     
  • drivers/dma/at_xdmac.c:702:3-4: Unneeded semicolon

    Removes unneeded semicolon.

    Generated by: scripts/coccinelle/misc/semicolon.cocci

    Signed-off-by: Fengguang Wu
    Signed-off-by: Vinod Koul

    kbuild test robot
     
  • Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
    build warning when CONFIG_PM_SLEEP is not selected. This is because
    sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
    the CONFIG_PM_SLEEP is enabled.

    drivers/dma/k3dma.c:790:12: warning: 'k3_dma_suspend' defined but not used [-Wunused-function]
    drivers/dma/k3dma.c:806:12: warning: 'k3_dma_resume' defined but not used [-Wunused-function]

    Signed-off-by: Jingoo Han
    Acked-by: Zhangfei Gao
    Signed-off-by: Vinod Koul

    Jingoo Han
     
  • Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
    build warning when CONFIG_PM_SLEEP is not selected. This is because
    sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used
    when the CONFIG_PM_SLEEP is enabled.

    drivers/dma/sirf-dma.c:838:12: warning: 'sirfsoc_dma_pm_suspend' defined but not used [-Wunused-function]
    drivers/dma/sirf-dma.c:879:12: warning: 'sirfsoc_dma_pm_resume' defined but not used [-Wunused-function]

    Signed-off-by: Jingoo Han
    Signed-off-by: Vinod Koul

    Jingoo Han
     
  • This patch simply adds a new DMATYPE for SAI which's included
    in i.MX6 Solo X.

    Signed-off-by: Nicolin Chen
    Acked-by: Shawn Guo
    Signed-off-by: Vinod Koul

    Nicolin Chen
     
  • This patch fixes a race condition about a list of shdma-base driver.
    If we don't apply this patch, a dma slave driver (especially a usb
    peripheral driver) may not be able to start the transfer.

    If a dma slave driver has a callback, __ld_cleanup() will call
    the callback before this driver removes the list. After the callback,
    since the return value of __ld_cleanup() is not zero,
    shdma_chan_ld_cleanup() calls __ld_cleanup() again. And, __ld_clean()
    will removes the list.

    At this time, if a dma slave driver calls dmaengine_submit() before
    this driver removes the list, this driver will set schan->pm_state
    to SHDMA_PM_PENDING in shdma_tx_submit(). And then, even if a dma
    slave driver calls dma_async_issue_pending(), this driver don't
    start the transfer because the schan->pm_state is SHDMA_PM_PENDING
    in shdma_issue_pending().

    So, this patch adds a new condition in __ld_clean() to check if the
    schan->pm_state is SHDMA_PM_PENDING or not.

    Signed-off-by: Yoshihiro Shimoda
    Signed-off-by: Vinod Koul

    Yoshihiro Shimoda
     
  • We currently have register offset information only for BAM IPs with revision
    1.4.0. We add register offset table entries for the legacy (v1.3.0) version
    of BAM IPs found on SoCs like APQ8064 and MSM8960.

    The register offset table pointers are stored in DT data corresponding to the
    BAM IP version specified in the compatible string.

    Reviewed-by: Kumar Gala
    Reviewed-by: Andy Gross
    Signed-off-by: Archit Taneja
    Signed-off-by: Vinod Koul

    Archit Taneja
     
  • The BAM DMA IP comes in different versions. The register offset layout varies
    among these versions. The layouts depend on which generation/family of SoCs they
    belong to.

    The current SoCs(like 8084, 8074) have a layout where the Top level registers
    come in the beginning of the address range, followed by pipe and event
    registers. The BAM revision numbers fall above 1.4.0.

    The older SoCs (like 8064, 8960) have a layout where the pipe registers come
    first, and the top level come later. These have BAM revision numbers lesser than
    1.4.0.

    It isn't suitable to have macros provide the register offsets with the layouts
    changed. Future BAM revisions may have different register layouts too. The
    register addresses are now calculated by referring a table which contains a base
    offset and multipliers for pipe/evnt/ee registers.

    We have a common function bam_addr() which computes addresses for all the
    registers. When computing address of top level/ee registers, we pass 0 to the
    pipe argument in addr() since they don't have any multiple instances.

    Some of the unused register definitions are removed. We can add new registers as
    we need them.

    Reviewed-by: Kumar Gala
    Reviewed-by: Andy Gross
    Signed-off-by: Archit Taneja
    Signed-off-by: Vinod Koul

    Archit Taneja
     
  • The A23 SoC has the same dma engine as the A31 (sun6i), with a
    reduced amount of endpoints and physical channels. Add the proper
    config data and compatible string to support it.

    A slight difference in sun8i is an undocumented register needs
    to be toggled for dma to function.

    Signed-off-by: Chen-Yu Tsai
    Acked-by: Maxime Ripard
    Signed-off-by: Vinod Koul

    Chen-Yu Tsai