All of lore.kernel.org
 help / color / mirror / Atom feed
* ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
@ 2021-07-13 18:19 Hylke Hellinga
  2021-07-13 18:42 ` Alan Stern
  0 siblings, 1 reply; 9+ messages in thread
From: Hylke Hellinga @ 2021-07-13 18:19 UTC (permalink / raw)
  To: linux-usb

Hey there,

For my desktop setup I have a usb kvm switch ordered from amazon.
Found here:
https://www.amazon.com/Switcher-Selector-Computers-Keyboard-Compatbile/dp/B082K87B87/ref=sr_1_6?dchild=1&keywords=usb+switch&qid=1626199073&sr=8-6

I've got 3 usb devices attached to this switch. A full speed ROG
Claymore keyboard, a full speed Roccat Tyon mouse, and a full speed
Arctis 5 headset.
Whenever I have this switch connected and I'm on my gentoo linux
system with kernel:

Linux 5.12.9-gentoo-x86_64 #1 SMP Mon Jul 5 03:11:12 CEST 2021 x86_64
AMD Ryzen 9 3950X 16-Core Processor AuthenticAMD GNU/Linux

It is randomly disconnecting and connecting my devices.
So I figured this would be a power issue, where the usb port of my
desktop is drawing not enough power for the supported devices.

The switch comes with a 5v micro usb power interface. I have this
micro usb connected to a 5v power adapter at all times in a separate
power socket.

This problem does not occur on proprietary operating systems such as
Windows 10 and Mac OS X on the same hardware.
Which has led me to believe that perhaps this has to do with the USB
chipset drivers for my motherboard in the linux kernel.

Underneath is my dmesg log that will display the following entries at the end:
[ 5620.383044] usb 1-7.2: reset full-speed USB device number 7 using xhci_hcd
[ 5649.905700] usb 1-7.3: reset full-speed USB device number 9 using xhci_hcd

https://gist.github.com/Simbaclaws/3cde9ea6732b1db151e69a71c1978965

Here is my lspci output:

https://gist.github.com/Simbaclaws/b88b7d0e2fd7609af1cf579527b6326f

I think the one that is causing issues is:
04:00.0 USB controller: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller

The motherboard that I am using is a Crosshair VI Hero, I doubt that
the motherboard hardware is the issue here, since these issues don't
seem to apply to other operating systems.

Are there any further steps I can take to diagnose this issue any further?
Perhaps I can debug the kernel that I'm using somehow?

I'm not that familiar with C code, the best I can do is write some
small patches for DWM. Just so you get a feeling of what my current
expertise is at in this regard.

Please help me fix this annoying bug, since it is literally
disconnecting my keyboard every random amount of seconds causing me to
have a hard time on linux.


Let me know if this is the right place to ask these kind of things.
I've never reported a kernel issue before.


Yours sincerely,
Hylke Hellinga,
Simbaclaws

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
  2021-07-13 18:19 ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets Hylke Hellinga
@ 2021-07-13 18:42 ` Alan Stern
       [not found]   ` <CABUoX8sNbLuG0FB2_VtH14KhuBoRFB19a2V3cpgzdNDqiVUULA@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2021-07-13 18:42 UTC (permalink / raw)
  To: Hylke Hellinga; +Cc: linux-usb

On Tue, Jul 13, 2021 at 08:19:23PM +0200, Hylke Hellinga wrote:
> Hey there,
> 
> For my desktop setup I have a usb kvm switch ordered from amazon.
> Found here:
> https://www.amazon.com/Switcher-Selector-Computers-Keyboard-Compatbile/dp/B082K87B87/ref=sr_1_6?dchild=1&keywords=usb+switch&qid=1626199073&sr=8-6
> 
> I've got 3 usb devices attached to this switch. A full speed ROG
> Claymore keyboard, a full speed Roccat Tyon mouse, and a full speed
> Arctis 5 headset.

Oddly, the log you provided indicates that the ROCCAT mouse could run 
at high speed but it running only at full speed.  No obvious reason 
why.

> Whenever I have this switch connected and I'm on my gentoo linux
> system with kernel:
> 
> Linux 5.12.9-gentoo-x86_64 #1 SMP Mon Jul 5 03:11:12 CEST 2021 x86_64
> AMD Ryzen 9 3950X 16-Core Processor AuthenticAMD GNU/Linux
> 
> It is randomly disconnecting and connecting my devices.
> So I figured this would be a power issue, where the usb port of my
> desktop is drawing not enough power for the supported devices.
> 
> The switch comes with a 5v micro usb power interface. I have this
> micro usb connected to a 5v power adapter at all times in a separate
> power socket.
> 
> This problem does not occur on proprietary operating systems such as
> Windows 10 and Mac OS X on the same hardware.
> Which has led me to believe that perhaps this has to do with the USB
> chipset drivers for my motherboard in the linux kernel.
> 
> Underneath is my dmesg log that will display the following entries at the end:
> [ 5620.383044] usb 1-7.2: reset full-speed USB device number 7 using xhci_hcd
> [ 5649.905700] usb 1-7.3: reset full-speed USB device number 9 using xhci_hcd
> 
> https://gist.github.com/Simbaclaws/3cde9ea6732b1db151e69a71c1978965
> 
> Here is my lspci output:
> 
> https://gist.github.com/Simbaclaws/b88b7d0e2fd7609af1cf579527b6326f
> 
> I think the one that is causing issues is:
> 04:00.0 USB controller: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller

Actually it's the 02:00.0 controller (the one connected to USB buses 
1 and 2).

> The motherboard that I am using is a Crosshair VI Hero, I doubt that
> the motherboard hardware is the issue here, since these issues don't
> seem to apply to other operating systems.
> 
> Are there any further steps I can take to diagnose this issue any further?
> Perhaps I can debug the kernel that I'm using somehow?

You can collect a usbmon trace showing the problem:

	cat /sys/kernel/debug/usb/usbmon/1u >usbmon.txt

Let the trace run long enough to encounter two or three of these 
resets, then kill the "cat" process and post the output file.

> I'm not that familiar with C code, the best I can do is write some
> small patches for DWM. Just so you get a feeling of what my current
> expertise is at in this regard.
> 
> Please help me fix this annoying bug, since it is literally
> disconnecting my keyboard every random amount of seconds causing me to
> have a hard time on linux.
> 
> 
> Let me know if this is the right place to ask these kind of things.
> I've never reported a kernel issue before.

Yes, this mailing list is absolutely the right place to report such 
issues.

Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
       [not found]     ` <CABUoX8sT_=8aUdzhphwJXnRN2m_cKuJrDi1MtOrkaCTThT0wmA@mail.gmail.com>
