<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/base/firmware_class.c, branch tegra-10.9.5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>driver core: firmware_class:fix memory leak of page pointers array</title>
<updated>2009-07-28T20:45:22+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-07-11T03:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3b4418c67a70278964b063b5e1f56dcb3d0a41f3'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>Firmware: firmware_class, fix lock imbalance</title>
<updated>2009-07-12T20:02:10+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jirislaby@gmail.com</email>
</author>
<published>2009-06-21T21:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=308975fa7ab2a8e0b91186158128668c823790ce'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>Free struct device in fw_dev_release()</title>
<updated>2009-07-08T16:34:08+00:00</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2009-07-08T10:17:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0f2f2221b4ad816567394a52643963428fd353cd'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: fix gcc 4.3.3 warnings about string literals</title>
<updated>2009-06-16T04:30:25+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2009-06-02T22:39:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=acc0e90fbccbc6e4d48184cba0983ea044e131af'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: allocate firmware id dynamically</title>
<updated>2009-06-16T04:30:24+00:00</updated>
<author>
<name>Samuel Ortiz</name>
<email>sameo@linux.intel.com</email>
</author>
<published>2009-05-26T22:49:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=976821d756c53b421d7c58a9ed60125016d330aa'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;


</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: fix documentation of request_firmware_nowait</title>
<updated>2009-06-16T04:30:24+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-05-29T03:33:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7fcab099795812a8a08eb3b8c8ddb35c3685045f'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: firmware_class: replace kfree(dev) with put_device(dev)</title>
<updated>2009-06-16T04:30:24+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-04-23T14:31:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6acf70f078ca42a63397b8b84bf6383b01303009'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>firmware: speed up request_firmware(), v3</title>
<updated>2009-05-15T11:51:29+00:00</updated>
<author>
<name>David Woodhouse</name>
<email>dwmw2@infradead.org</email>
</author>
<published>2009-04-10T05:04:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6e03a201bbe8137487f340d26aa662110e324b20'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Driver core: implement uevent suppress in kobject</title>
<updated>2009-03-24T23:38:26+00:00</updated>
<author>
<name>Ming Lei</name>
<email>tom.leiming@gmail.com</email>
</author>
<published>2009-03-01T13:10:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f67f129e519fa87f8ebd236b6336fe43f31ee141'/>
<id>f67f129e519fa87f8ebd236b6336fe43f31ee141</id>
<content type='text'>
This patch implements uevent suppress in kobject and removes it
from struct device, based on the following ideas:

1,Uevent sending should be one attribute of kobject, so suppressing it
in kobject layer is more natural than in device layer. By this way,
we can do it for other objects embedded with kobject.

2,It may save several bytes for each instance of struct device.(On my
omap3(32bit ARM) based box, can save 8bytes per device object)

This patch also introduces dev_set|get_uevent_suppress() helpers to
set and query uevent_suppress attribute in case to help kobject
as private part of struct device in future.

[This version is against the latest driver-core patch set of Greg,please
ignore the last version.]

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

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch implements uevent suppress in kobject and removes it
from struct device, based on the following ideas:

1,Uevent sending should be one attribute of kobject, so suppressing it
in kobject layer is more natural than in device layer. By this way,
we can do it for other objects embedded with kobject.

2,It may save several bytes for each instance of struct device.(On my
omap3(32bit ARM) based box, can save 8bytes per device object)

This patch also introduces dev_set|get_uevent_suppress() helpers to
set and query uevent_suppress attribute in case to help kobject
as private part of struct device in future.

[This version is against the latest driver-core patch set of Greg,please
ignore the last version.]

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

</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: struct device - replace bus_id with dev_name(), dev_set_name()</title>
<updated>2009-01-06T18:44:31+00:00</updated>
<author>
<name>Kay Sievers</name>
<email>kay.sievers@vrfy.org</email>
</author>
<published>2008-10-30T00:36:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1e0b2cf933ebf32494eba3f668859ba57f06a951'/>
<id>1e0b2cf933ebf32494eba3f668859ba57f06a951</id>
<content type='text'>
Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
</feed>
