From 59589fe4d44004f274066c6c39a84d11436a44f8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 16 Jan 2023 16:19:07 +0100 Subject: [PATCH] drop some driver core changes from 5.4 queue Too much of a mess, should not be backported. --- ...ch-error-handling-in-__driver_attach.patch | 2 +- ...driver_deferred_probe_check_state-lo.patch | 124 ------------------ ...deferred_probe_timeout-to-a-longer-d.patch | 69 ---------- queue-5.4/series | 2 - 4 files changed, 1 insertion(+), 196 deletions(-) delete mode 100644 queue-5.4/driver-core-fix-driver_deferred_probe_check_state-lo.patch delete mode 100644 queue-5.4/driver-core-set-deferred_probe_timeout-to-a-longer-d.patch diff --git a/queue-5.4/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch b/queue-5.4/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch index 7dcfb02a829..66862a383b7 100644 --- a/queue-5.4/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch +++ b/queue-5.4/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch @@ -31,7 +31,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/base/dd.c +++ b/drivers/base/dd.c -@@ -1079,8 +1079,12 @@ static int __driver_attach(struct device +@@ -1068,8 +1068,12 @@ static int __driver_attach(struct device */ return 0; } else if (ret < 0) { diff --git a/queue-5.4/driver-core-fix-driver_deferred_probe_check_state-lo.patch b/queue-5.4/driver-core-fix-driver_deferred_probe_check_state-lo.patch deleted file mode 100644 index 0bbbac271f7..00000000000 --- a/queue-5.4/driver-core-fix-driver_deferred_probe_check_state-lo.patch +++ /dev/null @@ -1,124 +0,0 @@ -From e507b1ffd90ffc541fe254be4b63d4f3ff420a7c Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 25 Feb 2020 05:08:23 +0000 -Subject: driver core: Fix driver_deferred_probe_check_state() logic - -From: John Stultz - -[ Upstream commit c8c43cee29f6ca2575c953ae600263690db28f41 ] - -driver_deferred_probe_check_state() has some uninituitive behavior. - -* From boot to late_initcall, it returns -EPROBE_DEFER - -* From late_initcall to the deferred_probe_timeout (if set) - it returns -ENODEV - -* If the deferred_probe_timeout it set, after it fires, it - returns -ETIMEDOUT - -This is a bit confusing, as its useful to have the function -return -EPROBE_DEFER while the timeout is still running. This -behavior has resulted in the somwhat duplicative -driver_deferred_probe_check_state_continue() function being -added. - -Thus this patch tries to improve the logic, so that it behaves -as such: - -* If late_initcall has passed, and modules are not enabled - it returns -ENODEV - -* If modules are enabled and deferred_probe_timeout is set, - it returns -EPROBE_DEFER until the timeout, afterwhich it - returns -ETIMEDOUT. - -* In all other cases, it returns -EPROBE_DEFER - -This will make the deferred_probe_timeout value much more -functional, and will allow us to consolidate the -driver_deferred_probe_check_state() and -driver_deferred_probe_check_state_continue() logic in a later -patch. - -Cc: linux-pm@vger.kernel.org -Cc: Greg Kroah-Hartman -Cc: Linus Walleij -Cc: Thierry Reding -Cc: Mark Brown -Cc: Liam Girdwood -Cc: Bjorn Andersson -Cc: Saravana Kannan -Cc: Todd Kjos -Cc: Len Brown -Cc: Pavel Machek -Cc: Ulf Hansson -Cc: Kevin Hilman -Cc: "Rafael J. Wysocki" -Cc: Rob Herring -Signed-off-by: John Stultz -Link: https://lore.kernel.org/r/20200225050828.56458-2-john.stultz@linaro.org -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/base/dd.c | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/drivers/base/dd.c b/drivers/base/dd.c -index 10063d8a1b7d..2a28e07d2e0b 100644 ---- a/drivers/base/dd.c -+++ b/drivers/base/dd.c -@@ -237,24 +237,26 @@ __setup("deferred_probe_timeout=", deferred_probe_timeout_setup); - - static int __driver_deferred_probe_check_state(struct device *dev) - { -- if (!initcalls_done) -- return -EPROBE_DEFER; -+ if (!IS_ENABLED(CONFIG_MODULES) && initcalls_done) -+ return -ENODEV; - - if (!deferred_probe_timeout) { - dev_WARN(dev, "deferred probe timeout, ignoring dependency"); - return -ETIMEDOUT; - } - -- return 0; -+ return -EPROBE_DEFER; - } - - /** - * driver_deferred_probe_check_state() - Check deferred probe state - * @dev: device to check - * -- * Returns -ENODEV if init is done and all built-in drivers have had a chance -- * to probe (i.e. initcalls are done), -ETIMEDOUT if deferred probe debug -- * timeout has expired, or -EPROBE_DEFER if none of those conditions are met. -+ * Return: -+ * -ENODEV if initcalls have completed and modules are disabled. -+ * -ETIMEDOUT if the deferred probe timeout was set and has expired -+ * and modules are enabled. -+ * -EPROBE_DEFER in other cases. - * - * Drivers or subsystems can opt-in to calling this function instead of directly - * returning -EPROBE_DEFER. -@@ -264,7 +266,7 @@ int driver_deferred_probe_check_state(struct device *dev) - int ret; - - ret = __driver_deferred_probe_check_state(dev); -- if (ret < 0) -+ if (ret != -ENODEV) - return ret; - - dev_warn(dev, "ignoring dependency for device, assuming no driver"); -@@ -292,7 +294,7 @@ int driver_deferred_probe_check_state_continue(struct device *dev) - int ret; - - ret = __driver_deferred_probe_check_state(dev); -- if (ret < 0) -+ if (ret != -ENODEV) - return ret; - - return -EPROBE_DEFER; --- -2.35.1 - diff --git a/queue-5.4/driver-core-set-deferred_probe_timeout-to-a-longer-d.patch b/queue-5.4/driver-core-set-deferred_probe_timeout-to-a-longer-d.patch deleted file mode 100644 index 2553d44655a..00000000000 --- a/queue-5.4/driver-core-set-deferred_probe_timeout-to-a-longer-d.patch +++ /dev/null @@ -1,69 +0,0 @@ -From cae2bae22ae13e0c31293862dc9addea3118695e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 25 Feb 2020 05:08:24 +0000 -Subject: driver core: Set deferred_probe_timeout to a longer default if - CONFIG_MODULES is set - -From: John Stultz - -[ Upstream commit e2cec7d6853712295cef5377762165a489b2957f ] - -When using modules, its common for the modules not to be loaded -until quite late by userland. With the current code, -driver_deferred_probe_check_state() will stop returning -EPROBE_DEFER after late_initcall, which can cause module -dependency resolution to fail after that. - -So allow a longer window of 30 seconds (picked somewhat -arbitrarily, but influenced by the similar regulator core -timeout value) in the case where modules are enabled. - -Cc: linux-pm@vger.kernel.org -Cc: Greg Kroah-Hartman -Cc: Linus Walleij -Cc: Thierry Reding -Cc: Mark Brown -Cc: Liam Girdwood -Cc: Bjorn Andersson -Cc: Saravana Kannan -Cc: Todd Kjos -Cc: Len Brown -Cc: Pavel Machek -Cc: Ulf Hansson -Cc: Kevin Hilman -Cc: "Rafael J. Wysocki" -Cc: Rob Herring -Reviewed-by: Bjorn Andersson -Reviewed-by: Rafael J. Wysocki -Signed-off-by: John Stultz -Link: https://lore.kernel.org/r/20200225050828.56458-3-john.stultz@linaro.org -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/base/dd.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/drivers/base/dd.c b/drivers/base/dd.c -index 2a28e07d2e0b..490cffffcae4 100644 ---- a/drivers/base/dd.c -+++ b/drivers/base/dd.c -@@ -224,7 +224,16 @@ static int deferred_devs_show(struct seq_file *s, void *data) - } - DEFINE_SHOW_ATTRIBUTE(deferred_devs); - -+#ifdef CONFIG_MODULES -+/* -+ * In the case of modules, set the default probe timeout to -+ * 30 seconds to give userland some time to load needed modules -+ */ -+static int deferred_probe_timeout = 30; -+#else -+/* In the case of !modules, no probe timeout needed */ - static int deferred_probe_timeout = -1; -+#endif - static int __init deferred_probe_timeout_setup(char *str) - { - int timeout; --- -2.35.1 - diff --git a/queue-5.4/series b/queue-5.4/series index c18d32431cc..7f445decc5f 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -552,8 +552,6 @@ kvm-nvmx-properly-expose-enable_usr_wait_pause-contr.patch ravb-fix-failed-to-switch-device-to-config-mode-mess.patch riscv-stacktrace-fix-stack-output-without-ra-on-the-.patch riscv-stacktrace-fixup-ftrace_graph_ret_addr-retp-ar.patch -driver-core-fix-driver_deferred_probe_check_state-lo.patch -driver-core-set-deferred_probe_timeout-to-a-longer-d.patch ext4-goto-right-label-failed_mount3a.patch ext4-correct-inconsistent-error-msg-in-nojournal-mod.patch mm-highmem-lift-memcpy_-to-from-_page-to-core.patch -- 2.47.3