[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YvQnbq2RhMOElQE3@google.com>
Date: Wed, 10 Aug 2022 14:47:26 -0700
From: Isaac Manjarres <isaacmanjarres@...gle.com>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Saravana Kannan <saravanak@...gle.com>,
Russell King <linux@...linux.org.uk>,
Philipp Zabel <p.zabel@...gutronix.de>,
Rob Herring <robh@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
Sudeep Holla <sudeep.holla@....com>,
Nicolas Saenz Julienne <nsaenz@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
patches@...linux.org.uk, kernel-team@...roid.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6] amba: Remove deferred device addition
On Wed, Aug 10, 2022 at 05:58:58AM -0700, Guenter Roeck wrote:
> On 8/9/22 20:33, Saravana Kannan wrote:
> [ ... ]
>
> >
> > Can you give me more details on the qemu configuration so I could try
> > to reproduce it?
>
> qemu-system-arm -M vexpress-a9 -kernel arch/arm/boot/zImage -no-reboot \
> -initrd rootfs-armv5.cpio -m 128 \
> --append "rdinit=/sbin/init console=ttyAMA0,115200" \
> -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb \
> -nographic -monitor null -serial stdio
>
> using multi_v7_defconfig will hang nicely with your patch applied,
> and boot as expected without. This was with qemu v7.0, but I am
> sure older qemu versions will show the same behavior. The initrd
> used should not matter, but you'll find it at
> https://github.com/groeck/linux-build-test/blob/master/rootfs/arm-v7/rootfs-armv5.cpio.gz
>
> Guenter
>
Hi Guenter,
Thanks for the information; I was able to reproduce this on my end as
well. The following changes fixed the problem for me. Can you please try
them out?
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 70f79fc71539..b377f18d8acc 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -881,6 +881,11 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
dev_dbg(dev, "Device match requests probe deferral\n");
dev->can_match = true;
driver_deferred_probe_add(dev);
+ /*
+ * Device can't match with the bus right now, so don't attempt
+ * to match or bind with other drivers on the bus.
+ */
+ return ret;
} else if (ret < 0) {
dev_dbg(dev, "Bus failed to match device: %d\n", ret);
return ret;
@@ -1120,6 +1125,11 @@ static int __driver_attach(struct device *dev, void *data)
dev_dbg(dev, "Device match requests probe deferral\n");
dev->can_match = true;
driver_deferred_probe_add(dev);
+ /*
+ * Driver could not match with device, but may match with
+ * another device on the bus.
+ */
+ return 0;
} else if (ret < 0) {
dev_dbg(dev, "Bus failed to match device: %d\n", ret);
return ret;
Thanks,
Isaac
Powered by blists - more mailing lists