linux-next/drivers/dma/dw
Andy Shevchenko f0e870a0e9 dmaengine: dw: Select only supported masters for ACPI devices
The recently submitted fix-commit revealed a problem in the iDMA 32-bit
platform code. Even though the controller supported only a single master
the dw_dma_acpi_filter() method hard-coded two master interfaces with IDs
0 and 1. As a result the sanity check implemented in the commit
b336268dde ("dmaengine: dw: Add peripheral bus width verification")
got incorrect interface data width and thus prevented the client drivers
from configuring the DMA-channel with the EINVAL error returned. E.g.,
the next error was printed for the PXA2xx SPI controller driver trying
to configure the requested channels:

> [  164.525604] pxa2xx_spi_pci 0000:00:07.1: DMA slave config failed
> [  164.536105] pxa2xx_spi_pci 0000:00:07.1: failed to get DMA TX descriptor
> [  164.543213] spidev spi-SPT0001:00: SPI transfer failed: -16

The problem would have been spotted much earlier if the iDMA 32-bit
controller supported more than one master interfaces. But since it
supports just a single master and the iDMA 32-bit specific code just
ignores the master IDs in the CTLLO preparation method, the issue has
been gone unnoticed so far.

Fix the problem by specifying the default master ID for both memory
and peripheral devices in the driver data. Thus the issue noticed for
the iDMA 32-bit controllers will be eliminated and the ACPI-probed
DW DMA controllers will be configured with the correct master ID by
default.

Cc: stable@vger.kernel.org
Fixes: b336268dde ("dmaengine: dw: Add peripheral bus width verification")
Fixes: 199244d694 ("dmaengine: dw: add support of iDMA 32-bit hardware")
Reported-by: Ferry Toth <fntoth@gmail.com>
Closes: https://lore.kernel.org/dmaengine/ZuXbCKUs1iOqFu51@black.fi.intel.com/
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Closes: https://lore.kernel.org/dmaengine/ZuXgI-VcHpMgbZ91@black.fi.intel.com/
Tested-by: Ferry Toth <fntoth@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241104095142.157925-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2024-12-02 22:35:45 +05:30
..
acpi.c dmaengine: dw: Select only supported masters for ACPI devices 2024-12-02 22:35:45 +05:30
core.c dmaengine: dw: Unify ret-val local variables naming 2024-08-05 22:07:47 +05:30
dw.c dmaengine: dw: Simplify max-burst calculation procedure 2024-08-05 22:07:47 +05:30
idma32.c dmaengine: dw: Simplify max-burst calculation procedure 2024-08-05 22:07:47 +05:30
internal.h dmaengine: dw: Select only supported masters for ACPI devices 2024-12-02 22:35:45 +05:30
Kconfig dmaengine: dw: dmamux: Introduce RZN1 DMA router support 2022-05-19 22:34:51 +05:30
Makefile dmaengine: dw: dmamux: Introduce RZN1 DMA router support 2022-05-19 22:34:51 +05:30
of.c dmaengine: dw: Simplify DT property parser 2021-08-06 19:18:59 +05:30
pci.c dmaengine: dw: Select only supported masters for ACPI devices 2024-12-02 22:35:45 +05:30
platform.c dmaengine: Switch back to struct platform_driver::remove() 2024-10-14 23:50:34 +05:30
regs.h dmaengine: dw: Simplify max-burst calculation procedure 2024-08-05 22:07:47 +05:30
rzn1-dmamux.c dmaengine: Explicitly include correct DT includes 2023-08-01 23:51:27 +05:30