@ 2021-07-13 20:30       ` Hylke Hellinga
  2021-07-14 14:54         ` Alan Stern
  0 siblings, 1 reply; 9+ messages in thread
From: Hylke Hellinga @ 2021-07-13 20:30 UTC (permalink / raw)
  To: Alan Stern, linux-usb

Dear Alan,

Thank you.

I've just created the usbmon trace. It's fairly large due to it taking
quite some time before the bug appears.
I'm guessing it also has a lot of output due to the mouse moving x and
y and me typing?

It can be viewed here:
https://gist.github.com/Simbaclaws/70014d584d96dc0ac4920dffb1996583

Sorry for the somewhat late reply. Was helping someone on irc.

Please let me know if this can help debug the issue.

Sorry for the previous mails that I've send to you personally.
I didn't notice linux-usb@vger.kernel.org was not in the cc.
I'm also a bit new to mailing lists.

I've removed the previous messages and added this message to the
linux-usb kernel mailing archive for further reference.

Hylke Hellinga
Software Engineer

> Op di 13 jul. 2021 om 20:42 schreef Alan Stern <stern@rowland.harvard.edu>:
> >
> > On Tue, Jul 13, 2021 at 08:19:23PM +0200, Hylke Hellinga wrote:
> > > Hey there,
> > >
> > > For my desktop setup I have a usb kvm switch ordered from amazon.
> > > Found here:
> > > https://www.amazon.com/Switcher-Selector-Computers-Keyboard-Compatbile/dp/B082K87B87/ref=sr_1_6?dchild=1&keywords=usb+switch&qid=1626199073&sr=8-6
> > >
> > > I've got 3 usb devices attached to this switch. A full speed ROG
> > > Claymore keyboard, a full speed Roccat Tyon mouse, and a full speed
> > > Arctis 5 headset.
> >
> > Oddly, the log you provided indicates that the ROCCAT mouse could run
> > at high speed but it running only at full speed.  No obvious reason
> > why.
> >
> > > Whenever I have this switch connected and I'm on my gentoo linux
> > > system with kernel:
> > >
> > > Linux 5.12.9-gentoo-x86_64 #1 SMP Mon Jul 5 03:11:12 CEST 2021 x86_64
> > > AMD Ryzen 9 3950X 16-Core Processor AuthenticAMD GNU/Linux
> > >
> > > It is randomly disconnecting and connecting my devices.
> > > So I figured this would be a power issue, where the usb port of my
> > > desktop is drawing not enough power for the supported devices.
> > >
> > > The switch comes with a 5v micro usb power interface. I have this
> > > micro usb connected to a 5v power adapter at all times in a separate
> > > power socket.
> > >
> > > This problem does not occur on proprietary operating systems such as
> > > Windows 10 and Mac OS X on the same hardware.
> > > Which has led me to believe that perhaps this has to do with the USB
> > > chipset drivers for my motherboard in the linux kernel.
> > >
> > > Underneath is my dmesg log that will display the following entries at the end:
> > > [ 5620.383044] usb 1-7.2: reset full-speed USB device number 7 using xhci_hcd
> > > [ 5649.905700] usb 1-7.3: reset full-speed USB device number 9 using xhci_hcd
> > >
> > > https://gist.github.com/Simbaclaws/3cde9ea6732b1db151e69a71c1978965
> > >
> > > Here is my lspci output:
> > >
> > > https://gist.github.com/Simbaclaws/b88b7d0e2fd7609af1cf579527b6326f
> > >
> > > I think the one that is causing issues is:
> > > 04:00.0 USB controller: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller
> >
> > Actually it's the 02:00.0 controller (the one connected to USB buses
> > 1 and 2).
> >
> > > The motherboard that I am using is a Crosshair VI Hero, I doubt that
> > > the motherboard hardware is the issue here, since these issues don't
> > > seem to apply to other operating systems.
> > >
> > > Are there any further steps I can take to diagnose this issue any further?
> > > Perhaps I can debug the kernel that I'm using somehow?
> >
> > You can collect a usbmon trace showing the problem:
> >
> >         cat /sys/kernel/debug/usb/usbmon/1u >usbmon.txt
> >
> > Let the trace run long enough to encounter two or three of these
> > resets, then kill the "cat" process and post the output file.
> >
> > > I'm not that familiar with C code, the best I can do is write some
> > > small patches for DWM. Just so you get a feeling of what my current
> > > expertise is at in this regard.
> > >
> > > Please help me fix this annoying bug, since it is literally
> > > disconnecting my keyboard every random amount of seconds causing me to
> > > have a hard time on linux.
> > >
> > >
> > > Let me know if this is the right place to ask these kind of things.
> > > I've never reported a kernel issue before.
> >
> > Yes, this mailing list is absolutely the right place to report such
> > issues.
> >
> > Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
  2021-07-13 20:30       ` Hylke Hellinga
@ 2021-07-14 14:54         ` Alan Stern
       [not found]           ` <CABUoX8uUhW4bdUZ6Roo=jEn=3UwUq2QVAMPcnyg8rbLzua09=w@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2021-07-14 14:54 UTC (permalink / raw)
  To: Hylke Hellinga; +Cc: linux-usb

On Tue, Jul 13, 2021 at 10:30:48PM +0200, Hylke Hellinga wrote:
> Dear Alan,
> 
> Thank you.
> 
> I've just created the usbmon trace. It's fairly large due to it taking
> quite some time before the bug appears.
> I'm guessing it also has a lot of output due to the mouse moving x and
> y and me typing?
> 
> It can be viewed here:
> https://gist.github.com/Simbaclaws/70014d584d96dc0ac4920dffb1996583
> 
> Sorry for the somewhat late reply. Was helping someone on irc.
> 
> Please let me know if this can help debug the issue.

The usbmon trace contains a lot of -71 errors.  In general, errors of 
this type arise because the device's firmware has crashed (apparently 
not the case here, since the mouse continued to work okay), or because 
of interference caused by a bad cable or something similar.  Perhaps 
caused by the KVM switch itself.

The fact that the log says the mouse connected at full speed rather than 
high speed also indicates some sort of signal-related problem.

Have you tried doing an experiment where you plug the mouse directly 
into the computer rather than going through the switch?

Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
       [not found]           ` <CABUoX8uUhW4bdUZ6Roo=jEn=3UwUq2QVAMPcnyg8rbLzua09=w@mail.gmail.com>
