dmaengine: owl-dma: Handle clock enable failure in probe
Subsystems (2)
PATCH 1/1 dmaengine: owl-dma: Handle clock enable failure in probe
On S900, with firmware device links disabled, the CMU driver can unbind after owl_dma_probe() gets the DMA clock and before it prepares it. The clock framework can then return -ENXIO when preparing the retained clock.
Ignoring that error can expose DMA channels without the required clock. A later registration failure or device removal can also attempt an unmatched clock disable and unprepare, which can trigger clock warnings.
Check clk_prepare_enable() and return its error after freeing the descriptor pool. Keep clock teardown on the registration error paths, where clock setup has succeeded.
Verification covered
the probe and remove paths by source inspection, git diff --check, checkpatch, and an arm64 defconfig build of drivers/dma/owl-dma.o with CONFIG_OWL_DMA=y. Runtime and hardware reproduction were not performed.
--- drivers/dma/owl-dma.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/dma/owl-dma.c +6 -3
@@ -1199,12 +1199,14 @@ static int owl_dma_probe(struct platform_device *pdev)return -ENOMEM ; } -clk_prepare_enable (od->clk); + ret =clk_prepare_enable (od->clk); +if (ret) + goto err_pool_free; ret =dma_async_device_register (&od->dma);if (ret) {dev_err (&pdev->dev,"failed to register DMA engine device\n" ); - goto err_pool_free; + goto err_clk_disable; }/* Device-tree DMA controller registration */
@@ -1219,8 +1221,9 @@ static int owl_dma_probe(struct platform_device *pdev) err_dma_unregister:dma_async_device_unregister (&od->dma); -err_pool_free: +err_clk_disable:clk_disable_unprepare (od->clk); +err_pool_free:dma_pool_destroy (od->lli_pool);return ret;
Signature · 1 line
2.34.1
Quoted 17 lines · Jiawen Liu
On S900, with firmware device links disabled, the CMU driver can unbind after
owl_dma_probe()gets the DMA clock and before it prepares it. The clock framework can then return-ENXIOwhen preparing the retained clock.Ignoring that error can expose DMA channels without the required clock. A later registration failure or device removal can also attempt an unmatched clock disable and unprepare, which can trigger clock warnings.
Check
clk_prepare_enable()and return its error after freeing the descriptor pool. Keep clock teardown on the registration error paths, where clock setup has succeeded.Verification covered
the probe and remove paths by source inspection, git diff --check, checkpatch, and an arm64 defconfig build ofdrivers/dma/owl-dma.owithCONFIG_OWL_DMA=y. Runtime and hardware reproduction were not performed.
Quoted 6 lines
Fixes 47e20577c24d ("dmaengine: Add Actions Semi Owl family S900 DMA driver")Signed-off-by Jiawen Liu <[email protected]>--- drivers/dma/owl-dma.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
You sent multiple independent patches, to multiple independent subsystems. The amount of these patches clearly suggest this was AI generated and most likely not tested.
More importantly, you sent all this work without properly organizing relevant patches into patchsets. This makes reviewing difficult and might cause multiple reviewers to address the same issue. Replying to the entire set is impossible and requires handling each patch independently, instead of applying or discarding the set. Maintainers also won't see the bigger picture of your work. Quite worrying.
Please read kernel documentation BEFORE posting more work. It will explain you how to identify subsystems, how to organize your work per subsystem (so a patchset grouping multiple patches with a short cover letter), how to document the issue discovery method and what was or was not tested.
Best regards,
Krzysztof