aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2012-11-03 05:48:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-14 18:07:18 -0500
commit6a927857d890658789e6e54b058ef8527de8200a (patch)
tree96caa4c27cf460927601fae8490dffaeb6a421f4
parent27602842060484b564cd725241b402b0bddfb830 (diff)
firmware loader: document firmware cache mechanism
This patch documents the firmware cache mechanism so that users of request_firmware() know that it can be called safely inside device's suspend and resume callback, and the device's firmware needn't be cached any more by individual driver itself to deal with firmware loss during system resume. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--Documentation/firmware_class/README7
-rw-r--r--drivers/base/firmware_class.c3
2 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README
index e9fce78c4137..43fada989e65 100644
--- a/Documentation/firmware_class/README
+++ b/Documentation/firmware_class/README
@@ -119,3 +119,10 @@
119 on the setup, so I think that the choice on what firmware to make 119 on the setup, so I think that the choice on what firmware to make
120 persistent should be left to userspace. 120 persistent should be left to userspace.
121 121
122 about firmware cache:
123 --------------------
124 After firmware cache mechanism is introduced during system sleep,
125 request_firmware can be called safely inside device's suspend and
126 resume callback, and callers need't cache the firmware by
127 themselves any more for dealing with firmware loss during system
128 resume.
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 7888af7941a0..d81460309182 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -988,6 +988,9 @@ err_put_dev:
988 * firmware image for this or any other device. 988 * firmware image for this or any other device.
989 * 989 *
990 * Caller must hold the reference count of @device. 990 * Caller must hold the reference count of @device.
991 *
992 * The function can be called safely inside device's suspend and
993 * resume callback.
991 **/ 994 **/
992int 995int
993request_firmware(const struct firmware **firmware_p, const char *name, 996request_firmware(const struct firmware **firmware_p, const char *name,