* [PATCH] staging: vc04_services: vchiq_bus: Check return value of of_dma_configure()
@ 2025-12-02 9:52 Haotian Zhang
2025-12-02 10:18 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Haotian Zhang @ 2025-12-02 9:52 UTC (permalink / raw)
To: Florian Fainelli, Broadcom internal kernel review list,
Greg Kroah-Hartman
Cc: linux-rpi-kernel, linux-arm-kernel, linux-staging, linux-kernel,
Haotian Zhang
vchiq_device_register() ignores the return value of of_dma_configure(),
which may return -EPROBE_DEFER when the IOMMU is not ready or other error
codes. This allows device registration to proceed with incomplete DMA
configuration.
Check of_dma_configure() return value and fail device registration
on error.
Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_bus.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
index 41ece91ab88a..8d920a7a3777 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
@@ -80,7 +80,12 @@ vchiq_device_register(struct device *parent, const char *name)
device->drv_mgmt = dev_get_drvdata(parent);
- of_dma_configure(&device->dev, parent->of_node, true);
+ ret = of_dma_configure(&device->dev, parent->of_node, true);
+ if (ret) {
+ dev_err(parent, "DMA configuration failed for %s: %d\n", name, ret);
+ kfree(device);
+ return NULL;
+ }
ret = device_register(&device->dev);
if (ret) {
--
2.50.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] staging: vc04_services: vchiq_bus: Check return value of of_dma_configure()
2025-12-02 9:52 [PATCH] staging: vc04_services: vchiq_bus: Check return value of of_dma_configure() Haotian Zhang
@ 2025-12-02 10:18 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2025-12-02 10:18 UTC (permalink / raw)
To: Haotian Zhang
Cc: Florian Fainelli, Broadcom internal kernel review list,
Greg Kroah-Hartman, linux-rpi-kernel, linux-arm-kernel,
linux-staging, linux-kernel
You're not working against the latest tree so this doesn't apply.
On Tue, Dec 02, 2025 at 05:52:52PM +0800, Haotian Zhang wrote:
> vchiq_device_register() ignores the return value of of_dma_configure(),
> which may return -EPROBE_DEFER when the IOMMU is not ready or other error
> codes. This allows device registration to proceed with incomplete DMA
> configuration.
>
If of_dma_configure() returns -EPROBE_DEFER then this will just fail and
that's not really any better than the existing behavior...
regards,
dan carpenter
> Check of_dma_configure() return value and fail device registration
> on error.
>
> Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type")
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-02 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02 9:52 [PATCH] staging: vc04_services: vchiq_bus: Check return value of of_dma_configure() Haotian Zhang
2025-12-02 10:18 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).