Re: [RFC][PATCH] PM: Print a warning if firmware is requested when tasks are frozen

Valdis.Kletnieks
2011-05-02T23:31:46Z

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

On Tue, 03 May 2011 00:44:51 +0200, "Rafael J. Wysocki" said:

> + if (WARN_ON(usermodehelper_is_disabled()))
> + return -EBUSY;
> +

Since this is a "no user serviceable parts inside" type of error, so I guess
WARN_ON rather than a printk(KERN_WARNING is a good idea so we get
a traceback pointing out the offending driver.

I have to wonder 2 things though:

1) What percent of the time the missing firmware (or other issues, like the
display not being resumed yet) will prevent the WARN_ON output from making it
to the display *anyhow*, so the user *still* hits the power button to try again?

2) What percent of the time the WARN_ON output will itself make the user
think the resume has died rather than just being slow, causing them to power
cycle and hope for a clean boot?

Maybe something like this instead?

if (WARN_ON(usermodehelper_is_disable()))) {
printk(KERN_WARNING "Resume continuing, but firmware for %s not loaded", device);
return -EBUSY;
}

(or whatever that %s actually needs to work)

All the same, it still looks better than what we're doing now.

[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]