Skip to content

Commit

Permalink
firmware loader: document firmware cache mechanism
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ming1 authored and gregkh committed Nov 14, 2012
1 parent 2760284 commit 6a92785
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Documentation/firmware_class/README
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@
on the setup, so I think that the choice on what firmware to make
persistent should be left to userspace.

about firmware cache:
--------------------
After firmware cache mechanism is introduced during system sleep,
request_firmware can be called safely inside device's suspend and
resume callback, and callers need't cache the firmware by
themselves any more for dealing with firmware loss during system
resume.
3 changes: 3 additions & 0 deletions drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,9 @@ static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent,
* firmware image for this or any other device.
*
* Caller must hold the reference count of @device.
*
* The function can be called safely inside device's suspend and
* resume callback.
**/
int
request_firmware(const struct firmware **firmware_p, const char *name,
Expand Down

0 comments on commit 6a92785

Please sign in to comment.