@ 2021-07-14 18:05             ` Alan Stern
       [not found]               ` <CABUoX8vWDRtr4hiVOEkT48=doG8xbAVD65Hve0QByLJpV0JsqQ@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2021-07-14 18:05 UTC (permalink / raw)
  To: Hylke Hellinga; +Cc: linux-usb

On Wed, Jul 14, 2021 at 07:39:51PM +0200, Hylke Hellinga wrote:
> Yes, I did.
> 
> I've connected both the mouse, keyboard and headset to the pc and it would
> function normally. I know it has to do with the switch itself. But I have
> no idea how to fix it.

When you connect the mouse directly to the PC, does it still run at full 
speed or does it go up to high speed?

> The switch works fine under windows and macos, and it is even advertised to
> work under linux. But you never know with amazon products whether that is
> actually the case.

Do you have any other Linux computers you can try the switch with?  Or 
USB ports on your computer connected to a different host controller?

> I don't have a different usb switch I can test. I've tried different input
> usb cables as well. The usb cable coming from the switch going into my
> computer is pretty long.

Well, maybe a shorter cable would help.  But basically, I have no idea 
how to fix it either.  A possible workaround would be to make the usbhid 
driver ignore all the errors coming from the mouse instead of resetting 
it, but such a change would not be generally acceptable for the kernel.

