<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/firmware_class.c, branch v3.14</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.14</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.14'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-02-26T00:13:15Z</updated>
<entry>
<title>PM / hibernate: Fix restore hang in freeze_processes()</title>
<updated>2014-02-26T00:13:15Z</updated>
<author>
<name>Sebastian Capella</name>
<email>sebastian.capella@linaro.org</email>
</author>
<published>2014-02-19T01:52:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f8d5b9e9e5372f0deb7bc1ab1088a9b60b0a793d'/>
<id>urn:sha1:f8d5b9e9e5372f0deb7bc1ab1088a9b60b0a793d</id>
<content type='text'>
During restore, pm_notifier chain are called with
PM_RESTORE_PREPARE.  The firmware_class driver handler
fw_pm_notify does not have a handler for this.  As a result,
it keeps a reader on the kmod.c umhelper_sem.  During
freeze_processes, the call to __usermodehelper_disable tries to
take a write lock on this semaphore and hangs waiting.

Signed-off-by: Sebastian Capella &lt;sebastian.capella@linaro.org&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>firmware_class: Fix the file size check</title>
<updated>2014-01-09T04:29:19Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2013-12-28T15:53:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=08da2012e0bb0f3f1422cce3f76c36a90da366b5'/>
<id>urn:sha1:08da2012e0bb0f3f1422cce3f76c36a90da366b5</id>
<content type='text'>
We expect to read firmware blobs with a single call to kernel_read(),
which returns int.  Therefore the size must be within the range of
int, not long.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware loader: Add sparse annotation</title>
<updated>2014-01-08T23:36:18Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2014-01-04T13:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=98233b21cd6e6b9bd8ad5d4756bda1c051567468'/>
<id>urn:sha1:98233b21cd6e6b9bd8ad5d4756bda1c051567468</id>
<content type='text'>
Avoid that sparse reports the following warning on __fw_free_buf():

drivers/base/firmware_class.c:230:9: warning: context imbalance in '__fw_free_buf' - unexpected unlock

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware: Suppress fallback warnings when CONFIG_FW_LOADER_USER_HELPER=n</title>
<updated>2013-12-09T02:22:33Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-12-02T14:38:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=68aeeaaaf86b61c78dca09879ce262778a9080e4'/>
<id>urn:sha1:68aeeaaaf86b61c78dca09879ce262778a9080e4</id>
<content type='text'>
The commit [3e358ac2bb5b: firmware: Be a bit more verbose about direct
firmware loading failure] introduced a new warning message about
falling back to user helper, but this isn't true when
CONFIG_FW_LOADER_USER_HELPER isn't set.

In this patch, clear the FW_OPT_FALLBACK flag in the case without
userhelper, so that the corresponding code will be disabled.

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware: Use bit flags instead of boolean combos</title>
<updated>2013-12-09T02:22:32Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-12-02T14:38:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14c4bae77c80bd37f19d95405d42bd0b1fd95add'/>
<id>urn:sha1:14c4bae77c80bd37f19d95405d42bd0b1fd95add</id>
<content type='text'>
More than two boolean arguments to a function are rather confusing and
error-prone for callers.  Let's make the behavior bit flags instead of
triple combos.

A nice suggestion by Borislav Petkov.

Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Acked-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware: Introduce request_firmware_direct()</title>
<updated>2013-12-09T02:22:32Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2013-12-02T14:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bba3a87e982ad5992e776ca1fc409326915d6b44'/>
<id>urn:sha1:bba3a87e982ad5992e776ca1fc409326915d6b44</id>
<content type='text'>
When CONFIG_FW_LOADER_USER_HELPER is set, request_firmware() falls
back to the usermode helper for loading via udev when the direct
loading fails.  But the recent udev takes way too long timeout (60
seconds) for non-existing firmware.  This is unacceptable for the
drivers like microcode loader where they load firmwares optionally,
i.e. it's no error even if no requested file exists.

This patch provides a new helper function, request_firmware_direct().
It behaves as same as request_firmware() except for that it doesn't
fall back to usermode helper but returns an error immediately if the
f/w can't be loaded directly in kernel.

