summaryrefslogtreecommitdiff
path: root/drivers/dma
AgeCommit message (Collapse)Author
2026-03-09dmaengine: sh: rz_dmac: add RZ/{T2H,N2H} supportCosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a completely different ICU unit compared to RZ/V2H, which requires a separate implementation. Add support for them. RZ/N2H will use RZ/T2H as a fallback. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105114445.878262-5-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: sh: rz_dmac: make register_dma_req() chip-specificCosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a completely different ICU unit compared to RZ/V2H, which requires a separate implementation. To prepare for adding support for these SoCs, add a chip-specific structure and put a pointer to the rzv2h_icu_register_dma_req() function in the .register_dma_req field of the chip-specific structure to allow for other implementations. Do the same for the default request value, RZV2H_ICU_DMAC_REQ_NO_DEFAULT, and place it into .dma_req_no_default. While at it, factor out the logic that calls .register_dma_req() or rz_dmac_set_dmars_register() into a separate function to remove some code duplication. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105114445.878262-3-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: sh: rz_dmac: make error interrupt optionalCosmin Tanislav
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs do not have an error interrupt for the DMACs, and the current driver implementation does not make much use of it. To prepare for adding support for these SoCs, do not error out if the error interrupt is missing. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105114445.878262-2-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: fsl-qdma: Use dev_err_probe() to simplify codeFrank Li
Use dev_err_probe() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-13-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: fsl-edma: Use dev_err_probe() to simplify codeFrank Li
Use dev_err_probe() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-12-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: fsl-edma: Use managed API dmaenginem_async_device_register()Frank Li
Use managed API dmaenginem_async_device_register() and devm_of_dma_controller_register() to simple code. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-11-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: imx-sdma: Use dev_err_probe() to simplify codeFrank Li
Use dev_err_probe() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-10-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: imx-sdma: Use managed API to simplify codeFrank Li
Use managed API devm_kzalloc(), dmaenginem_async_device_register() and devm_of_dma_controller_register() to simple code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-9-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: imx-sdma: Use devm_clk_get_prepared() to simplify codeFrank Li
Use devm_clk_get_prepared() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-8-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: mxs-dma: Turn MXS_DMA as tristateJindong Yue
Use tristate for mxs-dma to support module building. Signed-off-by: Jindong Yue <jindong.yue@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-7-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: mxs-dma: Add module license and descriptionJindong Yue
Module license string is required for loading it as a module. Signed-off-by: Jindong Yue <jindong.yue@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-6-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: mxs-dma: Use managed API devm_of_dma_controller_register()Frank Li
Use managed API devm_of_dma_controller_register() to prepare support module remove. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-5-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: mxs-dma: Use dev_err_probe() to simplify codeFrank Li
Use dev_err_probe() simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-4-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: mxs-dma: Use local dev variable in probe()Frank Li
Introduce a local dev variable in probe() to avoid repeated use of &pdev->dev throughout the function. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-3-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: mxs-dma: Fix missing return value from of_dma_controller_register()Frank Li
Propagate the return value of of_dma_controller_register() in probe() instead of ignoring it. Fixes: a580b8c5429a6 ("dmaengine: mxs-dma: add dma support for i.MX23/28") Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-2-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: xilinx: Update kernel-doc commentsVinod Koul
Two members of struct xdma_desc_block are not descibed leading to warnings, document them. Warning: drivers/dma/xilinx/xdma.c:75 struct member 'last_interrupt' not described in 'xdma_chan' Warning: drivers/dma/xilinx/xdma.c:75 struct member 'stop_requested' not described in 'xdma_chan' Link: https://patch.msgid.link/20260227022905.233721-1-vkoul@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: xilinx: Simplify with scoped for each OF child loopKrzysztof Kozlowski
Use scoped for-each loop when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260301142158.90319-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: switchtec-dma: Implement descriptor submissionKelvin Cao
On prep, a spin lock is taken and the next entry in the circular buffer is filled. On submit, the spin lock just needs to be released as the requests are already pending. When switchtec_dma_issue_pending() is called, the sq_tail register is written to indicate there are new jobs for the dma engine to start on. Pause and resume operations are implemented by writing to a control register. Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Co-developed-by: George Ge <george.ge@microchip.com> Signed-off-by: George Ge <george.ge@microchip.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Link: https://patch.msgid.link/20260302210419.3656-4-logang@deltatee.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: switchtec-dma: Implement hardware initialization and cleanupKelvin Cao
Initialize the hardware and create the dma channel queues. Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Co-developed-by: George Ge <george.ge@microchip.com> Signed-off-by: George Ge <george.ge@microchip.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Link: https://patch.msgid.link/20260302210419.3656-3-logang@deltatee.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: switchtec-dma: Introduce Switchtec DMA engine skeletonKelvin Cao
Some Switchtec Switches can expose DMA engines via extra PCI functions on the upstream ports. At most one such function can be supported on each upstream port. Each function can have one or more DMA channels. This patch is just the core PCI driver skeleton and dma engine registration. Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com> Co-developed-by: George Ge <george.ge@microchip.com> Signed-off-by: George Ge <george.ge@microchip.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Link: https://patch.msgid.link/20260302210419.3656-2-logang@deltatee.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: dma-axi-dmac: Gracefully terminate HW cyclic transfersNuno Sá
Add support for gracefully terminating hardware cyclic DMA transfers when a new transfer is queued and is flagged with DMA_PREP_LOAD_EOT. Without this, cyclic transfers would continue indefinitely until we brute force it with .device_terminate_all(). When a new descriptor is queued while a cyclic transfer is active, mark the cyclic transfer for termination. For hardware with scatter-gather support, modify the last segment flags to trigger end-of-transfer. For non-SG hardware, clear the CYCLIC flag to allow natural completion. Older IP core versions (pre-4.6.a) can prefetch data when clearing the CYCLIC flag, causing corruption in the next transfer. Work around this by disabling and re-enabling the core to flush prefetched data. The cyclic_eot flag tracks transfers marked for termination, preventing new transfers from starting until the cyclic one completes. Non-EOT transfers submitted after cyclic transfers are discarded with a warning. Also note that for hardware cyclic transfers not using SG, we need to make sure that chan->next_desc is also set to NULL (so we can look at possible EOT transfers) and we also need to move the queue check to after axi_dmac_get_next_desc() because with hardware based cyclic transfers we might get the queue marked as full and hence we would not be able to check for cyclic termination. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20260303-axi-dac-cyclic-support-v2-5-0db27b4be95a@analog.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: dma-axi-dmac: Gracefully terminate SW cyclic transfersNuno Sá
As of now, to terminate a cyclic transfer, one pretty much needs to use brute force and terminate all transfers with .device_terminate_all(). With this change, when a cyclic transfer terminates (and generates an EOT interrupt), look at any new pending transfer with the DMA_PREP_LOAD_EOT flag set. If there is one, the current cyclic transfer is terminated and the next one is enqueued. If the flag is not set, that transfer is ignored. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20260303-axi-dac-cyclic-support-v2-4-0db27b4be95a@analog.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: dma-axi-dmac: Add helper for getting next descNuno Sá
Add a new helper for getting the next valid struct axi_dmac_desc. This will be extended in follow up patches to support to gracefully terminate cyclic transfers. Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20260303-axi-dac-cyclic-support-v2-3-0db27b4be95a@analog.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: dma-axi-dmac: Add cyclic transfers in ↵Nuno Sá
.device_prep_peripheral_dma_vec() Add support for cyclic transfers by checking the DMA_PREP_REPEAT flag. If the flag is set, close the loop and clear the flag for the last segment (the same done for .device_prep_dma_cyclic(). Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20260303-axi-dac-cyclic-support-v2-2-0db27b4be95a@analog.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: ioatdma: make sysfs attributes constThomas Weißschuh
The ioat_sysfs_entry structures are never modified, mark them as read-only. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260304-sysfs-const-ioat-v2-4-b9b82651219b@weissschuh.net Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: ioatdma: make ioat_ktype constThomas Weißschuh
ioat_ktype is never modified, so make it const. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260304-sysfs-const-ioat-v2-3-b9b82651219b@weissschuh.net Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: ioatdma: move sysfs entry definition out of headerThomas Weißschuh
Move struct ioat_sysfs_entry into sysfs.c because it is only used in it. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Frank Li <Frank.Li@nxp.com> Acked-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260304-sysfs-const-ioat-v2-2-b9b82651219b@weissschuh.net Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: ioatdma: make some sysfs structures staticThomas Weißschuh
These structures are only used in sysfs.c, where are defined. Make them static and remove them from the header. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Frank Li <Frank.Li@nxp.com> Acked-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260304-sysfs-const-ioat-v2-1-b9b82651219b@weissschuh.net Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: xilinx: xdma: Fix regmap init error handlingAlexander Stein
devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL. Fix the error check and also fix the error message. Use the error code from ERR_PTR() instead of the wrong value in ret. Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver") Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251014061309.283468-1-alexander.stein@ew.tq-group.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: dw-edma: Fix multiple times setting of the CYCLE_STATE and ↵LUO Haowen
CYCLE_BIT bits for HDMA. Others have submitted this issue (https://lore.kernel.org/dmaengine/ 20240722030405.3385-1-zhengdongxiong@gxmicro.cn/), but it has not been fixed yet. Therefore, more supplementary information is provided here. As mentioned in the "PCS-CCS-CB-TCB" Producer-Consumer Synchronization of "DesignWare Cores PCI Express Controller Databook, version 6.00a": 1. The Consumer CYCLE_STATE (CCS) bit in the register only needs to be initialized once; the value will update automatically to be ~CYCLE_BIT (CB) in the next chunk. 2. The Consumer CYCLE_BIT bit in the register is loaded from the LL element and tested against CCS. When CB = CCS, the data transfer is executed. Otherwise not. The current logic sets customer (HDMA) CS and CB bits to 1 in each chunk while setting the producer (software) CB of odd chunks to 0 and even chunks to 1 in the linked list. This is leading to a mismatch between the producer CB and consumer CS bits. This issue can be reproduced by setting the transmission data size to exceed one chunk. By the way, in the EDMA using the same "PCS-CCS-CB-TCB" mechanism, the CS bit is only initialized once and this issue was not found. Refer to drivers/dma/dw-edma/dw-edma-v0-core.c:dw_edma_v0_core_start. So fix this issue by initializing the CYCLE_STATE and CYCLE_BIT bits only once. Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA") Signed-off-by: LUO Haowen <luo-hw@foxmail.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/tencent_CB11AA9F3920C1911AF7477A9BD8EFE0AD05@qq.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-26dmaengine: Sort headers alphabeticallyAndy Shevchenko
For better maintenance sort headers alphabetically. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260109173718.3605829-4-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-26dmaengine: Use device_match_of_node() helperAndy Shevchenko
Instead of open coding, use device_match_of_node() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260109173718.3605829-3-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-26dmaengine: Refactor devm_dma_request_chan() for readabilityAndy Shevchenko
Yes, while it's a bit longer in terms of LoCs, it's more readable when we use the usual patter to check for errors, and not for a success). This eliminates unneeded assignment and moves the needed one closer to its user which is better programming pattern because it allows avoiding potential errors in case the variable is getting reused. Also note that the same pattern have been used already in dmaenginem_async_device_register(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260109173718.3605829-2-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-26dmaengine: dw-axi-dmac: Add support for CV1800B DMAInochi Amaoto
As the DMA controller on Sophgo CV1800 series SoC only has 8 channels, the SoC provides a dma multiplexer to reuse the DMA channel. However, the dma multiplexer also controls the DMA interrupt multiplexer, which means that the dma multiplexer needs to know the channel number. Allow the driver to use DMA phandle args as the channel number, so the DMA multiplexer can route the DMA interrupt correctly. Signed-off-by: Inochi Amaoto <inochiama@gmail.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260120013706.436742-3-inochiama@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-26dmaengine: dw-axi-dmac: Remove unnecessary return statement from void functionKhairul Anuar Romli
checkpatch.pl --strict reports a WARNING in dw-axi-dmac-platform.c: WARNING: void function return statements are not generally useful FILE: drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c According to Linux kernel coding style [Documentation/process/ coding-style.rst], explicit "return;" statements at the end of void functions are redundant and should be omitted. The function will automatically return upon reaching the closing brace, so the extra statement adds unnecessary clutter without functional benefit. This patch removes the superfluous "return;" statement in dw_axi_dma_set_hw_channel() to comply with kernel coding standards and eliminate the checkpatch warning. Fixes: 32286e279385 ("dmaengine: dw-axi-dmac: Remove free slot check algorithm in dw_axi_dma_set_hw_channel") Signed-off-by: Khairul Anuar Romli <karom.9560@gmail.com> Link: https://patch.msgid.link/20260202060224.12616-4-karom.9560@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-26dmaengine: dw-axi-dmac: Add blank line after functionKhairul Anuar Romli
checkpatch.pl reports a CHECK warning in dw-axi-dmac-platform.c: CHECK: Please use a blank line after function/struct/union/enum declarations drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c: The Linux kernel coding style [Documentation/process/coding-style.rst] requires a blank line after function definitions to provide visual separation between distinct code elements. This patch inserts the required blank line after the closing brace of the function definition after dw_axi_dma_set_byte_halfword(), placing it before the contextual comment that describes the locking requirements. Signed-off-by: Khairul Anuar Romli <karom.9560@gmail.com> Link: https://patch.msgid.link/20260202060224.12616-3-karom.9560@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix leaking event log memoryVinicius Costa Gomes
During the device remove process, the device is reset, causing the configuration registers to go back to their default state, which is zero. As the driver is checking if the event log support was enabled before deallocating, it will fail if a reset happened before. Do not check if the support was enabled, the check for 'idxd->evl' being valid (only allocated if the HW capability is available) is enough. Fixes: 244da66cda35 ("dmaengine: idxd: setup event log configuration") Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-10-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix freeing the allocated ida too lateVinicius Costa Gomes
It can happen that when the cdev .release() is called, the driver already called ida_destroy(). Move ida_free() to the _del() path. We see with DEBUG_KOBJECT_RELEASE enabled and forcing an early PCI unbind. Fixes: 04922b7445a1 ("dmaengine: idxd: fix cdev setup and free device lifetime issues") Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-9-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix memory leak when a wq is resetVinicius Costa Gomes
idxd_wq_disable_cleanup() which is called from the reset path for a workqueue, sets the wq type to NONE, which for other parts of the driver mean that the wq is empty (all its resources were released). Only set the wq type to NONE after its resources are released. Fixes: da32b28c95a7 ("dmaengine: idxd: cleanup workqueue config after disabling") Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-8-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix not releasing workqueue on .release()Vinicius Costa Gomes
The workqueue associated with an DSA/IAA device is not released when the object is freed. Fixes: 47c16ac27d4c ("dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime") Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-7-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Wait for submitted operations on .device_synchronize()Vinicius Costa Gomes
When the dmaengine "core" asks the driver to synchronize, send a Drain operation to the device workqueue, which will wait for the already submitted operations to finish. Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-6-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Flush all pending descriptorsVinicius Costa Gomes
When used as a dmaengine, the DMA "core" might ask the driver to terminate all pending requests, when that happens, flush all pending descriptors. In this context, flush means removing the requests from the pending lists, so even if they are completed after, the user is not notified. Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-5-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Flush kernel workqueues on Function Level ResetVinicius Costa Gomes
When a Function Level Reset (FLR) happens, terminate the pending descriptors that were issued by in-kernel users and disable the interrupts associated with those. They will be re-enabled after FLR finishes. idxd_wq_flush_desc() is declared on idxd.h because it's going to be used in by the DMA backend in a future patch. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-4-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix possible invalid memory access after FLRVinicius Costa Gomes
In the case that the first Function Level Reset (FLR) concludes correctly, but in the second FLR the scratch area for the saved configuration cannot be allocated, it's possible for a invalid memory access to happen. Always set the deallocated scratch area to NULL after FLR completes. Fixes: 98d187a98903 ("dmaengine: idxd: Enable Function Level Reset (FLR) for halt") Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-3-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix crash when the event log is disabledVinicius Costa Gomes
If reporting errors to the event log is not supported by the hardware, and an error that causes Function Level Reset (FLR) is received, the driver will try to restore the event log even if it was not allocated. Also, only try to free the event log if it was properly allocated. Fixes: 6078a315aec1 ("dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers") Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-2-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: idxd: Fix lockdep warnings when calling idxd_device_config()Vinicius Costa Gomes
Move the check for IDXD_FLAG_CONFIGURABLE and the locking to "inside" idxd_device_config(), as this is common to all callers, and the one that wasn't holding the lock was an error (that was causing the lockdep warning). Suggested-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-1-7ed70658a9d1@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: dw-edma: fix MSI data programming for multi-IRQ caseShenghui Shi
When using MSI (not MSI-X) with multiple IRQs, the MSI data value must be unique per vector to ensure correct interrupt delivery. Currently, the driver fails to increment the MSI data per vector, causing interrupts to be misrouted. Fix this by caching the base MSI data and adjusting each vector's data accordingly during IRQ setup. Fixes: e63d79d1ff04 ("dmaengine: dw-edma: Add Synopsys DesignWare eDMA IP core driver") Signed-off-by: Shenghui Shi <brody.shi@m2semi.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260209103726.414-1-brody.shi@m2semi.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: dw-axi-dmac: fix Alignment should match open parenthesisKhairul Anuar Romli
checkpatch.pl --strict reports a CHECK warning in dw-axi-dmac-platform.c: CHECK: Alignment should match open parenthesis This warning occurs when multi-line function calls or expressions have continuation lines that don't properly align with the opening parenthesis position. This patch fixes all instances in dw-axi-dmac-platform.c where continuation lines were indented with an inconsistent number of spaces/tabs that neither matched the parenthesis column nor followed a standard indent pattern. Proper alignment improves code readability and maintainability by making parameter lists visually consistent across the kernel codebase. Fixes: 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver") Fixes: e32634f466a9 ("dma: dw-axi-dmac: support per channel interrupt") Signed-off-by: Khairul Anuar Romli <karom.9560@gmail.com> Link: https://patch.msgid.link/20260202060224.12616-2-karom.9560@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: dw-edma: Add virtual IRQ for interrupt-emulation doorbellsKoichiro Den
Interrupt emulation can assert the dw-edma IRQ line without updating the DONE/ABORT bits. With the shared read/write/common IRQ handlers, the driver cannot reliably distinguish such an emulated interrupt from a real one and leaving a level IRQ asserted may wedge the line. Allocate a dedicated, requestable Linux virtual IRQ (db_irq) for interrupt emulation and attach an irq_chip whose .irq_ack runs the core-specific deassert sequence (.ack_emulated_irq()). The physical dw-edma interrupt handlers raise this virtual IRQ via generic_handle_irq(), ensuring emulated IRQs are always deasserted. Export the virtual IRQ number (db_irq) and the doorbell register offset (db_offset) via struct dw_edma_chip so platform users can expose interrupt emulation as a doorbell. Without this, a single interrupt-emulation write can leave the level IRQ line asserted and cause the generic IRQ layer to disable it. Signed-off-by: Koichiro Den <den@valinux.co.jp> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260215152216.3393561-3-den@valinux.co.jp Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-02-25dmaengine: dw-edma: Add interrupt-emulation hooksKoichiro Den
DesignWare eDMA instances support "interrupt emulation", where a software write can assert the IRQ line without setting the normal DONE/ABORT status bits. Introduce core callbacks needed to support this feature: - .ack_emulated_irq(): core-specific sequence to deassert an emulated IRQ - .db_offset(): offset from the DMA register base that is suitable as a host-writable doorbell target for interrupt emulation Implement both hooks for the v0 register map. For dw-hdma-v0, provide a stub .db_offset() returning ~0 until the correct offset is known. The next patch wires these hooks into the dw-edma IRQ path and exports the doorbell resources to platform users. Signed-off-by: Koichiro Den <den@valinux.co.jp> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260215152216.3393561-2-den@valinux.co.jp Signed-off-by: Vinod Koul <vkoul@kernel.org>