linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harutyun Khachatryan <kh_harut@mail.ru>
To: Mathias Nyman <mathias.nyman@intel.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: USB list <linux-usb@vger.kernel.org>
Subject: Re: USB bug
Date: Thu, 27 Jun 2019 23:17:18 +0400	[thread overview]
Message-ID: <afe2c5d9-d435-beac-e015-181e0790f465@mail.ru> (raw)
In-Reply-To: <0c3d2bff-0093-2cbc-d16c-a27aa2ef1523@intel.com>

Dear Mathias Nyman,

the commands has actually helped. But it is strange that the system 
behavior has changed, without that command no more usb devices can be 
connected to the machine. Even Seagate HDD after disconnecting was not 
able to be connected again. So only with that commands you had written 
all usb devices was able to work.

Regards, Harutyun Khachatryan

On 6/25/19 3:01 PM, Mathias Nyman wrote:
> On 24.6.2019 21.11, Alan Stern wrote:
>> On Sun, 23 Jun 2019, Harutyun Khachatryan wrote:
>>
>>> Dear Alan Stern,
>>>
>>> I thought that I should wait Mathias's response. I am terribly sorry 
>>> for
>>> that. I am sending dmesg log and trace content as you asked. I tried 
>>> the
>>> procedure on kernel 5.1.12-050112-generic since it's most recent now 
>>> and
>>> the bug still exists in it. If you need for 5.0 write me back. Thank 
>>> you
>>> in advance.
>>>
>>> Regards, Harutyun Khachatryan
>>
>> Mathias, can you please look through the log and trace output that
>> Harutyun sent?  His message doesn't appear to have gotten onto the
>> mailing list, so I have attached copies of his files here.
>>
>> I guess he tried to follow the procedure given in
>>
>>     https://marc.info/?l=linux-usb&m=155293069118478&w=2
>>
>> Namely:
>>
>> Boot with the Seagate HDD attached
>> mount -t debugfs none /sys/kernel/debug
>> echo 'module xhci_hcd =p' >/sys/kernel/debug/dynamic_debug/control
>> echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control
>> echo 81920 > /sys/kernel/debug/tracing/buffer_size_kb
>> echo 1 > /sys/kernel/debug/tracing/events/xhci-hcd/enable
>> <Plug in other USB device>
>> <Wait 10 seconds>
>> <Unplug other USB device>
>> <Unplug the Seagate HDD>
>> <Plug in other USB device>
>> Send output of dmesg
>> Send content of /sys/kernel/debug/tracing/trace
>>
>> The problem is that the other USB device is not detected. Harutyun
>> didn't say at what points in the log the other device was plugged in,
>> or which port it was plugged into.  It looks like the Seagate HDD was
>> plugged into 4-1.
>>
>
> There are no other port events than the disconnect of the 4-1 Seagate HDD
> in the traces: (port link goes to Inactive first, then Disabled)
>
> 153.590150: xhci_handle_port_status: port-0: Powered Not-connected 
> Disabled Link:Inactive PortSpeed:0 Change: CSC PLC Wake
> 153.590130: xhci_handle_event: EVENT: TRB 0000000005000000 status 
> 'Success' len 0 slot 0 ep 0 type 'Port Status Change Event' flags e:C
> 153.590157: xhci_hub_status_data: port-0: Powered Not-connected 
> Disabled Link:Inactive PortSpeed:0 Change: CSC PLC Wake:
> 153.590158: xhci_hub_status_data: port-1: Powered Connected Enabled 
> Link:U2 PortSpeed:4 Change: Wake:
> 153.590160: xhci_hub_status_data: port-2: Powered Not-connected 
> Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> 153.590163: xhci_hub_status_data: port-3: Powered Not-connected 
> Disabled Link:RxDetect PortSpeed:0 Change: Wake:
> ...
> 153.689459: xhci_handle_event: EVENT: TRB 0000000005000000 status 
> 'Success' len 0 slot 0 ep 0 type 'Port Status Change Event' flags e:C
> 153.689477: xhci_handle_port_status: port-0: Powered Not-connected 
> Disabled Link:RxDetect PortSpeed:0 Change: WRC PRC Wake:
> < disabling slot, freeing ring etc here>
>
> After a while the SS bus is suspended, xhci traces show wake flags are
> set for SS roothub ports. Then there's nothing for 12 seconds, after 
> which
> we see a Interrupt URB being handled a few times every a second, probably
> the external hub. Nothing else, no other port activity or traffic is 
> seen.
>
> 154.839474: xhci_hub_status_data: port-0: Powered Not-connected 
> Disabled Link:RxDetect PortSpeed:0 Change: Wake: WCE WOE
> 154.839476: xhci_hub_status_data: port-1: Powered Connected Enabled 
> Link:U2 PortSpeed:4 Change: Wake: WDE WOE
> 154.839478: xhci_hub_status_data: port-2: Powered Not-connected 
> Disabled Link:RxDetect PortSpeed:0 Change: Wake: WCE WOE
> 154.839479: xhci_hub_status_data: port-3: Powered Not-connected 
> Disabled Link:RxDetect PortSpeed:0 Change: Wake: WCE WOE
> 166.604073: xhci_handle_event: EVENT: TRB 000000044dd539c0 status 
> 'Success' len 0 slot 4 ep 3 type 'Transfer Event' flags e:C
> 166.604080: xhci_handle_transfer: INTR: Buffer 000000044dd57000 length 
> 8 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
> 166.604083: xhci_inc_deq: INTR ..
> 166.604086: xhci_urb_giveback: ep1in-intr: urb 0000000046808855 pipe 
> 1077969792 slot 4 length 8/8 sgs 0/0 stream 0 flags 00000204
>
> I can't spot any activity on the HS/FS side of xhci at all, and the SS 
> bus
> (usb4) is suspended here with a device (external hub?) in U2 link state.
> Best guess so far is that it is related to runtime or link power 
> management
> withand the external hub.
>
> Could be related to the SS device with LPM resume issue fixed here:
> https://marc.info/?l=linux-usb&m=156101728630448&w=2
>
> Harutyun Khachatryan, how about disabling runtime power management
> for hubs before disconnecting the Seagate drive, can you check if
> that helps. (as sudo or root, do)
>
> echo on > /sys/bus/usb/devices/usb3/power/control
> echo on > /sys/bus/usb/devices/usb4/power/control
> echo on > /sys/bus/usb/devices/usb3/3-2/power/control
> echo on > /sys/bus/usb/devices/usb4/4-2/power/control
>
> Does it help?
>
> -Mathias

  reply	other threads:[~2019-06-27 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44L0.1906241349270.1609-300000@iolanthe.rowland.org>
2019-06-25 11:01 ` USB bug Mathias Nyman
2019-06-27 19:17   ` Harutyun Khachatryan [this message]
     [not found] <0de30c70-76b0-863c-98c5-2a465d1ef399@mail.ru>
2019-06-22  0:48 ` 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=afe2c5d9-d435-beac-e015-181e0790f465@mail.ru \
    --to=kh_harut@mail.ru \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.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;
as well as URLs for NNTP newsgroup(s).