linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Zimmerman <pauldzim@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	David Heinzelmann <heinzelmann.david@gmail.com>,
	<linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>
Subject: Re: [REGRESSION][BISECTED] 5.5-rc suspend/resume failure caused by patch a4f55d8b8c14 ("usb: hub: Check device descriptor before resusciation")
Date: Wed, 22 Jan 2020 16:54:54 -0700	[thread overview]
Message-ID: <20200122165454.757aaa25@EliteBook> (raw)
In-Reply-To: <Pine.LNX.4.44L0.2001221249190.1636-100000@iolanthe.rowland.org>

On Wed, 22 Jan 2020 14:31:29 -0500 (EST)
Alan Stern <stern@rowland.harvard.edu> wrote:

> On Tue, 21 Jan 2020, Paul Zimmerman wrote:
> 
> > On Mon, 20 Jan 2020 13:52:15 -0700 Paul Zimmerman <pauldzim@gmail.com> wrote:
> >   
> > > On Mon, 20 Jan 2020 10:23:11 -0500 (EST) Alan Stern <stern@rowland.harvard.edu> wrote:
> > >     
> > > > On Sun, 19 Jan 2020, Paul Zimmerman wrote:
> > > >       
> > > > > I reported this regression last week (see
> > > > > https://lore.kernel.org/linux-usb/20200115153714.03d5b3aa@EliteBook/T/#u)
> > > > > but I got no response to my email. Today I have retested with
> > > > > 5.5-rc7 and verified that the problem still exists. So I am
> > > > > resending with a different subject line to see if anyone responds.
> > > > > 
> > > > > The $subject patch causes a regression on my HP EliteBook laptop
> > > > > with a built-in USB bluetooth adapter. About 50% of the time, a
> > > > > suspend/resume cycle will cause the bluetooth adapter to stop
> > > > > working.
> > > > > 
> > > > > The dmesg log below shows two suspend/resume cycles. At time
> > > > > 63.928 you can see the bluetooth adapter being successfully
> > > > > resumed, and at time 140.969 you can see it fail. After reverting
> > > > > the patch, the bluetooth adapter resumes 100% of the time.
> > > > > 
> > > > > I also included below a lsusb -v of the bluetooth adapter. Is
> > > > > there any other debugging info you'd like me to send?        
> > > > 
> > > > It looks like your dmesg log was made without enabling debugging 
> > > > messages in usbcore.  Can you collect another log with debugging 
> > > > messages turned on?
> > > > 
> > > > 	echo 'module usbcore =p'      
> > > > >/sys/kernel/debug/dynamic_debug/control      
> > > > 
> > > > Also, it might not hurt to collect and post a usbmon trace for a bad
> > > > suspend-resume cycle.      
> > > 
> > > Hi Alan,
> > > 
> > > Thanks for responding. The new dmesg log and the usbmon trace are
> > > below. The dmesg shows a good suspend/resume followed by a bad one.
> > > The bluetooth device is usb 2-3.2 I believe. The usbmon trace is only
> > > for the failed suspend/resume case.    
> 
> It might be interesting to have a usbmon trace of a successful resume 
> as well, for comparison.  However I suspect it would just show that 
> the new Get-Device-Descriptor request worked and everything else 
> continued on normally.

< snip >

> > So if I'm understanding this correctly, there are two threads that are
> > trying to access the USB bluetooth device at the same time. I have no
> > idea if that is how it's supposed to work.  
> 
> In fact it isn't, although in principle this shouldn't cause any
> trouble.  It looks like your bluetooth device is deficient: It
> sometimes crashes if it receives a Get-Device-Descriptor request while
> it is busy with something else.
> 
> Still, since there was no real connection change at the port, there's
> no reason to call hub_port_connect_change() here.  Let's see if the
> patch below fixes your problem.
> 
> Alan Stern
> 
> 
> 
> Index: usb-devel/drivers/usb/core/hub.c
> ===================================================================
> --- usb-devel.orig/drivers/usb/core/hub.c
> +++ usb-devel/drivers/usb/core/hub.c
> @@ -1216,11 +1216,6 @@ static void hub_activate(struct usb_hub
>  #ifdef CONFIG_PM
>  			udev->reset_resume = 1;
>  #endif
> -			/* Don't set the change_bits when the device
> -			 * was powered off.
> -			 */
> -			if (test_bit(port1, hub->power_bits))
> -				set_bit(port1, hub->change_bits);
>  
>  		} else {
>  			/* The power session is gone; tell hub_wq */
> 

I can confirm this fixes the issue for me, I did a couple dozen
suspend/resume cycles without seeing a failure.

I see the code you removed was added by Lan Tianyu in commit
ad493e5e5805 ("usb: add usb port auto power off mechanism"). I
wonder if your patch would break that? I don't know what that is
or how to test it.

In any case:
Tested-by: Paul Zimmerman <pauldzim@gmail.com>

  reply	other threads:[~2020-01-22 23:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22  2:31 [REGRESSION][BISECTED] 5.5-rc suspend/resume failure caused by patch a4f55d8b8c14 ("usb: hub: Check device descriptor before resusciation") Paul Zimmerman
2020-01-22 19:31 ` Alan Stern
2020-01-22 23:54   ` Paul Zimmerman [this message]
2020-01-23 15:50     ` Alan Stern
2020-01-30 21:16       ` Paul Zimmerman
2020-01-31 15:37         ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2020-01-15 22:37 Regression caused by patch a4f55d8b8c14 "usb: hub: Check device descriptor before resusciation" Paul Zimmerman
2020-01-20  4:11 ` [REGRESSION][BISECTED] 5.5-rc suspend/resume failure caused by patch a4f55d8b8c14 ("usb: hub: Check device descriptor before resusciation") Paul Zimmerman
2020-01-20 15:23   ` Alan Stern
2020-01-20 20:52     ` Paul Zimmerman

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=20200122165454.757aaa25@EliteBook \
    --to=pauldzim@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heinzelmann.david@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).