All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	Kay Sievers <kay.sievers@vrfy.org>,
	LKML <linux-kernel@vger.kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>
Subject: Re: [RFC][PATCH -mm 3/3] PM: Disable _request_firmware before hibernation/suspend
Date: Mon, 28 May 2007 13:15:54 +0200	[thread overview]
Message-ID: <20070528111554.GF18807@elf.ucw.cz> (raw)
In-Reply-To: <200705280943.54312.rjw@sisk.pl>

Hi!

> > > > What exactly is the problem we see here? The timeout of the firmware loader?
> > > > What goes wrong with frozen userspace, usually there is only a netlink
> > > > message sent from the kernel, which should be received and handled
> > > > just fine when userspace is running again.
> > > 
> > > Driver calls request_firmware in the resume method. The userspace helper 
> > > can't be run because it's been frozen, so the firmware never gets loaded 
> > > and the call times out. The driver then fails to resume. While all this 
> > > is happening, the rest of the kernel is blocking on that resume method. 
> > > The firmware can be loaded once userspace has been started again, but by 
> > > that time the driver has given up.
> > 
> > Seems, that's just the broken synchronous firmware loading interface
> > with the useless timeout handling. The nowait version of the same loader
> > doesn't time out, and should not have that problem. The sync version
> > should be removed from the kernel, it just causes all sorts of problems
> > since it exists.
> > 
> > Userspace should handle the async request just fine when it comes back
> > running, regardless of the time it was submitted.
> 
> Okay, so the solution is to convert the drivers to use
> request_firmware_nowait() instead of request_firmware() in their .resume()
> routines.

You'll just get deadlock at different level (and more rare).

Imagine disk with its firmware on NFS and NFS with its firmware on
disk.

(Or maybe firmware loader doing find /, including both disk and
NFS). Just don't call request_firmware_* from .resume().


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kay Sievers <kay.sievers@vrfy.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Nigel Cunningham <nigel@nigel.suspend2.net>,
	Alan Stern <stern@rowland.harvard.edu>,
	Oliver Neukum <oliver@neukum.org>
Subject: Re: [RFC][PATCH -mm 3/3] PM: Disable _request_firmware before hibernation/suspend
Date: Mon, 28 May 2007 13:15:54 +0200	[thread overview]
Message-ID: <20070528111554.GF18807@elf.ucw.cz> (raw)
In-Reply-To: <200705280943.54312.rjw@sisk.pl>

Hi!

> > > > What exactly is the problem we see here? The timeout of the firmware loader?
> > > > What goes wrong with frozen userspace, usually there is only a netlink
> > > > message sent from the kernel, which should be received and handled
> > > > just fine when userspace is running again.
> > > 
> > > Driver calls request_firmware in the resume method. The userspace helper 
> > > can't be run because it's been frozen, so the firmware never gets loaded 
> > > and the call times out. The driver then fails to resume. While all this 
> > > is happening, the rest of the kernel is blocking on that resume method. 
> > > The firmware can be loaded once userspace has been started again, but by 
> > > that time the driver has given up.
> > 
> > Seems, that's just the broken synchronous firmware loading interface
> > with the useless timeout handling. The nowait version of the same loader
> > doesn't time out, and should not have that problem. The sync version
> > should be removed from the kernel, it just causes all sorts of problems
> > since it exists.
> > 
> > Userspace should handle the async request just fine when it comes back
> > running, regardless of the time it was submitted.
> 
> Okay, so the solution is to convert the drivers to use
> request_firmware_nowait() instead of request_firmware() in their .resume()
> routines.

You'll just get deadlock at different level (and more rare).

Imagine disk with its firmware on NFS and NFS with its firmware on
disk.

(Or maybe firmware loader doing find /, including both disk and
NFS). Just don't call request_firmware_* from .resume().


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  parent reply	other threads:[~2007-05-28 11:15 UTC|newest]

