From: Linus Torvalds <torvalds@linux-foundation.org>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Ciprian Docan <docan@eden.rutgers.edu>,
netdev@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
"Rafael, J. Wysocki" <rjw@sisk.pl>, Greg KH <gregkh@suse.de>
Subject: Re: Suspend/resume - slow resume
Date: Mon, 18 Apr 2011 11:49:01 -0700 [thread overview]
Message-ID: <BANLkTim_1OgqjCeD1a4Ay2fWJSmPHa_XTQ@mail.gmail.com> (raw)
In-Reply-To: <20110418180813.GA18469@electric-eye.fr.zoreil.com>
[-- Attachment #1: Type: text/plain, Size: 3010 bytes --]
On Mon, Apr 18, 2011 at 11:08 AM, Francois Romieu <romieu@fr.zoreil.com> wrote:
> [...]
>> - unload not on close, but on device unregister (iow not when you do
>> "ifconfig eth0 down", but when the "eth0" device really goes away)
>
> Without further action, the firmware(s) will thus be locked in until the
> driver is removed.
I do agree. It's a downside. Maybe doing it in "close()" is the right
thing, as long as we don't have that crazy "every four timer ticks"
situation with rtl8169_reinit_task.
As mentioned, the only real reason for me to be worried about the
close thing is that I don't have a good feel for what happens at boot
time. Are the setup scripts going to look at the interface lots of
times? On my desktop, I couldn't care less, but I try to keep boot
time in mind.
Maybe in practice there's just a single open at boot-time (for dhcp or
whatever), and I'm just worried for no good reason.
Without having looked at that whole rtl8169_reinit_task thing, I
probably wouldn't even worry about anything else doing something
similar ;)
> As long as it can be fixed... If the 60s delay is removed and the firmware
> loading emits some messages for programmer barbie, I am more than happy.
So the firmware loading timeout used to be ten seconds (which I
already think is excessive), but then commit
2f65168de7d68a5795e945e781d85b313bdc97b9 increased it to 60s because
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=174589
The ipw driver sometimes takes a long time to load its firmware.
Whilst the ipw driver should be using the async interface of
the firmware loader to make this a non-issue, this is a minimal fix.
although when I actually look at that bugzilla entry, the _timestamps_
for the failed case do not seem to support this being a timeout.
Very odd.
But the real problem is that we do that timeout even in cases where it
cannot help, ie when people load firmware during early boot or during
suspend. So I think drivers/base/firmware_class.c should be made a bit
smarter.
We have a few cases where call_usermodehelper() fails immediately:
- khelper_wq hasn't been set up yet
- usermodehelper_disabled is set.
and in particular, during suspend/resume, that
"usermodehelper_disabled" flag will be set.
I don't think it is sensible to do a user request for firmware during
that time either, and that 60-second timeout is just silly. It's not
going to help.
Why doesn't the firmware loader class check the error return from the
kobject_uevent()? I'd expect that if that fails, we should just warn
and abort, rather than wait 60 seconds to time out. Greg?
TOTALLY UNTESTED PATCH ATTACHED!
Ciprian - does this get rid of the 60-second wait? Do you get a nice
kernel traceback in your dmesg instead?
> If someone can tell me where Realtek's firmware should be sent to as David
> W. seems to be busy, it will be perfect.
Hmm. Dunno about that.
Linus
[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 625 bytes --]
drivers/base/firmware_class.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8c798ef7f13f..956dd34e59da 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -549,7 +549,8 @@ static int _request_firmware(const struct firmware **firmware_p,
round_jiffies_up(jiffies +
loading_timeout * HZ));
- kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD);
+ if (WARN_ON(kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD)))
+ fw_load_abort(fw_priv);
}
wait_for_completion(&fw_priv->completion);
next prev parent reply other threads:[~2011-04-18 18:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.SOC.4.64.1104150931390.1320@er3.rutgers.edu>
[not found] ` <BANLkTinO+HFq+Mgg1aUz9V==zYs7qSBtDw@mail.gmail.com>
[not found] ` <Pine.SOC.4.64.1104151122330.1320@er3.rutgers.edu>
2011-04-15 16:14 ` Suspend/resume - slow resume Linus Torvalds
2011-04-17 10:17 ` Francois Romieu
2011-04-17 16:42 ` Linus Torvalds
2011-04-18 18:08 ` Francois Romieu
2011-04-18 18:49 ` Linus Torvalds [this message]
2011-04-18 19:25 ` Ben Hutchings
2011-04-18 19:27 ` Ciprian Docan
2011-04-18 19:51 ` Linus Torvalds
2011-04-20 18:16 ` Francois Romieu
2011-04-20 18:51 ` Ciprian Docan
2011-04-20 19:52 ` Francois Romieu
2011-04-20 19:10 ` Ciprian Docan
2011-04-20 19:53 ` Francois Romieu
2011-04-21 2:07 ` Ciprian Docan
2011-04-21 13:02 ` Francois Romieu
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=BANLkTim_1OgqjCeD1a4Ay2fWJSmPHa_XTQ@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=docan@eden.rutgers.edu \
--cc=gregkh@suse.de \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
--cc=romieu@fr.zoreil.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).