<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/linux/kmod.h, branch linux-2.6.32.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.32.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.32.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-06-10T09:42:15Z</updated>
<entry>
<title>usermodehelper: implement UMH_KILLABLE</title>
<updated>2013-06-10T09:42:15Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2012-03-23T22:02:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2a28e9a9f98d9a73ea5ce58328595dcab64a1f6'/>
<id>urn:sha1:e2a28e9a9f98d9a73ea5ce58328595dcab64a1f6</id>
<content type='text'>
commit d0bd587a80960d7ba7e0c8396e154028c9045c54 upstream

Implement UMH_KILLABLE, should be used along with UMH_WAIT_EXEC/PROC.
The caller must ensure that subprocess_info-&gt;path/etc can not go away
until call_usermodehelper_freeinfo().

call_usermodehelper_exec(UMH_KILLABLE) does
wait_for_completion_killable.  If it fails, it uses
xchg(&amp;sub_info-&gt;complete, NULL) to serialize with umh_complete() which
does the same xhcg() to access sub_info-&gt;complete.

If call_usermodehelper_exec wins, it can safely return.  umh_complete()
should get NULL and call call_usermodehelper_freeinfo().

Otherwise we know that umh_complete() was already called, in this case
call_usermodehelper_exec() falls back to wait_for_completion() which
should succeed "very soon".

