* FAILED: patch "[PATCH] driver core: Fix bus_type.match() error handling in" failed to apply to 5.4-stable tree
@ 2023-01-04 14:30 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2023-01-04 14:30 UTC (permalink / raw)
To: isaacmanjarres, gregkh, saravanak; +Cc: stable
The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
Possible dependencies:
27c0d217340e ("driver core: Fix bus_type.match() error handling in __driver_attach()")
eb7fbc9fb118 ("driver core: Add missing '\n' in log messages")
64c775fb4b21 ("driver core: Rename deferred_probe_timeout and make it global")
0e9f8d09d280 ("driver core: Remove driver_deferred_probe_check_state_continue()")
e2cec7d68537 ("driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set")
c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic")
4c002c978b7f ("device.h: move 'struct driver' stuff out to device/driver.h")
a8ae608529ab ("device.h: move 'struct class' stuff out to device/class.h")
5aee2bf2629d ("device.h: move 'struct bus' stuff out to device/bus.h")
fc5a251d0fd7 ("driver core: Add sync_state driver/bus callback")
e2ae9bcc4aaa ("driver core: Add support for linking devices during device addition")
372a67c0c5ef ("driver core: Add fwnode_to_dev() to look up device from fwnode")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 27c0d217340e47ec995557f61423ef415afba987 Mon Sep 17 00:00:00 2001
From: "Isaac J. Manjarres" <isaacmanjarres@google.com>
Date: Tue, 20 Sep 2022 17:14:13 -0700
Subject: [PATCH] driver core: Fix bus_type.match() error handling in
__driver_attach()
When a driver registers with a bus, it will attempt to match with every
device on the bus through the __driver_attach() function. Currently, if
the bus_type.match() function encounters an error that is not
-EPROBE_DEFER, __driver_attach() will return a negative error code, which
causes the driver registration logic to stop trying to match with the
remaining devices on the bus.
This behavior is not correct; a failure while matching a driver to a
device does not mean that the driver won't be able to match and bind
with other devices on the bus. Update the logic in __driver_attach()
to reflect this.
Fixes: 656b8035b0ee ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()")
Cc: stable@vger.kernel.org
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
Link: https://lore.kernel.org/r/20220921001414.4046492-1-isaacmanjarres@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 4001e22617ab..e9b2f9c25efe 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1162,7 +1162,11 @@ static int __driver_attach(struct device *dev, void *data)
return 0;
} else if (ret < 0) {
dev_dbg(dev, "Bus failed to match device: %d\n", ret);
- return ret;
+ /*
+ * Driver could not match with device, but may match with
+ * another device on the bus.
+ */
+ return 0;
} /* ret > 0 means positive match */
if (driver_allows_async_probing(drv)) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-04 14:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-04 14:30 FAILED: patch "[PATCH] driver core: Fix bus_type.match() error handling in" failed to apply to 5.4-stable tree gregkh
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).