From: Takashi Iwai <tiwai@suse.de>
To: Ming Lei <ming.lei@canonical.com>
Cc: linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 1/3] firmware: Avoid superfluous usermodehelper lock
Date: Sun, 12 May 2013 09:20:47 +0200 [thread overview]
Message-ID: <s5hy5bkwto0.wl%tiwai@suse.de> (raw)
In-Reply-To: <CACVXFVPo7ED5fo1+FT=ibM_HvB2h1Vc7P2e+C_LHGw-BQ9e-tA@mail.gmail.com>
At Sat, 11 May 2013 21:01:27 +0800,
Ming Lei wrote:
>
> On Fri, May 10, 2013 at 5:32 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Fri, 10 May 2013 09:25:51 +0800,
> >>
> >> Anyway, if you want to force killing loader, please only kill these
> >> FW_ACTION_NOHOTPLUG before suspend and reboot, and do
> >> not touch FW_ACTION_HOTPLUG. Is it OK for you?
> >
> > Note that, as with my patch, only the shutdown case is handled. Let's
> > not mixing up suspend and shutdown behavior for now.
> >
> > I see no reason why we need to wait at shutdown even for
> > FW_ACTION_HOTPLUG. At that point, there should be no longer
> > user-space action. It means that the driver shouldn't get any more
> > data to finish the f/w loading upon that point. Thus the only
>
> For example, when one ethernet driver is requesting its firmware,
> the loader is forced to be killed before shutdown, so the driver can't set the
> WoL any more in its shutdown(), then users start to complain it is a
> regression.
First off, this can't happen because, as mentioned earlier, the point
we're discussing is already the moment after user-space is supposed to
have been finished by init, i.e. there is already no udev. Thus the
pending f/w request via usermode helper can never finish. So, it
makes no sense to wait for any user-space action at that point. It
just locks up.
Secondly, if this would ever work, it's still just a luck. The
protection is only about the usermode helper lock in the f/w loading
code. This doesn't mean that the whole pending driver work would be
finished. In other words, such a driver design is just broken.
> That is why I suggest you to only kill requests of FW_ACTION_NOHOTPLUG.
>
> Also it isn't good to affect all drivers just for fixing two insane drivers.
>
> > possible consequence is the timeout, which is equivalent with the
> > immediate abort of the operation.
> >
> > As mentioned earlier, the suspend behavior may be different. We want
> > to retry the f/w load. Ideally, the f/w loader should abort and
> > automatically retry after resume. In this case, also there is no big
>
> I don't think it is good idea since suspend() may need firmware to
> change the device's power state. Considered that only two insane
> drivers use FW_ACTION_NOHOTPLUG, we can kill the two before
> suspend just like the case of shutdown.
The same argument can be applied. The protection in f/w loading
doesn't guarantee that the pending driver action will be finished
before suspend. It protects only the udev reaction. But, it doesn't
protect the action after it.
> > reason to distinguish FW_ACTION_* types. Even for udev case, the
> > action can be easily retried.
> >
> > Or, a cleaner solution would be to get rid of FW_ACTION_NOHOTPLUG
> > completely. As Kay mentioned, this was a big mistake from the very
>
> It is still not a good idea, hackers may need FW_ACTION_NOHOTPLUG
> to debug its driver with private firmwares, or examples like dell's BIOS update.
Oh no, it's a badly designed interface. It should be never used.
Takashi
next prev parent reply other threads:[~2013-05-12 7:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 6:56 [PATCH 0/3] firmware: Fix usermodehelper deadlock at shutdown Takashi Iwai
2013-05-08 6:56 ` [PATCH 1/3] firmware: Avoid superfluous usermodehelper lock Takashi Iwai
2013-05-08 15:52 ` Ming Lei
2013-05-08 16:21 ` Takashi Iwai
2013-05-08 16:37 ` Takashi Iwai
2013-05-08 17:51 ` Takashi Iwai
2013-05-09 1:25 ` Ming Lei
2013-05-09 7:31 ` Takashi Iwai
2013-05-09 8:43 ` Ming Lei
2013-05-09 17:04 ` Takashi Iwai
2013-05-10 1:25 ` Ming Lei
2013-05-10 9:32 ` Takashi Iwai
2013-05-11 13:01 ` Ming Lei
2013-05-12 7:20 ` Takashi Iwai [this message]
2013-05-12 13:32 ` Ming Lei
2013-05-13 14:48 ` Takashi Iwai
2013-05-12 13:59 ` Ming Lei
2013-05-13 15:04 ` Takashi Iwai
2013-05-08 6:56 ` [PATCH 2/3] firmware: Avoid deadlock of usermodehelper lock at shutdown Takashi Iwai
2013-05-08 15:56 ` Ming Lei
2013-05-08 16:15 ` Takashi Iwai
2013-05-09 1:19 ` Ming Lei
2013-05-09 7:34 ` Takashi Iwai
2013-05-08 6:56 ` [PATCH 3/3] dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly Takashi Iwai
2013-05-08 15:42 ` [PATCH 0/3] firmware: Fix usermodehelper deadlock at shutdown Greg Kroah-Hartman
2013-05-08 15:48 ` Takashi Iwai
2013-05-08 15:59 ` Ming Lei
2013-05-08 16:07 ` Ming Lei
2013-05-08 16:26 ` Takashi Iwai
2013-05-08 18:46 ` Kay Sievers
2013-05-09 7:26 ` Takashi Iwai
2013-05-21 17:02 ` Greg Kroah-Hartman
2013-05-22 1:21 ` Ming Lei
2013-05-22 16:25 ` Takashi Iwai
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=s5hy5bkwto0.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@canonical.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
all inboxes | Powered by JetHome®