public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Shen Guang <shenguang10@gmail.com>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: 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 09:15:48 -0800	[thread overview]
Message-ID: <20140108171548.GA16878@kroah.com> (raw)
In-Reply-To: <CANthSfYiQZXJ46SsbeqSS2eMHMLu7t+NOnCQd87BwvhcYp8aUA@mail.gmail.com>

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?

thanks,

gre k-h

  reply	other threads:[~2014-01-08 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  6:45 [PATCH] usb:hub set hub->change_bits when over-current happens Shen Guang
2014-01-08 17:15 ` Greg KH [this message]
2014-01-08 17:49   ` Alan Stern
2014-01-08 18:19     ` Sarah Sharp
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=20140108171548.GA16878@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --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