mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: gregkh@linuxfoundation.org, mathias.nyman@linux.intel.com,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Bixuan Cui <cuibixuan@huawei.com>, Andrew Lunn <andrew@lunn.ch>,
	Chris Chiu <chris.chiu@canonical.com>,
	Rajat Jain <rajatja@google.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: hub: Resume hubs to find newly connected device
Date: Thu, 9 Dec 2021 11:04:13 -0500	[thread overview]
Message-ID: <YbIo/ZBRgK5NDZJb@rowland.harvard.edu> (raw)
In-Reply-To: <CAAd53p61w-AHBxy05Hx-gwae1rUxZxsaVfmH=--bQUkPxYj8Nw@mail.gmail.com>

On Thu, Dec 09, 2021 at 09:19:24AM +0800, Kai-Heng Feng wrote:
> On Thu, Dec 9, 2021 at 5:45 AM Alan Stern <stern@rowland.harvard.edu> wrote:
> >
> > On Wed, Dec 08, 2021 at 03:08:33PM +0800, Kai-Heng Feng wrote:
> > > When a new USB device gets plugged to nested hubs, the affected hub,
> > > which connects to usb 2-1.4-port2, doesn't report there's any change,
> > > hence the nested hubs go back to runtime suspend like nothing happened:
> >
> > That's a bug in the hub.  When there's a change in the connection status
> > of one of its ports, it should report this change to the kernel.
> 
> I think it should, but when I searched through the USB spec and I
> can't find anywhere specify hub requires to report it in change
> status.

USB-2.0 spec, section 11.24.2.7.2.1 (C_PORT_CONNECTION):

	This bit is set when the PORT_CONNECTION bit changes because of an 
	attach or detach detect event (see Section 7.1.7.3). This bit will be 
	cleared to zero by a ClearPortFeature(C_PORT_CONNECTION) request or 
	while the port is in the Powered-off state.

> > So because of this buggy hub, you now want to wake up _every_ hub in the
> > system whenever any wakeup event occurs?  Is this really a good idea?
> > Is there a better way to solve the problem, such as a special quirk
> > flag?
> 
> If there's no other activities, the USB hub should go back to suspend
> immediately, so the impact is minimal.

Not immediately, but after a few seconds.  However your patch will affect every 
hub, not just the one that the new device was plugged into.

> I've seen several similar bug reports so I think this solution should
> be applied for all hubs.

Maybe those bug reports all had something in common, such as the type of hub or 
the bus speed they were running at.  Did you check?

Alan Stern

  reply	other threads:[~2021-12-09 16:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08  7:08 Kai-Heng Feng
2021-12-08 21:45 ` Alan Stern
2021-12-09  1:19   ` Kai-Heng Feng
2021-12-09 16:04     ` Alan Stern [this message]
2021-12-10  6:06       ` Kai-Heng Feng
2021-12-10 16:27         ` Alan Stern
2021-12-14  5:53           ` Kai-Heng Feng

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=YbIo/ZBRgK5NDZJb@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=chris.chiu@canonical.com \
    --cc=cuibixuan@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=rajatja@google.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®