All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Yiyu Zhu <danielzeltar@gmail.com>, Greg KH <greg@kroah.com>,
	linux-usb@vger.kernel.org
Subject: Re: kworker takes 100% core after unplugging usb c hub
Date: Thu, 4 Mar 2021 11:33:49 -0500	[thread overview]
Message-ID: <20210304163349.GC1612307@rowland.harvard.edu> (raw)
In-Reply-To: <546b9137-3054-4cb3-b085-e0ea32885e8a@linux.intel.com>

On Thu, Mar 04, 2021 at 06:31:47PM +0200, Mathias Nyman wrote:
> Hi
> 
> On 2.3.2021 8.25, Yiyu Zhu wrote:
> > Hi Mathias,
> > 
> > I did not set the correct printk value. Here is a recent dmesg showing
> > the hub connection and disconnection on Linux 5.11.0.
> > 
> ...
> > [ 1662.620564] usb usb3: usb wakeup-resume
> > [ 1662.620570] usb usb3: usb auto-resume
> > [ 1662.620585] hub 3-0:1.0: hub_resume
> > [ 1662.620607] hub 3-0:1.0: state 7 ports 2 chg 0002 evt 0000
> > [ 1662.620637] usb usb3-port1: over-current change #1
> > [ 1662.724578] hub 3-0:1.0: trying to enable port power on non-switchable hub
> > [ 1662.832221] usb usb3-port1: over-current condition
> > [ 1662.832237] usb usb3-port1: status 0008, change 0008, 12 Mb/s
> > [ 1662.832262] hub 3-0:1.0: state 7 ports 2 chg 0000 evt 0000
> > [ 1662.832277] hub 3-0:1.0: hub_suspend
> > [ 1662.832297] usb usb3: bus auto-suspend, wakeup 1
> > [ 1662.832307] usb usb3: bus suspend fail, err -16
> > [ 1662.832313] hub 3-0:1.0: hub_resume
> > [ 1662.832344] hub 3-0:1.0: state 7 ports 2 chg 0002 evt 0000
> > [ 1662.832363] usb usb3-port1: status 0008, change 0000, 12 Mb/s
> > [ 1662.832375] hub 3-0:1.0: hub_suspend
> > [ 1662.832388] usb usb3: bus auto-suspend, wakeup 1
> > [ 1662.832397] usb usb3: bus suspend fail, err -16
> > [ 1662.832402] hub 3-0:1.0: hub_resume
> (removed some messages from other buses from above snippet)
> 
> Looks like the suspend/resume loop is triggered by an over-current event.
> hub wq notices there is a over-current change, and an over-current status (two separate bits)
> hub wq clears the change bit, tries to resolve the over-current, fails, and continues.
> 
> This hub (roothub) has no other children or activity so it runtime suspends.
> After this the bus tries to suspend, but it fails as xhci bus_suspend() 
> returns -EBUSY if a port is in over-current state.
> 
> Hub is woken up. hub wq runs, this time there is no over-current change
> bit set as it was cleared earlier. The over-current status is still active. 
> Hub wq doesn't see any activity, hub is suspended -> try to suspend bus -> fail...
> 
> Solution is still unclear, maybe hub wq should react to over-current states,
> not just changes?

Your analysis seems to point to a hardware problem.  If nothing is 
plugged into the root hub, it should not report an over-current state.

Alan Stern

  reply	other threads:[~2021-03-04 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11  2:31 kworker takes 100% core after unplugging usb c hub Yiyu Zhu
2021-02-11  6:47 ` Greg KH
2021-02-11 10:10   ` Yiyu Zhu
2021-02-11 10:37     ` Greg KH
2021-02-11 22:11       ` Yiyu Zhu
2021-02-16 15:46         ` Mathias Nyman
2021-02-17  8:50           ` Yiyu Zhu
2021-02-19  9:44             ` Mathias Nyman
2021-03-02  6:25               ` Yiyu Zhu
2021-03-04 16:31                 ` Mathias Nyman
2021-03-04 16:33                   ` Alan Stern [this message]
2021-03-05  9:04                     ` Mathias Nyman
2021-03-05 15:35                       ` Alan Stern

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=20210304163349.GC1612307@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=danielzeltar@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.