It ought to be possible to get the equivalent of a usbmon trace under 
Windows or Mac OS, using Wireshark.  That would at least show if the 
same errors occur in those settings, and if they do, how the operating 
systems deal with them.

To track down the problem any further would require a more detailed 
knowledge of the USB support in Windows or Mac OS (which I don't have) 
and/or some rather expensive USB bus analyzer hardware.  It would be 
cheaper and quicker just to get a different brand of switch.  :-(

Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
       [not found]               ` <CABUoX8vWDRtr4hiVOEkT48=doG8xbAVD65Hve0QByLJpV0JsqQ@mail.gmail.com>
@ 2021-07-14 18:19                 ` Hylke Hellinga
  2021-07-14 19:02                   ` Hylke Hellinga
  0 siblings, 1 reply; 9+ messages in thread
From: Hylke Hellinga @ 2021-07-14 18:19 UTC (permalink / raw)
  To: linux-usb

What I find odd is that the switch works fine on my pop os linux
installation on my laptop.

I've already tried connecting it to a different usb port on the same
computer. Without luck...

How would I go about making the usbhid driver ignore the mouse issues?

When I unplug the mouse from the switch, and have only the keyboard
connected, it still randomly disconnects.


The thing is: this linux system used to live as an ssd in my laptop.
But I've literally unplugged it from my onboard laptop and plugged it
into my pc to see if I could boot from it.
Which worked.

So perhaps there is something in the kernel or in the linux distro
misconfigured to work with laptops exclusively?
And is therefore causing the issues?

Are there any laptop specific kernel modules or services/binaries that
can cause power management or signal issues?

Op wo 14 jul. 2021 om 20:05 schreef Alan Stern <stern@rowland.harvard.edu>:
>
> On Wed, Jul 14, 2021 at 07:39:51PM +0200, Hylke Hellinga wrote:
> > Yes, I did.
> >
> > I've connected both the mouse, keyboard and headset to the pc and it would
> > function normally. I know it has to do with the switch itself. But I have
> > no idea how to fix it.
>
> When you connect the mouse directly to the PC, does it still run at full
> speed or does it go up to high speed?
>
> > The switch works fine under windows and macos, and it is even advertised to
> > work under linux. But you never know with amazon products whether that is
> > actually the case.
>
> Do you have any other Linux computers you can try the switch with?  Or
> USB ports on your computer connected to a different host controller?
>
> > I don't have a different usb switch I can test. I've tried different input
> > usb cables as well. The usb cable coming from the switch going into my
> > computer is pretty long.
>
> Well, maybe a shorter cable would help.  But basically, I have no idea
> how to fix it either.  A possible workaround would be to make the usbhid
> driver ignore all the errors coming from the mouse instead of resetting
> it, but such a change would not be generally acceptable for the kernel.
>
> It ought to be possible to get the equivalent of a usbmon trace under
> Windows or Mac OS, using Wireshark.  That would at least show if the
> same errors occur in those settings, and if they do, how the operating
> systems deal with them.
>
> To track down the problem any further would require a more detailed
> knowledge of the USB support in Windows or Mac OS (which I don't have)
> and/or some rather expensive USB bus analyzer hardware.  It would be
> cheaper and quicker just to get a different brand of switch.  :-(
>
> Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
  2021-07-14 18:19                 ` Hylke Hellinga
@ 2021-07-14 19:02                   ` Hylke Hellinga
  2021-07-14 19:52                     ` Alan Stern
  0 siblings, 1 reply; 9+ messages in thread
From: Hylke Hellinga @ 2021-07-14 19:02 UTC (permalink / raw)
  To: linux-usb

I think it definitely has to do with my linux distribution being messed up.

I just tried this on a ubuntu live cd with the same hardware, and I'm
not experiencing any issues.
I'll try to ask on the gentoo irc whether someone could help me figure
out what is causing it.

Sorry if I've wasted your time.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
  2021-07-14 19:02                   ` Hylke Hellinga
@ 2021-07-14 19:52                     ` Alan Stern
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Stern @ 2021-07-14 19:52 UTC (permalink / raw)
  To: Hylke Hellinga; +Cc: linux-usb

On Wed, Jul 14, 2021 at 07:02:04PM +0000, Hylke Hellinga wrote:
> I think it definitely has to do with my linux distribution being messed up.
> 
> I just tried this on a ubuntu live cd with the same hardware, and I'm
> not experiencing any issues.
> I'll try to ask on the gentoo irc whether someone could help me figure
> out what is causing it.

There could be different versions of the kernel on the SSD and the 
LiveCD.

> Sorry if I've wasted your time.

No problem.

Alan Stern

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets
@ 2021-07-14 17:48 Hylke Hellinga
  0 siblings, 0 replies; 9+ messages in thread
From: Hylke Hellinga @ 2021-07-14 17:48 UTC (permalink / raw)
  To: linux-usb

Yes, I did.

I've connected both the mouse, keyboard and headset to the pc and it
would function normally. I know it has to do with the switch itself.
But I have no idea how to fix it.

The switch works fine under windows and macos, and it is even
advertised to work under linux. But you never know with amazon
products whether that is actually the case.

I don't have a different usb switch I can test. I've tried different
input usb cables as well. The usb cable coming from the switch going
into my computer is pretty long.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-14 19:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 18:19 ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller causing random full speed USB resets Hylke Hellinga
2021-07-13 18:42 ` Alan Stern
     [not found]   ` <CABUoX8sNbLuG0FB2_VtH14KhuBoRFB19a2V3cpgzdNDqiVUULA@mail.gmail.com>
     [not found]     ` <CABUoX8sT_=8aUdzhphwJXnRN2m_cKuJrDi1MtOrkaCTThT0wmA@mail.gmail.com>
2021-07-13 20:30       ` Hylke Hellinga
2021-07-14 14:54         ` Alan Stern
     [not found]           ` <CABUoX8uUhW4bdUZ6Roo=jEn=3UwUq2QVAMPcnyg8rbLzua09=w@mail.gmail.com>
2021-07-14 18:05             ` Alan Stern
     [not found]               ` <CABUoX8vWDRtr4hiVOEkT48=doG8xbAVD65Hve0QByLJpV0JsqQ@mail.gmail.com>
2021-07-14 18:19                 ` Hylke Hellinga
2021-07-14 19:02                   ` Hylke Hellinga
2021-07-14 19:52                     ` Alan Stern
2021-07-14 17:48 Hylke Hellinga

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.