* [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe
@ 2026-04-07 3:27 Shengjiu Wang
2026-04-07 3:48 ` Frank Li
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Shengjiu Wang @ 2026-04-07 3:27 UTC (permalink / raw)
To: vkoul, Frank.Li, s.hauer, kernel, festevam, dmaengine, imx,
linux-arm-kernel, linux-kernel
There are multi spba-busses for i.MX8M* platforms, if only search for
the first spba-bus in DT, the found spba-bus may not the real bus of
audio devices, which cause issue for sdma p2p case, as the sdma p2p
script presently does not deal with the transactions involving two devices
connected to the AIPS bus.
Search the SDMA parent node first, which should be the AIPS bus, then
search the child node whose compatible string is spba-bus under that AIPS
bus for the above multi spba-busses case.
Fixes: 8391ecf465ec ("dmaengine: imx-sdma: Add device to device support")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
changes in v2:
- add fixes tag
- use __free(device_node) for auto release.
drivers/dma/imx-sdma.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 3d527883776b..36368835a845 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2364,7 +2364,9 @@ static int sdma_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, ret,
"failed to register controller\n");
- spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus");
+ struct device_node *sdma_parent_np __free(device_node) = of_get_parent(np);
+
+ spba_bus = of_get_compatible_child(sdma_parent_np, "fsl,spba-bus");
ret = of_address_to_resource(spba_bus, 0, &spba_res);
if (!ret) {
sdma->spba_start_addr = spba_res.start;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe 2026-04-07 3:27 [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe Shengjiu Wang @ 2026-04-07 3:48 ` Frank Li 2026-04-07 8:26 ` Marco Felsch 2026-06-08 5:55 ` Vinod Koul 2 siblings, 0 replies; 5+ messages in thread From: Frank Li @ 2026-04-07 3:48 UTC (permalink / raw) To: Shengjiu Wang Cc: vkoul, Frank.Li, s.hauer, kernel, festevam, dmaengine, imx, linux-arm-kernel, linux-kernel Update subject: Handle multiple SPBA buses during probe Reviewed-by: Frank Li <Frank.Li@nxp.com> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe 2026-04-07 3:27 [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe Shengjiu Wang 2026-04-07 3:48 ` Frank Li @ 2026-04-07 8:26 ` Marco Felsch 2026-04-07 8:59 ` Shengjiu Wang 2026-06-08 5:55 ` Vinod Koul 2 siblings, 1 reply; 5+ messages in thread From: Marco Felsch @ 2026-04-07 8:26 UTC (permalink / raw) To: Shengjiu Wang Cc: vkoul, Frank.Li, s.hauer, kernel, festevam, dmaengine, imx, linux-arm-kernel, linux-kernel On 26-04-07, Shengjiu Wang wrote: > There are multi spba-busses for i.MX8M* platforms, if only search for > the first spba-bus in DT, the found spba-bus may not the real bus of > audio devices, which cause issue for sdma p2p case, as the sdma p2p > script presently does not deal with the transactions involving two devices > connected to the AIPS bus. > > Search the SDMA parent node first, which should be the AIPS bus, then > search the child node whose compatible string is spba-bus under that AIPS > bus for the above multi spba-busses case. Sorry but I've to NACK this, I already fixed it in a more robust way by checking the consumer sdma node. Regards, Marco > Fixes: 8391ecf465ec ("dmaengine: imx-sdma: Add device to device support") > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> > --- > changes in v2: > - add fixes tag > - use __free(device_node) for auto release. > > drivers/dma/imx-sdma.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c > index 3d527883776b..36368835a845 100644 > --- a/drivers/dma/imx-sdma.c > +++ b/drivers/dma/imx-sdma.c > @@ -2364,7 +2364,9 @@ static int sdma_probe(struct platform_device *pdev) > return dev_err_probe(&pdev->dev, ret, > "failed to register controller\n"); > > - spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus"); > + struct device_node *sdma_parent_np __free(device_node) = of_get_parent(np); > + > + spba_bus = of_get_compatible_child(sdma_parent_np, "fsl,spba-bus"); > ret = of_address_to_resource(spba_bus, 0, &spba_res); > if (!ret) { > sdma->spba_start_addr = spba_res.start; > -- > 2.34.1 > > > -- #gernperDu #CallMeByMyFirstName Pengutronix e.K. | | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe 2026-04-07 8:26 ` Marco Felsch @ 2026-04-07 8:59 ` Shengjiu Wang 0 siblings, 0 replies; 5+ messages in thread From: Shengjiu Wang @ 2026-04-07 8:59 UTC (permalink / raw) To: Marco Felsch Cc: Shengjiu Wang, vkoul, Frank.Li, s.hauer, kernel, festevam, dmaengine, imx, linux-arm-kernel, linux-kernel On Tue, Apr 7, 2026 at 4:31 PM Marco Felsch <m.felsch@pengutronix.de> wrote: > > On 26-04-07, Shengjiu Wang wrote: > > There are multi spba-busses for i.MX8M* platforms, if only search for > > the first spba-bus in DT, the found spba-bus may not the real bus of > > audio devices, which cause issue for sdma p2p case, as the sdma p2p > > script presently does not deal with the transactions involving two devices > > connected to the AIPS bus. > > > > Search the SDMA parent node first, which should be the AIPS bus, then > > search the child node whose compatible string is spba-bus under that AIPS > > bus for the above multi spba-busses case. > > Sorry but I've to NACK this, I already fixed it in a more robust way by > checking the consumer sdma node. > I think you refer to this one: https://lists.infradead.org/pipermail/linux-arm-kernel/2025-September/1061824.html I tested it, but there is an issue. I replied to that thread, not sure you received my message. > +static int sdma_config_spba_slave(struct dma_chan *chan) > +{ > + struct sdma_channel *sdmac = to_sdma_chan(chan); > + struct device_node *spba_bus; > + struct resource spba_res; > + int ret; > + > + spba_bus = of_get_parent(chan->slave->of_node); With asrc p2p case, the chan is requested by __dma_request_channel(), that the chan->slave = NULL, Then there will be a kernel dump here. That's the reason I sent this fix. But if you can fix the above issue, I am ok to drop my fix. or could you review my fix?, which is simpler. Best regards Shengjiu Wang > Regards, > Marco > > > > Fixes: 8391ecf465ec ("dmaengine: imx-sdma: Add device to device support") > > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> > > --- > > changes in v2: > > - add fixes tag > > - use __free(device_node) for auto release. > > > > drivers/dma/imx-sdma.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c > > index 3d527883776b..36368835a845 100644 > > --- a/drivers/dma/imx-sdma.c > > +++ b/drivers/dma/imx-sdma.c > > @@ -2364,7 +2364,9 @@ static int sdma_probe(struct platform_device *pdev) > > return dev_err_probe(&pdev->dev, ret, > > "failed to register controller\n"); > > > > - spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus"); > > + struct device_node *sdma_parent_np __free(device_node) = of_get_parent(np); > > + > > + spba_bus = of_get_compatible_child(sdma_parent_np, "fsl,spba-bus"); > > ret = of_address_to_resource(spba_bus, 0, &spba_res); > > if (!ret) { > > sdma->spba_start_addr = spba_res.start; > > -- > > 2.34.1 > > > > > > > > -- > #gernperDu > #CallMeByMyFirstName > > Pengutronix e.K. | | > Steuerwalder Str. 21 | https://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe 2026-04-07 3:27 [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe Shengjiu Wang 2026-04-07 3:48 ` Frank Li 2026-04-07 8:26 ` Marco Felsch @ 2026-06-08 5:55 ` Vinod Koul 2 siblings, 0 replies; 5+ messages in thread From: Vinod Koul @ 2026-06-08 5:55 UTC (permalink / raw) To: Frank.Li, s.hauer, kernel, festevam, dmaengine, imx, linux-arm-kernel, linux-kernel, Shengjiu Wang On Tue, 07 Apr 2026 11:27:55 +0800, Shengjiu Wang wrote: > There are multi spba-busses for i.MX8M* platforms, if only search for > the first spba-bus in DT, the found spba-bus may not the real bus of > audio devices, which cause issue for sdma p2p case, as the sdma p2p > script presently does not deal with the transactions involving two devices > connected to the AIPS bus. > > Search the SDMA parent node first, which should be the AIPS bus, then > search the child node whose compatible string is spba-bus under that AIPS > bus for the above multi spba-busses case. > > [...] Applied, thanks! [1/1] dmaengine: imx-sdma: Refine spba bus searching in probe commit: d52d42e2e5d9f13166e81ac837ebb023d1306e61 Best regards, -- ~Vinod ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-08 5:56 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-04-07 3:27 [PATCH v2] dmaengine: imx-sdma: Refine spba bus searching in probe Shengjiu Wang 2026-04-07 3:48 ` Frank Li 2026-04-07 8:26 ` Marco Felsch 2026-04-07 8:59 ` Shengjiu Wang 2026-06-08 5:55 ` Vinod Koul
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox