linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: drivers/amba: release the resource to allow for deferred probe
@ 2019-10-01 21:40 Dinh Nguyen
  2019-10-01 21:50 ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 2+ messages in thread
From: Dinh Nguyen @ 2019-10-01 21:40 UTC (permalink / raw)
  To: linux
  Cc: thor.thayer, linus.walleij, linux-kernel, dinguyen, p.zabel,
	linux-arm-kernel

With commit "79bdcb202a35 ARM: 8906/1: drivers/amba: add reset control to
amba bus probe", the amba bus driver needs to be deferred probe because the
reset driver is probed later than the amba bus. However with a deferred
probe, the call to request_resource() in the driver returns -EBUSY. The
reason is the driver has not released the resource from the previous probe
attempt.

This patch releases the resource when amba_device_try_add() returns
-EPROBE_DEFER. This allows the deferred probe to continue.

Fixes: 79bdcb202a35 ("ARM: 8906/1: drivers/amba: add reset control to
amba bus probe")
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 drivers/amba/bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index f39f075abff9..f246b847c991 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -535,6 +535,7 @@ int amba_device_add(struct amba_device *dev, struct resource *parent)
 
 	if (ret == -EPROBE_DEFER) {
 		struct deferred_device *ddev;
+		release_resource(&dev->res);
 
 		ddev = kmalloc(sizeof(*ddev), GFP_KERNEL);
 		if (!ddev)
-- 
2.20.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-01 21:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 21:40 [PATCH] ARM: drivers/amba: release the resource to allow for deferred probe Dinh Nguyen
2019-10-01 21:50 ` Russell King - ARM Linux admin

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).