[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1471999507-913-6-git-send-email-mcgrof@kernel.org>
Date: Tue, 23 Aug 2016 17:45:07 -0700
From: mcgrof@...nel.org
To: ming.lei@...onical.com, akpm@...ux-foundation.org,
gregkh@...uxfoundation.org
Cc: daniel.wagner@...-carit.de, mmarek@...e.com,
linux-kernel@...r.kernel.org, markivx@...eaurora.org,
stephen.boyd@...aro.org, zohar@...ux.vnet.ibm.com,
broonie@...nel.org, tiwai@...e.de, johannes@...solutions.net,
chunkeey@...glemail.com, hauke@...ke-m.de,
jwboyer@...oraproject.org, dmitry.torokhov@...il.com,
dwmw2@...radead.org, jslaby@...e.com,
torvalds@...ux-foundation.org, luto@...capital.net,
fengguang.wu@...el.com, rpurdie@...ys.net,
j.anaszewski@...sung.com, Abhay_Salunke@...l.com,
Julia.Lawall@...6.fr, Gilles.Muller@...6.fr, nicolas.palix@...g.fr,
teg@...m.no, dhowells@...hat.com, bjorn.andersson@...aro.org,
arend.vanspriel@...adcom.com, kvalo@...eaurora.org,
"Luis R. Rodriguez" <mcgrof@...nel.org>
Subject: [PATCH v3 5/5] firmware: fix fw cache to avoid usermode helper on suspend
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
The firmware cache purposely kills all non-udev (usermode helper)
pending requests prior to suspend with kill_requests_without_uevent()
right before it calls out to request for firmware for the fw cache.
It is pointless to again run into the possible issue of queing up
further usermode helpers during suspend, furthermore its actually
buggy to have required the usermode helper in some cases where
clearly the driver originally had not wanted that. Fix this by
simply using the direct call.
This doesn't fix any known bug however if it should be an optimization
for suspend/resume. While at it extend documentation to ensure folks of
the usermode helper are aware that they must cache the firmware on their
own for suspend / resume.
Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
---
Documentation/firmware_class/README | 3 +++
drivers/base/firmware_class.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
index 00604b6d7675..b7b99f4e3aaf 100644
--- a/Documentation/firmware_class/README
+++ b/Documentation/firmware_class/README
@@ -172,3 +172,6 @@ $ make coccicheck MODE=report
resume callback, and callers needn't cache the firmware by
themselves any more for dealing with firmware loss during system
resume.
+
+The firmware cache is only for non-user mode helper users. Drivers that
+require the usermode helper must deal with caching on their own.
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 22d1760a4278..dca4f9cbf4db 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1412,7 +1412,7 @@ static int cache_firmware(const char *fw_name)
pr_debug("%s: %s\n", __func__, fw_name);
- ret = request_firmware(&fw, fw_name, NULL);
+ ret = request_firmware_direct(&fw, fw_name, NULL);
if (!ret)
kfree(fw);
--
2.9.2
Powered by blists - more mailing lists