Without CONFIG_FW_LOADER_USER_HELPER=y, request_firmware_direct() is
just an alias of request_firmware(), due to obvious reason.

Tested-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Acked-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware: Be a bit more verbose about direct firmware loading failure</title>
<updated>2013-09-26T22:35:30Z</updated>
<author>
<name>Neil Horman</name>
<email>nhorman@tuxdriver.com</email>
</author>
<published>2013-09-06T19:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3e358ac2bb5bb9c9f4842145ca0da2384d13fd98'/>
<id>urn:sha1:3e358ac2bb5bb9c9f4842145ca0da2384d13fd98</id>
<content type='text'>
The direct firmware loading interface is a bit quiet about failures.  Failures
that occur during loading are masked if firmware exists in multiple locations,
and may be masked entirely in the event that we fall back to the user mode
helper code.  It would be nice to see some of the more unexpected errors get
logged, so in the event that you expect the direct firmware loader to work (like
if CONFIG_FW_LOADER_USER_HELPER is enabled), and something goes wrong, you can
figure out what happened.

Signed-off-by: Neil Horman &lt;nhorman@tuxdriver.com&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware loader: fix pending_fw_head list corruption</title>
<updated>2013-08-30T19:04:27Z</updated>
<author>
<name>Maxime Bizon</name>
<email>mbizon@freebox.fr</email>
</author>
<published>2013-08-29T18:28:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1eeeef153c02f5856ec109fa532eb5f31c39f85c'/>
<id>urn:sha1:1eeeef153c02f5856ec109fa532eb5f31c39f85c</id>
<content type='text'>
Got the following oops just before reboot:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
[&lt;8028d300&gt;] (__list_del_entry+0x44/0xac)
[&lt;802e3320&gt;] (__fw_load_abort.part.13+0x1c/0x50)
[&lt;802e337c&gt;] (fw_shutdown_notify+0x28/0x50)
[&lt;80034f80&gt;] (notifier_call_chain.isra.1+0x5c/0x9c)
[&lt;800350ec&gt;] (__blocking_notifier_call_chain+0x44/0x58)
[&lt;80035114&gt;] (blocking_notifier_call_chain+0x14/0x18)
[&lt;80035d64&gt;] (kernel_restart_prepare+0x14/0x38)
[&lt;80035d94&gt;] (kernel_restart+0xc/0x50)

The following race condition triggers here:

  _request_firmware_load()
  device_create_file(...)
  kobject_uevent(...)
  (schedule)
                                       (resume)
                                       firmware_loading_store(1)
                                       firmware_loading_store(0)
                                       list_del_init(&amp;buf-&gt;pending_list)
                                       (schedule)
  (resume)
  list_add(&amp;buf-&gt;pending_list, &amp;pending_fw_head);
  wait_for_completion(&amp;buf-&gt;completion);

causing an oops later when walking pending_list after the firmware has
been released.

The proposed fix is to move the list_add() before sysfs attribute
creation.

Signed-off-by: Maxime Bizon &lt;mbizon@freebox.fr&gt;
Acked-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: firmware: use __ATTR_RW()</title>
<updated>2013-08-24T00:08:48Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-08-24T00:08:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=14adbe5307a4110af7d1e95fb604a1abcdaa6cce'/>
<id>urn:sha1:14adbe5307a4110af7d1e95fb604a1abcdaa6cce</id>
<content type='text'>
Use __ATTR_RW() instead of __ATTR() to make it more obvious what the
type of attribute is being created.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>firmware loader: fix another compile warning with PM_SLEEP unset</title>
<updated>2013-06-26T04:04:22Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2013-06-26T01:28:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a2c123427ffece4174db0792c3009e7df770d9a'/>
<id>urn:sha1:6a2c123427ffece4174db0792c3009e7df770d9a</id>
<content type='text'>
This patch fixes another compiling warning with PM_SLEEP unset:

drivers/base/firmware_class.c:221:29: warning: 'fw_lookup_buf' defined
but not used [-Wunused-function]

This time I do build kernel with both PM_SLEEP set and unset, and no
warning found any more with the patch.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
