mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Shen Guang <shenguang10@gmail.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb:hub set hub->change_bits when over-current happens
Date: Wed, 8 Jan 2014 10:19:14 -0800	[thread overview]
Message-ID: <20140108181914.GB14082@xanatos> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401081249370.1659-100000@iolanthe.rowland.org>

On Wed, Jan 08, 2014 at 12:49:57PM -0500, Alan Stern wrote:
> On Wed, 8 Jan 2014, Greg KH wrote:
> 
> > On Wed, Jan 08, 2014 at 02:45:42PM +0800, Shen Guang wrote:
> > > When we are doing compliance test with xHCI, we found that if we
> > > enable CONFIG_USB_SUSPEND and plug in a bad device which causes
> > > over-current condition to the root port, software will not be noticed.
> > > The reason is that current code don't set hub->change_bits in
> > > hub_activate() when over-current happens, and then hub_events() will
> > > not check the port status because it thinks nothing changed.
> > > If CONFIG_USB_SUSPEND is disabled, the interrupt pipe of the hub will
> > > report the change and set hub->event_bits, and then hub_events() will
> > > check what events happened.In this case over-current can be detected.
> > > 
> > > Signed-off-by: Shen Guang <shenguang10@gmail.com>
> > > ---
> > >  drivers/usb/core/hub.c |    3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > > index bd9dc35..98b5679 100644
> > > --- a/drivers/usb/core/hub.c
> > > +++ b/drivers/usb/core/hub.c
> > > @@ -1154,7 +1154,8 @@ static void hub_activate(struct usb_hub *hub,
> > > enum hub_activation_type type)
> > >                         /* Tell khubd to disconnect the device or
> > >                          * check for a new connection
> > >                          */
> > > -                       if (udev || (portstatus & USB_PORT_STAT_CONNECTION))
> > > +                       if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
> > > +                               (portstatus & USB_PORT_STAT_OVERCURRENT))
> > >                                 set_bit(port1, hub->change_bits);
> > > 
> > >                 } else if (portstatus & USB_PORT_STAT_ENABLE) {
> > > --
> > > 1.7.9.5
> > 
> > Alan and Sarah, any objection to this patch?
> 
> It seems okay to me.
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Looks fine to me as well.

Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>

  reply	other threads:[~2014-01-08 18:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  6:45 Shen Guang
2014-01-08 17:15 ` Greg KH
2014-01-08 17:49   ` Alan Stern
2014-01-08 18:19     ` Sarah Sharp [this message]
2014-03-19 13:03       ` Yuvaraj Cd
  -- strict thread matches above, loose matches on Subject: below --
2014-01-07  2:33 沈光
2014-01-07  2:40 ` Greg KH
2014-01-07  3:35   ` 沈光
2014-01-07  3:53     ` Greg KH
2014-01-07  6:38       ` Shen Guang
2014-01-07 15:25         ` 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=20140108181914.GB14082@xanatos \
    --to=sarah.a.sharp@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shenguang10@gmail.com \
    --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

all inboxes | Powered by JetHome®