public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
	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: Mon, 23 Mar 2009 23:25:02 +0100	[thread overview]
Message-ID: <200903232325.04181.elendil@planet.nl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0903231738300.3610-100000@iolanthe.rowland.org>

On Monday 23 March 2009, Alan Stern wrote:
> > diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
> > index d0a21a5..97ea69b 100644
> > --- a/drivers/usb/core/driver.c
> > +++ b/drivers/usb/core/driver.c
> > @@ -1727,6 +1727,10 @@ int usb_external_resume_device(struct usb_device *udev, pm_message_t msg)
> >     status = usb_resume_both(udev, msg);
> >  	udev->last_busy = jiffies;
> >  	usb_pm_unlock(udev);
> > +
> > +	if (status == -ENODEV)
> > +		return 0;
> > +
> >  	if (status == 0)
> >  		do_unbind_rebind(udev, DO_REBIND);
>
> Please include a short comment explaining the reason for this test
> (i.e., that there's no advantage in producing an error message since
> the regular disconnect messages will be generated shortly).

Will do if there are no other comments.

> 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.

And is -ENODEV safe to ignore in all cases? Would there be other errors that
should be ignored too?

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 ;-)

Thanks,
FJP

  reply	other threads:[~2009-03-23 22:25 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 [this message]
2009-03-24 14:11     ` Alan Stern
2009-06-02 21:26       ` Rafael J. Wysocki
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=200903232325.04181.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --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