Thread overview: 161+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-27 20:29 [RFC][PATCH -mm 0/3] PM: Hibernation and suspend notifiers Rafael J. Wysocki
2007-05-27 20:30 ` [RFC][PATCH -mm 1/3] " Rafael J. Wysocki
2007-05-28  9:49   ` Nigel Cunningham
2007-05-28  9:49     ` Nigel Cunningham
2007-05-28 13:12   ` Pavel Machek
2007-05-28 13:12     ` Pavel Machek
2007-05-28 17:26     ` Rafael J. Wysocki
2007-05-28 17:26       ` Rafael J. Wysocki
2007-05-28 15:56   ` Alan Stern
2007-05-28 15:56     ` Alan Stern
2007-05-28 17:29     ` Rafael J. Wysocki
2007-05-28 17:29       ` Rafael J. Wysocki
2007-05-29 22:24     ` Rafael J. Wysocki
2007-05-29 22:24     ` Rafael J. Wysocki
2007-05-30 15:37       ` Pavel Machek
2007-05-30 20:44         ` Rafael J. Wysocki
2007-05-30 21:11           ` Rafael J. Wysocki
2007-05-30 22:24             ` Nigel Cunningham
2007-05-30 22:24               ` Nigel Cunningham
2007-05-31  5:44               ` Rafael J. Wysocki
2007-05-31  5:44               ` Rafael J. Wysocki
2007-05-31 14:23                 ` Pavel Machek
2007-05-31 14:23                 ` Pavel Machek
2007-05-31 20:02                   ` Rafael J. Wysocki
2007-05-31 20:02                     ` Rafael J. Wysocki
2007-05-31 21:56                     ` Nigel Cunningham
2007-05-31 21:56                     ` Nigel Cunningham
2007-05-30 22:29             ` Pavel Machek
2007-05-30 22:29             ` Pavel Machek
2007-05-31  5:42               ` Rafael J. Wysocki
2007-05-31  5:42               ` Rafael J. Wysocki
2007-05-30 21:11           ` Rafael J. Wysocki
2007-05-30 20:44         ` Rafael J. Wysocki
2007-05-30 15:37       ` Pavel Machek
2007-05-27 20:30 ` Rafael J. Wysocki
2007-05-27 20:30 ` [RFC][PATCH -mm 2/3] PM: Disable usermode helper before hibernation/suspend Rafael J. Wysocki
2007-05-27 20:30 ` Rafael J. Wysocki
2007-05-28 13:04   ` Pavel Machek
2007-05-28 13:04     ` Pavel Machek
2007-05-27 20:31 ` [RFC][PATCH -mm 3/3] PM: Disable _request_firmware " Rafael J. Wysocki
2007-05-27 20:31 ` Rafael J. Wysocki
2007-05-27 20:45   ` Michael-Luke Jones
2007-05-27 20:45   ` Michael-Luke Jones
2007-05-27 21:55     ` Rafael J. Wysocki
2007-05-27 21:55       ` Rafael J. Wysocki
2007-05-28 13:01     ` Pavel Machek
2007-05-28 13:01       ` Pavel Machek
2007-05-29 20:41     ` Rob Landley
2007-05-29 20:41       ` Rob Landley
2007-05-27 20:49   ` Matthew Garrett
2007-05-27 21:45     ` Rafael J. Wysocki
2007-05-27 22:01       ` Matthew Garrett
2007-05-27 22:01       ` Matthew Garrett
2007-05-28  7:44         ` Rafael J. Wysocki
2007-05-28  7:44         ` Rafael J. Wysocki
2007-05-28 16:09         ` Alan Stern
2007-05-28 16:09           ` Alan Stern
2007-05-28 16:12           ` Matthew Garrett
2007-05-28 16:12             ` Matthew Garrett
2007-05-28 16:43             ` Alan Stern
2007-05-28 16:43               ` Alan Stern
2007-05-28 16:54               ` Matthew Garrett
2007-05-28 16:54                 ` Matthew Garrett
2007-05-28 20:03                 ` Alan Stern
2007-05-28 20:03                   ` Alan Stern
2007-05-28 20:57               ` Pavel Machek
2007-05-28 20:57                 ` Pavel Machek
2007-05-28 22:29                 ` Alan Stern
2007-05-29 20:09                   ` David Brownell
2007-05-29 20:09                   ` [linux-pm] " David Brownell
2007-05-29 20:48                     ` Alan Stern
2007-05-29 20:48                     ` Alan Stern
2007-06-04 11:00                   ` Pavel Machek
2007-06-04 11:00                   ` Pavel Machek
2007-06-05 18:45                     ` Alan Stern
2007-06-05 18:45                     ` Alan Stern
2007-06-05 20:26                       ` Pavel Machek
2007-06-05 20:26                       ` Pavel Machek
2007-05-28 22:29                 ` Alan Stern
2007-05-28  8:30       ` Nigel Cunningham
2007-05-28  8:30         ` Nigel Cunningham
2007-05-28 11:22         ` Rafael J. Wysocki
2007-05-28 11:22           ` Rafael J. Wysocki
2007-05-27 21:45     ` Rafael J. Wysocki
2007-05-27 21:49     ` Kay Sievers
2007-05-27 22:01       ` Rafael J. Wysocki
2007-05-27 22:01       ` Rafael J. Wysocki
2007-05-27 22:04       ` Matthew Garrett
2007-05-27 22:04       ` Matthew Garrett
2007-05-27 22:16         ` Kay Sievers
2007-05-27 22:16         ` Kay Sievers
2007-05-28  7:43           ` Rafael J. Wysocki
2007-05-28  7:43             ` Rafael J. Wysocki
2007-05-28  8:48             ` Michael-Luke Jones
2007-05-28  8:48               ` Michael-Luke Jones
2007-05-28  9:06               ` Kay Sievers
2007-05-28  9:06                 ` Kay Sievers
2007-05-28 10:26                 ` Michael-Luke Jones
2007-05-28 10:26                   ` Michael-Luke Jones
2007-05-28 12:01                   ` Kay Sievers
2007-05-28 12:01                     ` Kay Sievers
2007-05-28 12:07                     ` Michael-Luke Jones
2007-05-28 12:07                       ` Michael-Luke Jones
2007-05-28 10:41                 ` Michael-Luke Jones
2007-05-28 10:41                   ` Michael-Luke Jones
2007-05-29 21:19                 ` Rob Landley
2007-05-29 21:19                 ` Rob Landley
2007-05-29 22:51               ` Rob Landley
2007-05-29 22:51                 ` Rob Landley
2007-05-30 19:50                 ` Pavel Machek
2007-05-30 19:50                 ` Pavel Machek
2007-05-28 11:15             ` Pavel Machek [this message]
2007-05-28 11:15               ` Pavel Machek
2007-05-28 11:24               ` Kay Sievers
2007-05-28 11:24                 ` Kay Sievers
2007-05-28 11:28                 ` Pavel Machek
2007-05-28 11:28                   ` Pavel Machek
2007-05-28 11:38                 ` Michael-Luke Jones
2007-05-28 11:38                   ` Michael-Luke Jones
2007-05-28 11:45                   ` Pavel Machek
2007-05-28 11:45                   ` [linux-pm] " Pavel Machek
2007-05-28 11:51                   ` Kay Sievers
2007-05-28 11:51                     ` Kay Sievers
2007-05-28 12:26                     ` Michael-Luke Jones
2007-05-28 12:26                       ` Michael-Luke Jones
2007-05-28 12:47                       ` Kay Sievers
2007-05-28 12:47                         ` Kay Sievers
2007-05-28 13:00                       ` Pavel Machek
2007-05-28 13:00                         ` Pavel Machek
2007-05-28 13:10                         ` Michael-Luke Jones
2007-05-28 13:10                           ` Michael-Luke Jones
2007-05-28 11:28               ` Rafael J. Wysocki
2007-05-28 11:28                 ` Rafael J. Wysocki
2007-05-27 21:49     ` Kay Sievers
2007-05-27 20:49   ` Matthew Garrett
2007-05-28 13:07   ` Pavel Machek
2007-05-28 13:07     ` Pavel Machek
2007-05-28 15:55   ` Alan Stern
2007-05-28 15:55     ` Alan Stern
2007-05-28 17:43     ` Rafael J. Wysocki
2007-05-28 17:43       ` Rafael J. Wysocki
2007-05-28 20:51       ` Ray Lee
2007-05-28 20:51         ` Ray Lee
2007-05-28 20:59         ` Pavel Machek
2007-05-28 20:59           ` Pavel Machek
2007-06-02  0:41 ` [RFC][PATCH -mm 0/2] PM: Hibernation and suspend notifiers (rev. 2) Rafael J. Wysocki
2007-06-02  0:43   ` [RFC][PATCH -mm 1/2] PM: Introduce hibernation and suspend notifiers Rafael J. Wysocki
2007-06-03 16:41     ` Pavel Machek
2007-06-03 22:38       ` Rafael J. Wysocki
2007-06-03 22:59         ` Pavel Machek
2007-06-03 22:59         ` Pavel Machek
2007-06-04  7:56           ` Rafael J. Wysocki
2007-06-04  7:56           ` Rafael J. Wysocki
2007-06-03 22:38       ` Rafael J. Wysocki
2007-06-03 16:41     ` Pavel Machek
2007-06-02  0:43   ` Rafael J. Wysocki
2007-06-02  0:44   ` [RFC][PATCH -mm 2/2] PM: Disable usermode helper before hibernation and suspend Rafael J. Wysocki
2007-06-03 16:42     ` Pavel Machek
2007-06-03 16:42     ` Pavel Machek
2007-06-02  0:44   ` Rafael J. Wysocki
2007-06-02  0:41 ` [RFC][PATCH -mm 0/2] PM: Hibernation and suspend notifiers (rev. 2) Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070528111554.GF18807@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.