Skip to contentSkip to conversation

driver core: Use dev_warn() instead of dev_WARN() for deferred_probe_timeout warnings

PATCH In review John Stultz 3 participants 3 messages Mar 30, 2020 – Apr 2, 2020 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver core: Use dev_warn() instead of dev_WARN() for deferred_probe_timeout warnings

In commit c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") and following changes the logic was changes slightly so that if there is no driver to match whats found in the dtb, we wait 30 seconds for modules to be loaded by userland, and then timeout, where as previously we'd print "ignoring dependency for device, assuming no driver" and immediately return -ENODEV after initcall_done.

However, in the timeout case (which previously existed but was practicaly un-used without a boot argument), the timeout message uses dev_WARN(). This means folks are now seeing a big backtrace in their boot logs if there a entry in their dts that doesn't have a driver.

To fix this, lets use dev_warn(), instead of dev_WARN() to match the previous error path.

Cc Robin Murphy <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Sudeep Holla <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Naresh Kamboju <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Basil Eljuse <[email protected]>
Cc Ferry Toth <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Anders Roxell <[email protected]>
Fixes c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic")
---
 drivers/base/dd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/dd.c +1 -1
index 06ec0e851fa1..ca1652221c1a 100644
@@ -267,7 +267,7 @@ int driver_deferred_probe_check_state(struct device *dev)
 	}
 
 	if (!driver_deferred_probe_timeout) {
-		dev_WARN(dev, "deferred probe timeout, ignoring dependency");
+		dev_warn(dev, "deferred probe timeout, ignoring dependency");
 		return -ETIMEDOUT;
 	}
 
Signature · 1 line
2.17.1
Tested-by on v1 1/1
#1 lore raw
Quoted 19 lines · John Stultz

In commit c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") and following changes the logic was changes slightly so that if there is no driver to match whats found in the dtb, we wait 30 seconds for modules to be loaded by userland, and then timeout, where as previously we'd print "ignoring dependency for device, assuming no driver" and immediately return -ENODEV after initcall_done.

However, in the timeout case (which previously existed but was practicaly un-used without a boot argument), the timeout message uses dev_WARN(). This means folks are now seeing a big backtrace in their boot logs if there a entry in their dts that doesn't have a driver.

To fix this, lets use dev_warn(), instead of dev_WARN() to match the previous error path.

Quoted 13 lines
Cc Robin Murphy <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Sudeep Holla <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Naresh Kamboju <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Basil Eljuse <[email protected]>
Cc Ferry Toth <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Anders Roxell <[email protected]>
Fixes c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic")

I have applied this patch and tested.
The reported problem is fixed by patch on arm64 Juno-r2 device.
https://lkft.validation.linaro.org/scheduler/job/1323860#L556

- Naresh

Reviewed-by on v1 1/1
#2 lore raw
In reply to John Stultz
Quoted 9 lines · John Stultz

In commit c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") and following changes the logic was changes slightly so that if there is no driver to match whats found in the dtb, we wait 30 seconds for modules to be loaded by userland, and then timeout, where as previously we'd print "ignoring dependency for device, assuming no driver" and immediately return -ENODEV after initcall_done.

Quoted 5 lines

However, in the timeout case (which previously existed but was practicaly un-used without a boot argument), the timeout message uses dev_WARN(). This means folks are now seeing a big backtrace in their boot logs if there a entry in their dts that doesn't have a driver.

I had always figured that timeout case somehow represented more of a definite failure than others, but if not then great! :)

Quoted 2 lines

To fix this, lets use dev_warn(), instead of dev_WARN() to match the previous error path.

However, I do now wonder if we really need these two separate cases with subtly different messages - after all, giving up at init vs. giving up 30 seconds later still represents some kind of timeout out either way. Given that there are at least 5 underlying situations with varying levels of certainty and severity:

- No driver loaded for dependency (yet, if CONFIG_MODULES)
- Driver present and dependency will be probed at some point in future
- Driver present but dependency will not be probed (e.g. disabled in DT)
- Dependency itself is deferred but will be re-probed at some point
- Dependency probed, explicitly failed and will not be retried

then I'm not sure there's much value in having two slightly different ways of saying "any of those may have happened".

Robin.

Quoted 31 lines
Cc Robin Murphy <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Sudeep Holla <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Naresh Kamboju <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Basil Eljuse <[email protected]>
Cc Ferry Toth <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Anders Roxell <[email protected]>
Fixes c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic")
---
  drivers/base/dd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/dd.c +1 -1
index 06ec0e851fa1..ca1652221c1a 100644
@@ -267,7 +267,7 @@ int driver_deferred_probe_check_state(struct device *dev)
  	}
 
  	if (!driver_deferred_probe_timeout) {
-		dev_WARN(dev, "deferred probe timeout, ignoring dependency");
+		dev_warn(dev, "deferred probe timeout, ignoring dependency");
  		return -ETIMEDOUT;
  	}