lkml.org 
[lkml]   [2008]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] firmware: avoiding multiple replication for same firmware file
From
Date
On Fri, 2008-08-01 at 11:30 +0530, Jaswinder Singh wrote:
> Now when request_firmware will be called it will check whether firmware
> is already allocated or not. If already allocated then it provide handle
> of old firmware handle and increase count of firmware.
>
> release_firmware will decrease count of firmware, if count is one only then
> firmware will be release.

I like this. It means that when you have multiple similar devices, you
only need one copy of the firmware in memory for _all_ of them. Because
we've now made fw->data constant, we know it's safe to share them now.

I wonder if we should change the implementation of 'built-in firmware'
to use your new implementation -- just set the use count on the built-in
firmware to 1 when we start up, and then it should never go away.

Unless we're _really_ clever with linker tricks it would mean we'd have
an init function which takes the built-in stuff and builds it into the
linked list, but I think that might be worth the runtime simplification.

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation





\
 
 \ /
  Last update: 2008-08-01 22:07    [W:0.053 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site