Skip to content
Permalink
Zong-Li/Determ…
Switch branches/tags

Commits on Jan 14, 2022

  1. dmaengine: sf-pdma: Get number of channel by device tree

    It currently assumes that there are always four channels, it would
    cause the error if there is actually less than four channels. Change
    that by getting number of channel from device tree.
    
    For backwards-compatible, it uses the default value (i.e. 4) when there
    is no 'dma-channels' information in dts.
    
    Signed-off-by: Zong Li <zong.li@sifive.com>
    zongbox authored and intel-lab-lkp committed Jan 14, 2022
  2. dt-bindings: Add dma-channels for pdma device node

    Add dma-channels property, then we can determine how many channels there
    by device tree, rather than statically defines it in PDMA driver
    
    Signed-off-by: Zong Li <zong.li@sifive.com>
    zongbox authored and intel-lab-lkp committed Jan 14, 2022
  3. riscv: dts: Add dma-channels property in dma node

    Add dma-channels property, then we can determine how many channels there
    by device tree.
    
    Signed-off-by: Zong Li <zong.li@sifive.com>
    zongbox authored and intel-lab-lkp committed Jan 14, 2022

Commits on Jan 8, 2022

  1. dt-bindings: dma-controller: Split interrupt fields in example

    Best practice for multi-cell property values is to bracket each multi-cell
    value.
    
    Signed-off-by: Rob Herring <robh@kernel.org>
    Link: https://lore.kernel.org/r/20220106182518.1435497-2-robh@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    robherring authored and vinodkoul committed Jan 8, 2022
  2. dmaengine: pch_dma: Remove usage of the deprecated "pci-dma-compat.h"…

    … API
    
    In [1], Christoph Hellwig has proposed to remove the wrappers in
    include/linux/pci-dma-compat.h.
    
    Some reasons why this API should be removed have been given by Julia
    Lawall in [2].
    
    A coccinelle script has been used to perform the needed transformation.
    It can be found in [3].
    
    [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/
    [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/
    [3]: https://lore.kernel.org/kernel-janitors/20200716192821.321233-1-christophe.jaillet@wanadoo.fr/
    
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Reviewed-by: Arnd Bergmann <arnd@arndb.de>
    Link: https://lore.kernel.org/r/b88f25f3d07be92dd75494dc129a85619afb1366.1641500561.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    tititiou36 authored and vinodkoul committed Jan 8, 2022

Commits on Jan 5, 2022

  1. dmaengine: at_xdmac: Fix race over irq_status

    Tasklets run with interrupts enabled, so we need to protect
    atchan->irq_status with spin_lock_irq() otherwise the tasklet can be
    interrupted by the IRQ that modifies irq_status. Move the dev_dbg that
    prints the irq_status in at_xdmac_handle_cyclic() and lower in
    at_xdmac_tasklet() where the IRQ is disabled.
    
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-13-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  2. dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_tasklet()

    Apart of making the code easier to read, this patch is a prerequisite for
    a functional change: tasklets run with interrupts enabled, so we need to
    protect atchan->irq_status with spin_lock_irq() otherwise the tasklet can
    be interrupted by the IRQ that modifies irq_status. atchan->irq_status
    will be protected in a further patch.
    
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-12-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  3. dmaengine: at_xdmac: Fix at_xdmac_lld struct definition

    The hardware channel next descriptor view structure contains just
    fields of 32 bits, while dma_addr_t can be of type u64 or u32
    depending on CONFIG_ARCH_DMA_ADDR_T_64BIT. Force u32 to comply with
    what the hardware expects.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-11-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  4. dmaengine: at_xdmac: Fix lld view setting

    AT_XDMAC_CNDC_NDVIEW_NDV3 was set even for AT_XDMAC_MBR_UBC_NDV2,
    because of the wrong bit handling. Fix it.
    
    Fixes: ee0fe35 ("dmaengine: xdmac: Handle descriptor's view 3 registers")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-10-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  5. dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_advanc…

    …e_work()
    
    It's easier to read code with fewer levels of indentation, remove a level
    of indentation in at_xdmac_advance_work()
    
    if (!foo() & !bar()) {
    }
    
    was replaced by:
    
    if (foo() || bar())
    	return;
    
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-9-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  6. dmaengine: at_xdmac: Fix concurrency over xfers_list

    Since tx_submit can be called from a hard IRQ, xfers_list must be
    protected with a lock to avoid concurency on the list's elements.
    Since at_xdmac_handle_cyclic() is called from a tasklet, spin_lock_irq
    is enough to protect from a hard IRQ.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-8-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  7. dmaengine: at_xdmac: Move the free desc to the tail of the desc list

    Move the free desc to the tail of the list, so that the sequence of
    descriptors is more track-able in case of debug. One would know which
    descriptor should come next and could easier catch concurrency over
    descriptors for example. virt-dma uses list_splice_tail_init() as well,
    follow the core driver.
    
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-7-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  8. dmaengine: at_xdmac: Fix race for the tx desc callback

    The transfer descriptors were wrongly moved to the free descriptors list
    before calling the tx desc callback. As the DMA engine drivers drop any
    locks before calling the callback function, txd could be taken again,
    resulting in its callback called prematurely. Fix the race for the tx desc
    callback by moving the xfer desc into the free desc list after the
    callback is invoked.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-6-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  9. dmaengine: at_xdmac: Fix concurrency over chan's completed_cookie

    Caller of dma_cookie_complete is expected to hold a lock to prevent
    concurrency over the channel's completed cookie marker. Call
    dma_cookie_complete() with the lock held.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-5-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  10. dmaengine: at_xdmac: Print debug message after realeasing the lock

    It is desirable to do the prints without the lock held if possible, so
    move the print after the lock is released.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-4-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  11. dmaengine: at_xdmac: Start transfer for cyclic channels in issue_pending

    Cyclic channels must too call issue_pending in order to start a transfer.
    Start the transfer in issue_pending regardless of the type of channel.
    This wrongly worked before, because in the past the transfer was started
    at tx_submit level when only a desc in the transfer list.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-3-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  12. dmaengine: at_xdmac: Don't start transactions at tx_submit level

    tx_submit is supposed to push the current transaction descriptor to a
    pending queue, waiting for issue_pending() to be called. issue_pending()
    must start the transfer, not tx_submit(), thus remove
    at_xdmac_start_xfer() from at_xdmac_tx_submit(). Clients of at_xdmac that
    assume that tx_submit() starts the transfer must be updated and call
    dma_async_issue_pending() if they miss to call it (one example is
    atmel_serial).
    
    As the at_xdmac_start_xfer() is now called only from
    at_xdmac_advance_work() when !at_xdmac_chan_is_enabled(), the
    at_xdmac_chan_is_enabled() check is no longer needed in
    at_xdmac_start_xfer(), thus remove it.
    
    Fixes: e1f7c9e ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
    Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
    Link: https://lore.kernel.org/r/20211215110115.191749-2-tudor.ambarus@microchip.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ambarus authored and vinodkoul committed Jan 5, 2022
  13. dmaengine: idxd: deprecate token sysfs attributes for read buffers

    The following sysfs attributes will be obsolete due to the name change of
    tokens to read buffers:
    max_tokens
    token_limit
    group/tokens_allowed
    group/tokens_reserved
    group/use_token_limit
    
    Create new entries and have old entry print warning of deprecation.
    
    New attributes to replace the token ones:
    max_read_buffers
    read_buffer_limit
    group/read_buffers_allowed
    group/read_buffers_reserved
    group/use_read_buffer_limit
    
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/163951339488.2988321.2424012059911316373.stgit@djiang5-desk3.ch.intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    davejiang authored and vinodkoul committed Jan 5, 2022
  14. dmaengine: idxd: change bandwidth token to read buffers

    DSA spec v1.2 has changed the term of "bandwidth tokens" to "read buffers"
    in order to make the concept clearer. Deprecate bandwidth token
    naming in the driver and convert to read buffers in order to match with
    the spec and reduce confusion when reading the spec.
    
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/163951338932.2988321.6162640806935567317.stgit@djiang5-desk3.ch.intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    davejiang authored and vinodkoul committed Jan 5, 2022
  15. dmaengine: idxd: fix wq settings post wq disable

    By the spec, wq size and group association is not changeable unless device
    is disabled. Exclude clearing the shadow copy on wq disable/reset. This
    allows wq type to be changed after disable to be re-enabled.
    
    Move the size and group association to its own cleanup and only call it
    during device disable.
    
    Fixes: 0dcfe41 ("dmanegine: idxd: cleanup all device related bits after disabling device")
    Reported-by: Lucas Van <lucas.van@intel.com>
    Tested-by: Lucas Van <lucas.van@intel.com>
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/163951291732.2987775.13576571320501115257.stgit@djiang5-desk3.ch.intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    davejiang authored and vinodkoul committed Jan 5, 2022
  16. dmaengine: idxd: change MSIX allocation based on per wq activation

    Change the driver where WQ interrupt is requested only when wq is being
    enabled. This new scheme set things up so that request_threaded_irq() is
    only called when a kernel wq type is being enabled. This also sets up for
    future interrupt request where different interrupt handler such as wq
    occupancy interrupt can be setup instead of the wq completion interrupt.
    
    Not calling request_irq() until the WQ actually needs an irq also prevents
    wasting of CPU irq vectors on x86 systems, which is a limited resource.
    
    idxd_flush_pending_descs() is moved to device.c since descriptor flushing
    is now part of wq disable rather than shutdown().
    
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/163942149487.2412839.6691222855803875848.stgit@djiang5-desk3.ch.intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    davejiang authored and vinodkoul committed Jan 5, 2022
  17. dmaengine: idxd: fix descriptor flushing locking

    The descriptor flushing for shutdown is not holding the irq_entry list
    lock. If there's ongoing interrupt completion handling, this can corrupt
    the list. Add locking to protect list walking. Also refactor the code so
    it's more compact.
    
    Fixes: 8f47d1a ("dmaengine: idxd: connect idxd to dmaengine subsystem")
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/163942148935.2412839.18282664745572777280.stgit@djiang5-desk3.ch.intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    davejiang authored and vinodkoul committed Jan 5, 2022
  18. dmaengine: idxd: embed irq_entry in idxd_wq struct

    With irq_entry already being associated with the wq in a 1:1 relationship,
    embed the irq_entry in the idxd_wq struct and remove back pointers for
    idxe_wq and idxd_device. In the process of this work, clean up the interrupt
    handle assignment so that there's no decision to be made during submit
    call on where interrupt handle value comes from. Set the interrupt handle
    during irq request initialization time.
    
    irq_entry 0 is designated as special and is tied to the device itself.
    
    Signed-off-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/163942148362.2412839.12055447853311267866.stgit@djiang5-desk3.ch.intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    davejiang authored and vinodkoul committed Jan 5, 2022
  19. dmaengine: ioatdma: use default_groups in kobj_type

    There are currently 2 ways to create a set of sysfs files for a
    kobj_type, through the default_attrs field, and the default_groups
    field.  Move the ioatdma sysfs code to use default_groups field which has
    been the preferred way since aa30f47 ("kobject: Add support for
    default attribute groups to kobj_type") so that we can soon get rid of
    the obsolete default_attrs field.
    
    Cc: Vinod Koul <vkoul@kernel.org>
    Cc: dmaengine@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Acked-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/20220104163330.1338824-1-gregkh@linuxfoundation.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    gregkh authored and vinodkoul committed Jan 5, 2022
  20. Merge branch 'fixes' into next

    We have a conflict in idxd driver between 'fixes' and 'next' and there
    are patches dependent on this so, merge the 'fixes' branch into next
    vinodkoul committed Jan 5, 2022

Commits on Jan 3, 2022

  1. dmaengine: uniphier-xdmac: Fix type of address variables

    The variables src_addr and dst_addr handle DMA addresses, so these should
    be declared as dma_addr_t.
    
    Fixes: 667b925 ("dmaengine: uniphier-xdmac: Add UniPhier external DMA controller driver")
    Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
    Link: https://lore.kernel.org/r/1639456963-10232-1-git-send-email-hayashi.kunihiko@socionext.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    khayash1 authored and vinodkoul committed Jan 3, 2022
  2. dmaengine: xilinx_dpdma: use correct SDPX tag for header file

    Commit 188c310 ("dmaengine: xilinx_dpdma: stop using slave_id
    field") add the header file with incorrect format for SPDX tag, fix that
    
    WARNING: Improper SPDX comment style for 'include/linux/dma/xilinx_dpdma.h', please use '/*' instead
    #1: FILE: include/linux/dma/xilinx_dpdma.h:1:
    +// SPDX-License-Identifier: GPL-2.0
    
    WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
    #1: FILE: include/linux/dma/xilinx_dpdma.h:1:
    +// SPDX-License-Identifier: GPL-2.0
    
    Fixes: 188c310 ("dmaengine: xilinx_dpdma: stop using slave_id field")
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Link: https://lore.kernel.org/r/20211213052141.850807-1-vkoul@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    vinodkoul committed Jan 3, 2022
  3. dt-bindings: dma: pl330: Convert to DT schema

    Convert the Arm PL330 DMA controller binding to DT schema.
    
    The '#dma-channels' and '#dma-requests' properties are unused as they are
    discoverable and are non-standard (the standard props don't have '#'). So
    drop them from the binding.
    
    Cc: Vinod Koul <vkoul@kernel.org>
    Cc: dmaengine@vger.kernel.org
    Signed-off-by: Rob Herring <robh@kernel.org>
    Link: https://lore.kernel.org/r/20211217170644.3145332-1-robh@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    robherring authored and vinodkoul committed Jan 3, 2022
  4. dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK

    This patch fixes STM32_MDMA_CTBR_TSEL_MASK, which is [5:0], not [7:0].
    
    Fixes: a4ffb13 ("dmaengine: Add STM32 MDMA driver")
    Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
    Link: https://lore.kernel.org/r/20211220165827.1238097-1-amelie.delaunay@foss.st.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Amelie Delaunay authored and vinodkoul committed Jan 3, 2022
  5. dmaengine: rcar-dmac: Add support for R-Car S4-8

    Add support for R-Car S4-8. We can reuse R-Car V3U code so that
    renames variable names as "gen4".
    
    Note that some registers of R-Car V3U do not exist on R-Car S4-8,
    but none of them are used by the driver for now.
    
    Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://lore.kernel.org/r/20211222114507.1252947-3-yoshihiro.shimoda.uh@renesas.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    shimoday authored and vinodkoul committed Jan 3, 2022
  6. dt-bindings: renesas,rcar-dmac: Add r8a779f0 support

    Document the compatible value for the Direct Memory Access Controller
    blocks in the Renesas R-Car S4-8 (R8A779F0) SoC.
    
    The most visible difference with DMAC blocks on other R-Car SoCs
    (except R8A779A0) is the move of the per-channel registers to
    a separate register block.
    
    Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://lore.kernel.org/r/20211222114507.1252947-2-yoshihiro.shimoda.uh@renesas.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    shimoday authored and vinodkoul committed Jan 3, 2022

Commits on Dec 17, 2021

  1. Merge tag 'dmaengine_topic_slave_id_removal_5.17' into next

    Merge the tag dmaengine_topic_slave_id_removal_5.17 into next. This
    brings in the slave_id removal topic changes
    vinodkoul committed Dec 17, 2021
  2. dmaengine: sh: Use bitmap_zalloc() when applicable

    'shdma_slave_used' is a bitmap. So use 'bitmap_zalloc()' to simplify code,
    improve the semantic and avoid some open-coded arithmetic in allocator
    arguments.
    
    Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
    consistency.
    
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Link: https://lore.kernel.org/r/3efaf2784424ae3d7411dc47f8b6b03e7bb8c059.1637702701.git.christophe.jaillet@wanadoo.fr
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    tititiou36 authored and vinodkoul committed Dec 17, 2021
  3. dmaengine: stm32-mdma: Use bitfield helpers

    Use the FIELD_{GET,PREP}() helpers, instead of defining custom macros
    implementing the same operations.
    
    Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://lore.kernel.org/r/36ceab242a594233dc7dc6f1dddb4ac32d1e846f.1637593297.git.geert+renesas@glider.be
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    geertu authored and vinodkoul committed Dec 17, 2021
  4. dmaengine: stm32-mdma: Remove redundant initialization of pointer hwdesc

    The pointer hwdesc is being initialized with a value that is never
    read, it is being updated later in a for-loop. The assignment is
    redundant and can be removed.
    
    Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
    Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
    Link: https://lore.kernel.org/r/20211204140032.548066-1-colin.i.king@gmail.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    ColinIanKing authored and vinodkoul committed Dec 17, 2021
Older