<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/firmware_class.c, branch v2.6.33.16</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/base/firmware_class.c?h=v2.6.33.16</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/base/firmware_class.c?h=v2.6.33.16'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-08-02T17:26:46Z</updated>
<entry>
<title>firmware_class: fix memory leak - free allocated pages</title>
<updated>2010-08-02T17:26:46Z</updated>
<author>
<name>David Woodhouse</name>
<email>David.Woodhouse@intel.com</email>
</author>
<published>2010-05-02T08:21:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=725e3ec1822fc30dae921690d3074f540d533c1d'/>
<id>urn:sha1:725e3ec1822fc30dae921690d3074f540d533c1d</id>
<content type='text'>
commit dd336c554d8926c3348a2d5f2a5ef5597f6d1a06 upstream.

fix memory leak introduced by the patch 6e03a201bbe:
firmware: speed up request_firmware()

1. vfree won't release pages there were allocated explicitly and mapped
using vmap. The memory has to be vunmap-ed and the pages needs
to be freed explicitly

2. page array is moved into the 'struct
firmware' so that we can free it from release_firmware()
and not only in fw_dev_release()

The fix doesn't break the firmware load speed.

Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Ming Lei &lt;tom.leiming@gmail.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Singed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Signed-off-by: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firmware_class: make request_firmware_nowait more useful</title>
<updated>2009-12-11T19:24:52Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes@sipsolutions.net</email>
</author>
<published>2009-10-29T11:36:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9ebfbd45f9d4ee9cd72529cf99e5f300eb398e67'/>
<id>urn:sha1:9ebfbd45f9d4ee9cd72529cf99e5f300eb398e67</id>
<content type='text'>
Unfortunately, one cannot hold on to the struct firmware
that request_firmware_nowait() hands off, which is needed
in some cases. Allow this by requiring the callback to
free it (via release_firmware).

Additionally, give it a gfp_t parameter -- all the current
users call it from a GFP_KERNEL context so the GFP_ATOMIC
isn't necessary. This also marks an API break which is
useful in a sense, although that is obviously not the
primary purpose of this change.

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Ming Lei &lt;tom.leiming@gmail.com&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Cc: Pavel Roskin &lt;proski@gnu.org&gt;
Cc: Abhay Salunke &lt;abhay_salunke@dell.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver core: firmware_class:fix memory leak of page pointers array</title>
<updated>2009-07-28T20:45:22Z</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-07-11T03:11:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3b4418c67a70278964b063b5e1f56dcb3d0a41f3'/>
<id>urn:sha1:3b4418c67a70278964b063b5e1f56dcb3d0a41f3</id>
<content type='text'>
The page pointers array is allocated in fw_realloc_buffer() called by
firmware_data_write(), and should be freed in release function of firmware
device.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Reported-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Firmware: firmware_class, fix lock imbalance</title>
<updated>2009-07-12T20:02:10Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2009-06-21T21:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=308975fa7ab2a8e0b91186158128668c823790ce'/>
<id>urn:sha1:308975fa7ab2a8e0b91186158128668c823790ce</id>
<content type='text'>
Add omitted unlock in firmware_data_read.

Signed-off-by: Jiri Slaby &lt;jirislaby@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Free struct device in fw_dev_release()</title>
<updated>2009-07-08T16:34:08Z</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2009-07-08T10:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0f2f2221b4ad816567394a52643963428fd353cd'/>
<id>urn:sha1:0f2f2221b4ad816567394a52643963428fd353cd</id>
<content type='text'>
The f_dev in _request_firmware() is allocated via the fw_setup_device()
and fw_register_device() calls and its class set to firmware_class (the
class release function is fw_dev_release).

Commit 6acf70f078ca replaced the kfree(dev) in fw_dev_release() with a
put_device() call but my understanding is that the release function is
called via put_device -&gt; kobject_put -&gt; kref_put -&gt; koject_release etc.
and it should call kfree since it's the last to see this device
structure alive.

Because of that, the _request_firmware() function on its -ENOENT error
path only calls device_unregister(f_dev) which would eventually call
fw_dev_release() but there is no kfree (the subsequent put_device call
would just make the kref negative).

Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Acked-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: fix gcc 4.3.3 warnings about string literals</title>
<updated>2009-06-16T04:30:25Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2009-06-02T22:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=acc0e90fbccbc6e4d48184cba0983ea044e131af'/>
<id>urn:sha1:acc0e90fbccbc6e4d48184cba0983ea044e131af</id>
<content type='text'>
This removes the
	warning: format not a string literal and no format arguments
warnings in the driver core that gcc 4.3.3 complains about.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firmware: allocate firmware id dynamically</title>
<updated>2009-06-16T04:30:24Z</updated>
<author>
<name>Samuel Ortiz</name>
<email>sameo@linux.intel.com</email>
</author>
<published>2009-05-26T22:49:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=976821d756c53b421d7c58a9ed60125016d330aa'/>
<id>urn:sha1:976821d756c53b421d7c58a9ed60125016d330aa</id>
<content type='text'>
The firmware loader has a statically allocated 30 bytes long string for
the firmware id (a.k.a. the firmware file name). There is no reason why
we couldnt allocate it dynamically, and avoid having restrictions on the
firmware names lengths.

Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Cc: Marcel Holtmann &lt;holtmann@linux.intel.com&gt;
Cc: Zhu Yi &lt;yi.zhu@intel.com&gt;,
Cc: John Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>driver core: fix documentation of request_firmware_nowait</title>
<updated>2009-06-16T04:30:24Z</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-05-29T03:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7fcab099795812a8a08eb3b8c8ddb35c3685045f'/>
<id>urn:sha1:7fcab099795812a8a08eb3b8c8ddb35c3685045f</id>
<content type='text'>
request_firmware_nowait declares it can be called in non-sleep contexts,
but kthead_run called by request_firmware_nowait may sleep. So fix its
documentation and comment to make callers clear about it.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver core: firmware_class: replace kfree(dev) with put_device(dev)</title>
<updated>2009-06-16T04:30:24Z</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-04-23T14:31:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6acf70f078ca42a63397b8b84bf6383b01303009'/>
<id>urn:sha1:6acf70f078ca42a63397b8b84bf6383b01303009</id>
<content type='text'>
against v2.6.30-rc3-next tree.

Signed-off-by: Ming Lei &lt;tom.leiming@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>firmware: speed up request_firmware(), v3</title>
<updated>2009-05-15T11:51:29Z</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2009-04-10T05:04:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6e03a201bbe8137487f340d26aa662110e324b20'/>
<id>urn:sha1:6e03a201bbe8137487f340d26aa662110e324b20</id>
<content type='text'>
Rather than calling vmalloc() repeatedly to grow the firmware image as
we receive data from userspace, just allocate and fill individual pages.
Then vmap() the whole lot in one go when we're done.

A quick test with a 337KiB iwlagn firmware shows the time taken for
request_firmware() going from ~32ms to ~5ms after I apply this patch.

[v2: define PAGE_KERNEL_RO as PAGE_KERNEL where necessary, use min_t()]
[v3: kunmap() takes the struct page *, not the virtual address]

Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
Tested-by: Sachin Sant &lt;sachinp@in.ibm.com&gt;
</content>
</entry>
</feed>
