From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>, Frans Pop <elendil@planet.nl>
Cc: linux-usb@vger.kernel.org, linux-pm@lists.linux-foundation.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: avoid PM error messages during resume if a device was disconnected
Date: Tue, 2 Jun 2009 23:26:33 +0200 [thread overview]
Message-ID: <200906022326.34491.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0903241004160.3162-100000@iolanthe.rowland.org>
First, sorry for the delayed response. Frans has just reminded me about this
thread.
On Tuesday 24 March 2009, Alan Stern wrote:
> On Mon, 23 Mar 2009, Frans Pop wrote:
>
> > > Or do you think maybe it would be better to move this test up into the
> > > PM core? After all, other subsystems will face the same issue. I
> > > think that would be the best approach. Yes?
> >
> > I did look at that option, but implementing it in the USB subsystem seemed
> > more logical to me, for example as other subsystems possibly would want to
> > display an info message.
>
> They still can...
>
> > And is -ENODEV safe to ignore in all cases? Would there be other errors that
> > should be ignored too?
>
> In general, the PM core ignores _all_ errors during resume -- in the
> sense that it doesn't try to recover from them or do anything to handle
> them. All it does is put a message in the log.
>
> So your question becomes: For which errors should a message be added to
> the system log? The most logical answer seems to be that we want an
> error message whenever something bad or unexpected occurs.
>
> Removal of a hot-unpluggable device isn't really bad or unexpected.
> Removal of a non-hot-unpluggable device might be bad, but on the other
> hand the system isn't really "hot" while it is suspended. Besides, the
> appropriate subsystem can print an error message. Furthermore the
> kernel can't easily tell which devices are hot-unpluggable and which
> aren't.
>
> Anything else amounts to failure resuming a device that still exists.
> As such, it probably deserves an error message.
Returning 0 from usb_external_resume_device() if the device is not present
any more doesn't seem wrong. It's not really an error condition, IMO, because
it's rather normal that the devices may be removed while suspended.
OTOH, I don't think we can ignore -ENODEV universally in the core, because
its meaning may depend on the bus type. For example, for PCI it sometimes
means a hardware problem has occured (other than the device being not present
any more).
> > if Rafael would be happy with a generic test for -ENODEV, it could be done.
> > If not, maybe some other special error code would need to be used but then
> > you'd still need to test in the subsystem to set that error.
> > Disadvantage is also that it would make resume_device() and related PM
> > driver core functions quite a bit less clean than they currently are.
> >
> > Implementing the test in USB was quite a bit simpler (for me at least ;-)
>
> We should get Rafael's opinion.
I'd vote in favor of the Frans' patch, at least for now.
So, Frans, please resubmit with the changelog modified as requested by Alan.
Best,
Rafael
next prev parent reply other threads:[~2009-06-02 21:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 21:11 [PATCH] usb: avoid PM error messages during resume if a device was disconnected Frans Pop
2009-03-23 21:30 ` Frans Pop
2009-03-23 21:44 ` Alan Stern
2009-03-23 22:25 ` Frans Pop
2009-03-24 14:11 ` Alan Stern
2009-06-02 21:26 ` Rafael J. Wysocki [this message]
2009-06-02 21:48 ` Alan Stern
2009-06-02 22:26 ` [PATCH v2] " Frans Pop
2009-06-02 22:53 ` Rafael J. Wysocki
2009-06-03 0:57 ` Alan Stern
2009-06-03 8:08 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2009-06-04 20:30 [PATCH] USB: Avoid " Rafael J. Wysocki
2009-06-04 21:02 ` Greg KH
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=200906022326.34491.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=elendil@planet.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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