Commit caca9510 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

firmware loader: allow builtin firmware load even if usermodehelper is disabled

In commit a144c6a6 ("PM: Print a warning if firmware is requested
when tasks are frozen") we not only printed a warning if somebody tried
to load the firmware when tasks are frozen - we also failed the load.

But that check was done before the check for built-in firmware, and then
when we disallowed usermode helpers during bootup (commit 288d5abe:
"Boot up with usermodehelper disabled"), that actually means that
built-in modules can no longer load their firmware even if the firmware
is built in too.  Which used to work, and some people depended on it for
the R100 driver.

So move the test for usermodehelper_is_disabled() down, to after
checking the built-in firmware.

This should fix:

Reported-by: default avatarJames Cloos <>
Bisected-by: default avatarElimar Riesebieter <>
Cc: Michel Dänzer <>
Cc: Rafael Wysocki <>
Cc: Greg Kroah-Hartman <>
Cc: Valdis Kletnieks <>
Signed-off-by: default avatarLinus Torvalds <>
parent 650cf77d
......@@ -521,11 +521,6 @@ static int _request_firmware(const struct firmware **firmware_p,
if (!firmware_p)
return -EINVAL;
if (WARN_ON(usermodehelper_is_disabled())) {
dev_err(device, "firmware: %s will not be loaded\n", name);
return -EBUSY;
*firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL);
if (!firmware) {
dev_err(device, "%s: kmalloc(struct firmware) failed\n",
......@@ -539,6 +534,12 @@ static int _request_firmware(const struct firmware **firmware_p,
return 0;
if (WARN_ON(usermodehelper_is_disabled())) {
dev_err(device, "firmware: %s will not be loaded\n", name);
retval = -EBUSY;
goto out;
if (uevent)
dev_dbg(device, "firmware: requesting %s\n", name);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment