All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver core: Fix double failed probing with fw_devlink=on
@ 2021-02-15 11:16 Geert Uytterhoeven
  2021-02-15 14:58 ` Rafael J. Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2021-02-15 11:16 UTC (permalink / raw)
  To: Saravana Kannan, Greg Kroah-Hartman, Rafael J . Wysocki
  Cc: linux-renesas-soc, linux-kernel, Geert Uytterhoeven

With fw_devlink=permissive, devices are added to the deferred probe
pending list if their driver's .probe() method returns -EPROBE_DEFER.

With fw_devlink=on, devices are added to the deferred probe pending list
if they are determined to be a consumer, which happens before their
driver's .probe() method is called.  If the actual probe fails later
(real failure, not -EPROBE_DEFER), the device will still be on the
deferred probe pending list, and it will be probed again when deferred
probing kicks in, which is futile.

Fix this by explicitly removing the device from the deferred probe
pending list in case of probe failures.

Fixes: e590474768f1cc04 ("driver core: Set fw_devlink=on by default")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Seen on various Renesas R-Car platforms, cfr.
https://lore.kernel.org/linux-acpi/CAMuHMdVL-1RKJ5u-HDVA4F4w_+8yGvQQuJQBcZMsdV4yXzzfcw@mail.gmail.com
---
 drivers/base/dd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 9179825ff646f4e3..91c4181093c43709 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -639,11 +639,13 @@ static int really_probe(struct device *dev, struct device_driver *drv)
 	case -ENXIO:
 		pr_debug("%s: probe of %s rejects match %d\n",
 			 drv->name, dev_name(dev), ret);
+		driver_deferred_probe_del(dev);
 		break;
 	default:
 		/* driver matched but the probe failed */
 		pr_warn("%s: probe of %s failed with error %d\n",
 			drv->name, dev_name(dev), ret);
+		driver_deferred_probe_del(dev);
 	}
 	/*
 	 * Ignore errors returned by ->probe so that the next driver can try
-- 
2.25.1


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

end of thread, other threads:[~2021-07-07 17:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-15 11:16 [PATCH] driver core: Fix double failed probing with fw_devlink=on Geert Uytterhoeven
2021-02-15 14:58 ` Rafael J. Wysocki
2021-02-15 18:26   ` Saravana Kannan
2021-02-15 19:08     ` Geert Uytterhoeven
2021-02-15 20:59       ` Saravana Kannan
2021-02-16 17:07         ` Saravana Kannan
2021-07-07  8:43           ` Geert Uytterhoeven
2021-07-07 17:45             ` Saravana Kannan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.