Note: UMH_NO_WAIT == -1 but it obviously should not be used with
UMH_KILLABLE.  We delay the neccessary cleanup to simplify the back
porting.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
[dannf: backported to Debian's 2.6.32]
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()</title>
<updated>2012-03-04T17:49:23Z</updated>
<author>
<name>Srivatsa S. Bhat</name>
</author>
<published>2012-02-29T06:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0707a9cd9c31b1d831c459469387943978292ff4'/>
<id>urn:sha1:0707a9cd9c31b1d831c459469387943978292ff4</id>
<content type='text'>
[ Upstream commit b298d289c79211508f11cb50749b0d1d54eb244a ]

Commit a144c6a (PM: Print a warning if firmware is requested when tasks
are frozen) introduced usermodehelper_is_disabled() to warn and exit
immediately if firmware is requested when usermodehelpers are disabled.

However, it is racy. Consider the following scenario, currently used in
drivers/base/firmware_class.c:

...
if (usermodehelper_is_disabled())
        goto out;

/* Do actual work */
...

out:
        return err;

Nothing prevents someone from disabling usermodehelpers just after the check
in the 'if' condition, which means that it is quite possible to try doing the
"actual work" with usermodehelpers disabled, leading to undesirable
consequences.

In particular, this race condition in _request_firmware() causes task freezing
failures whenever suspend/hibernation is in progress because, it wrongly waits
to get the firmware/microcode image from userspace when actually the
usermodehelpers are disabled or userspace has been frozen.
Some of the example scenarios that cause freezing failures due to this race
are those that depend on userspace via request_firmware(), such as x86
microcode module initialization and microcode image reload.

Previous discussions about this issue can be found at:
http://thread.gmane.org/gmane.linux.kernel/1198291/focus=1200591

This patch adds proper synchronization to fix this issue.

It is to be noted that this patchset fixes the freezing failures but doesn't
remove the warnings. IOW, it does not attempt to add explicit synchronization
to x86 microcode driver to avoid requesting microcode image at inopportune
moments. Because, the warnings were introduced to highlight such cases, in the
first place. And we need not silence the warnings, since we take care of the
*real* problem (freezing failure) and hence, after that, the warnings are
pretty harmless anyway.

Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>PM: Print a warning if firmware is requested when tasks are frozen</title>
<updated>2012-03-04T17:49:23Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2012-02-29T06:52:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e5c29cfbc26e6ebb93c54d1652f41d90d6a8843'/>
<id>urn:sha1:4e5c29cfbc26e6ebb93c54d1652f41d90d6a8843</id>
<content type='text'>
[ Upstream commit a144c6a6c924aa1da04dd77fb84b89927354fdff ]

Some drivers erroneously use request_firmware() from their -&gt;resume()
(or -&gt;thaw(), or -&gt;restore()) callbacks, which is not going to work
unless the firmware has been built in.  This causes system resume to
stall until the firmware-loading timeout expires, which makes users
think that the resume has failed and reboot their machines
unnecessarily.  For this reason, make _request_firmware() print a
warning and return immediately with error code if it has been called
when tasks are frozen and it's impossible to start any new usermode
helpers.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Reviewed-by: Valdis Kletnieks &lt;valdis.kletnieks@vt.edu&gt;
Signed-off-by: Srivatsa S. Bhat &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>module: try_then_request_module must wait</title>
<updated>2009-04-09T14:49:44Z</updated>
<author>
<name>Herbert Xu</name>
</author>
<published>2009-04-09T02:35:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=97c18e2c7a8e36d2d83d50ee070314aadac73a11'/>
<id>urn:sha1:97c18e2c7a8e36d2d83d50ee070314aadac73a11</id>
<content type='text'>
Since the whole point of try_then_request_module is to retry
the operation after a module has been loaded, we must wait for
the module to fully load.

Otherwise all sort of things start breaking, e.g., you won't
be able to read your encrypted disks on the first attempt.

Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;
Tested-by: Maciej Rutecki &lt;maciej.rutecki@gmail.com&gt;
Tested-by: Patrick McHardy &lt;kaber@trash.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>module: create a request_module_nowait()</title>
<updated>2009-03-31T02:35:35Z</updated>
<author>
<name>Arjan van de Ven</name>
</author>
<published>2009-02-08T18:42:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=acae05156551fd7528fbb616271e672789388e3c'/>
<id>urn:sha1:acae05156551fd7528fbb616271e672789388e3c</id>
<content type='text'>
There seems to be a common pattern in the kernel where drivers want to
call request_module() from inside a module_init() function. Currently
this would deadlock.

As a result, several drivers go through hoops like scheduling things via
kevent, or creating custom work queues (because kevent can deadlock on them).

This patch changes this to use a request_module_nowait() function macro instead,
which just fires the modprobe off but doesn't wait for it, and thus avoids the
original deadlock entirely.

On my laptop this already results in one less kernel thread running..

(Includes Jiri's patch to use enum umh_wait)

Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (bool-ified)
Cc: Jiri Slaby &lt;jirislaby@gmail.com&gt;
</content>
</entry>
<entry>
<title>pm: rework disabling of user mode helpers during suspend/hibernation</title>
<updated>2008-10-16T18:21:29Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2008-10-16T05:01:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bfcf1304ea79c46efc3724e548b13b4b442b418'/>
<id>urn:sha1:1bfcf1304ea79c46efc3724e548b13b4b442b418</id>
<content type='text'>
We currently use a PM notifier to disable user mode helpers before suspend
and hibernation and to re-enable them during resume.  However, this is not
an ideal solution, because if any drivers want to upload firmware into
memory before suspend, they have to use a PM notifier for this purpose and
there is no guarantee that the ordering of PM notifiers will be as
expected (ie.  the notifier that disables user mode helpers has to be run
after the driver's notifier used for uploading the firmware).

For this reason, it seems better to move the disabling and enabling of
user mode helpers to separate functions that will be called by the PM core
as necessary.

[akpm@linux-foundation.org: remove unneeded ifdefs]
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Pavel Machek &lt;pavel@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>call_usermodehelper(): increase reliability</title>
<updated>2008-07-25T17:53:28Z</updated>
<author>
<name>KOSAKI Motohiro</name>
</author>
<published>2008-07-25T08:45:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ac331d158e198d2a91a5b0a3ec4ca9991fdb57af'/>
<id>urn:sha1:ac331d158e198d2a91a5b0a3ec4ca9991fdb57af</id>
<content type='text'>
Presently call_usermodehelper_setup() uses GFP_ATOMIC.  but it can return
NULL _very_ easily.

GFP_ATOMIC is needed only when we can't sleep.  and, GFP_KERNEL is robust
and better.

thus, I add gfp_mask argument to call_usermodehelper_setup().

So, its callers pass the gfp_t as below:

call_usermodehelper() and call_usermodehelper_keys():
	depend on 'wait' argument.
call_usermodehelper_pipe():
	always GFP_KERNEL because always run under process context.
orderly_poweroff():
	pass to GFP_ATOMIC because may run under interrupt context.

Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: "Paul Menage" &lt;menage@google.com&gt;
Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>remove CONFIG_KMOD from core kernel code</title>
<updated>2008-07-22T09:24:31Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2008-07-08T17:00:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1ef5adb4cad43460ebba23c5a78cf4a55bb6a5b'/>
<id>urn:sha1:a1ef5adb4cad43460ebba23c5a78cf4a55bb6a5b</id>
<content type='text'>
Always compile request_module when the kernel allows modules.

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>rework try_then_request_module to do less in non-modular kernels</title>
<updated>2008-07-22T09:24:29Z</updated>
<author>
<name>Johannes Berg</name>
</author>
<published>2008-07-08T17:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df648c9fbebb4de50e7a6e76cc253c7cb0421f9b'/>
<id>urn:sha1:df648c9fbebb4de50e7a6e76cc253c7cb0421f9b</id>
<content type='text'>
This reworks try_then_request_module to only invoke the "lookup"
function "x" once when the kernel is not modular.

Signed-off-by: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>usermodehelper: Tidy up waiting</title>
<updated>2007-07-18T15:47:40Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
</author>
<published>2007-07-18T01:37:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=86313c488a6848b7ec2ba04e74f25f79dd32a0b7'/>
<id>urn:sha1:86313c488a6848b7ec2ba04e74f25f79dd32a0b7</id>
<content type='text'>
Rather than using a tri-state integer for the wait flag in
call_usermodehelper_exec, define a proper enum, and use that.  I've
preserved the integer values so that any callers I've missed should
still work OK.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Bjorn Helgaas &lt;bjorn.helgaas@hp.com&gt;
Cc: Joel Becker &lt;joel.becker@oracle.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Srivatsa Vaddagiri &lt;vatsa@in.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
</content>
</entry>
</feed>
