firmware loader: let caching firmware piggyback on loading firmware
authorMing Lei <ming.lei@canonical.com>
Mon, 20 Aug 2012 11:04:16 +0000 (19:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 21:46:16 +0000 (14:46 -0700)
commitac39b3ea73aacde876d1d5ee1ca3e2719f771482
tree58b9ee67654ea41ddba770f827d7f949ee1d40f2
parentef40bb1bd01738670bd567e3dce8e862f2b91bf3
firmware loader: let caching firmware piggyback on loading firmware

After starting caching firmware, there is still some time left
before devices are suspended, during the period, request_firmware
or its nowait version may still be triggered by the below situations
to load firmware images which can't be cached during suspend/resume
cycle.

- new devices added
- driver bind
- or device open kind of things

This patch utilizes the piggyback trick to cache firmware for
this kind of situation: just increase the firmware buf's reference
count and add the fw name entry into cache entry list after starting
caching firmware and before syscore_suspend() is called.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_class.c