summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2012-08-04 08:01:21 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-17 00:22:45 +0400
commit1f2b79599ee8f5fc82cc73c6c090eb6cdff881d6 (patch)
tree6b3fed8d355f708cc6a001e772f07783a300d2cd /include/linux
parent1244691c73b250be522e77ac1a00ad53b601b4c4 (diff)
downloadlinux-1f2b79599ee8f5fc82cc73c6c090eb6cdff881d6.tar.xz
firmware loader: always let firmware_buf own the pages buffer
This patch always let firmware_buf own the pages buffer allocated inside firmware_data_write, and add all instances of firmware_buf into the firmware cache global list. Also introduce one private field in 'struct firmware', so release_firmware will see the instance of firmware_buf associated with the current firmware instance, then just 'free' the instance of firmware_buf. The firmware_buf instance represents one pages buffer for one firmware image, so lots of firmware loading requests can share the same firmware_buf instance if they request the same firmware image file. This patch will make implementation of the following cache_firmware/ uncache_firmware very easy and simple. In fact, the patch improves request_formware/release_firmware: - only request userspace to write firmware image once if several devices share one same firmware image and its drivers call request_firmware concurrently. Signed-off-by: Ming Lei <ming.lei@canonical.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/firmware.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 1e7c01189fa6..e85b771f3d8c 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -12,6 +12,9 @@ struct firmware {
size_t size;
const u8 *data;
struct page **pages;
+
+ /* firmware loader private fields */
+ void *priv;
};
struct module;