Bug 11599 - ehcd-hci fails on sb600 chipset
Summary: ehcd-hci fails on sb600 chipset
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: USB (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Greg Kroah-Hartman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-20 09:09 UTC by raffaele
Modified: 2009-05-25 01:40 UTC (History)
7 users (show)

See Also:
Kernel Version: 2.6.25.15
Subsystem:
Regression: No
Bisected commit-id:


Attachments
syslog captured when problem happens (68.70 KB, application/octet-stream)
2008-09-20 09:12 UTC, raffaele
Details
cat /proc/cpuinfo output (1.40 KB, text/plain)
2008-09-20 09:14 UTC, raffaele
Details
cat /proc/iomem output (1.50 KB, text/plain)
2008-09-20 09:14 UTC, raffaele
Details
cat /proc/ioports output (1.45 KB, text/plain)
2008-09-20 09:15 UTC, raffaele
Details
lspci -vvv output (14.23 KB, text/plain)
2008-09-20 09:16 UTC, raffaele
Details
lsusb output (441 bytes, text/plain)
2008-09-20 09:18 UTC, raffaele
Details
cat /proc/scsi/scsi output (495 bytes, text/plain)
2008-09-20 09:18 UTC, raffaele
Details
/usr/src/linux/scripts/ver_linux output (743 bytes, text/plain)
2008-09-20 09:19 UTC, raffaele
Details
kernel config file (41.61 KB, application/octet-stream)
2008-09-20 09:20 UTC, raffaele
Details
syslog with kernel 2.6.27-rc6 (40.65 KB, application/octet-stream)
2008-09-22 10:34 UTC, raffaele
Details
dmesg log during the problematic behavior (11.80 KB, text/plain)
2008-10-07 02:27 UTC, Roman Mamedov
Details
Add the SB600 device as needing the USB hang workaround (999 bytes, patch)
2008-11-21 13:45 UTC, Roman Mamedov
Details | Diff

Description raffaele 2008-09-20 09:09:42 UTC
Latest working kernel version: none, the system is new
Earliest failing kernel version: 2.6.25.15
Distribution: Gentoo
Hardware Environment: Asus M2A-VM with AMD 690G/ATI SB600 chipset
Software Environment: Gnome 2.22.2
Problem Description: the ehci-hcd driver randomly fails with loss of high-speed USB functionality. The problem appears more often during copy of big file (>1Gb) to Mass Storage Device, but can happen also during normal operation. When it happens, for several minutes no USB peripheral is available, then the ohci-hci takes over and MSC is available at full-speed only. The problem happens in the attached syslog, where a file transfer to the USB was in progress, suddenly at 14:04:12 the USB mouse stops functioning.
The bug was initially reported to the gentoo-amd64 mailing list and is viewable at http://www.nabble.com/USB-2.0-falling-back-to-full-speed-td19387197.html

Steps to reproduce: insert USB key, start large file copy to the key, after some time the copy hangs and USB mouse stops responding
Comment 1 raffaele 2008-09-20 09:12:41 UTC
Created attachment 17901 [details]
syslog captured when problem happens

The problem starts at time 14:04:12. The USB was compiled with CONFIG_USB_DEBUG.
Comment 2 raffaele 2008-09-20 09:14:00 UTC
Created attachment 17902 [details]
cat /proc/cpuinfo output
Comment 3 raffaele 2008-09-20 09:14:42 UTC
Created attachment 17903 [details]
cat /proc/iomem output
Comment 4 raffaele 2008-09-20 09:15:11 UTC
Created attachment 17904 [details]
cat /proc/ioports output
Comment 5 raffaele 2008-09-20 09:16:03 UTC
Created attachment 17905 [details]
lspci -vvv output
Comment 6 raffaele 2008-09-20 09:18:14 UTC
Created attachment 17906 [details]
lsusb output

The lsusb was taken after the problem happened. There is a USB key attached to the Bus #2, but it is not shown after the problem happens. The problem happens from the USB ports located on the front of the case but also from the ports on the back of the case.
Comment 7 raffaele 2008-09-20 09:18:39 UTC
Created attachment 17907 [details]
cat /proc/scsi/scsi output
Comment 8 raffaele 2008-09-20 09:19:45 UTC
Created attachment 17908 [details]
/usr/src/linux/scripts/ver_linux output
Comment 9 raffaele 2008-09-20 09:20:14 UTC
Created attachment 17909 [details]
kernel config file
Comment 10 Greg Kroah-Hartman 2008-09-20 14:13:00 UTC
This is a known problem, there is a bug in the chipset :(

Can you try out 2.6.27-rc6, it should be resolved there.
Comment 11 raffaele 2008-09-20 14:40:47 UTC
Thanks. I will try it next Moday and come back to you, now I am on a low bandwidth connection.
Comment 12 raffaele 2008-09-22 10:32:25 UTC
2.6.27-rc6 does not fix the problem. In the attached log, as soon as I plug in a USB key I loose the USB mouse. The syslog shows several attmpts to start the ehci_hcd, then again it falls back to ohci-hcd.

# uname -a
Linux louie 2.6.27-rc6 #1 SMP Tue Sep 23 18:14:29 CEST 2008 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5600+ AuthenticAMD GNU/Linux
Comment 13 raffaele 2008-09-22 10:34:42 UTC
Created attachment 17954 [details]
syslog with kernel 2.6.27-rc6

The USB key was insterted at time 18:23:30. At this time, USB mouse stops responding.
Comment 14 raffaele 2008-09-24 13:09:16 UTC
Any other test I can make? I'd like to help getting this fixed, otherwise this brand new motherboard is not much useful for me.
Comment 15 Greg Kroah-Hartman 2008-09-26 12:46:09 UTC
On Wed, Sep 24, 2008 at 01:09:16PM -0700, bugme-daemon@bugzilla.kernel.org wrote:
> Any other test I can make? I'd like to help getting this fixed, otherwise
> this
> brand new motherboard is not much useful for me.

Hm, I don't know, have you tried contacting AMD?  They have been helpful
in resolving the other issue that this chipset had.
Comment 16 raffaele 2008-09-28 23:38:26 UTC
I contacted AMD and Asus, in the meanwhile I maybe found the cause. I have a Philips LCD monitor with a USB hub embedded, it is visible in lsusb.txt as:
Bus 001 Device 002: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
I was using this hub for the USB mouse and HP scanner (not for the mass storage devices). I detached the monitor's USB connector and attached the mouse directly to the MB connectors leaving the scanner unconnected for now. I tried several file copy to USB key and HD and it seems to work fine, at high-speed, on 2.6.27-rc6.
I'll do some more testing and post the results.
If you need some test or detail on the monitor's hub let me know.
Comment 17 Roman Mamedov 2008-10-07 02:27:25 UTC
Created attachment 18187 [details]
dmesg log during the problematic behavior

I use USB mouse and keyboard plugged into a small 4-port USB hub, which describes itself as "ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB".

When I plug in a USB flash stick (directly into a port on the motherboard, not into the hub), either keyboard, or mouse, or both become completely frozen (keyboard, sometimes, with some key pressed down and repeating).

I am attaching the log of dmesg messages taken during a case of buggy behavior.
In this log:
- At 288s, I plug in the USB stick; not copying anything to or from the stick (not even mounting it);
- Some time after that, the keyboard stops working;
- At 435s, I unplug the keyboard from USB hub;
- At 441s, I replug the keyboard back into USB hub; keyboard works;
- At about 600s, keyboard again stops responding completely, meanwhile the system thinks that "right arrow" key is being held down;
- At 633s, I unplug the keyboard from USB hub;
- At 639s, I replug the keyboard back into USB hub; keyboard works;
- At 658s, I unplug the flash stick from the PC.

After removing the flash stick, keyboard and mouse work absolutely fine for many hours.

The problem is reproducible with any flash stick simply plugged into any port on the motherboard (no data exchange at high speeds or no data exchange at all seem to be required to trigger the bug).

(The used kernel version is 2.6.26.)
Comment 18 Roman Mamedov 2008-10-11 12:19:07 UTC
After pluggin in all the peripherals directly into the ports on the motherboard, the USB operation seems to be much more (or completely?) stable. So it's probably related to SB600's general handling of USB hubs, because the original submitter's problem was also solved by removing the hub.

However, it should be noted that in Microsoft Windows the same hardware works for me perfectly even *with* the USB hub.

Also, I think this bug might be related to another one: http://bugzilla.kernel.org/show_bug.cgi?id=11456
Comment 19 Tobias Florek 2008-11-14 12:44:09 UTC
i can confirm, that removing the usb hub solves my problems as well.
unfortunately this is no real option.
Comment 20 Roman Mamedov 2008-11-14 13:57:54 UTC
Attaching devices through an USB hub continues to cause the described issue as of 2.6.27.3. Operation without the hub confirmed to be completely stable.
Comment 21 Per 2008-11-18 11:03:44 UTC
I have the same hub and SB600, will try removing it later to see if that solves the problem.
Comment 22 Per 2008-11-19 19:48:06 UTC
I see the status on this bug is "Needinfo" -- what other info can we provide?  I would also like to help get this fixed.

I can confirm this bug exists in at least these kernels on Fedora 9:
kernel-2.6.26.5-45.fc9.x86_64
kernel-2.6.26.6-79.fc9.x86_64
kernel-2.6.27.5-37.fc9.x86_64

Either of these hubs will cause it:
ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
0409:005a NEC Corp. HighSpeed Hub

See also my bug report at the Fedora project:
https://bugzilla.redhat.com/show_bug.cgi?id=472326
Comment 23 Roman Mamedov 2008-11-21 06:42:30 UTC
This might be the fix for this problem:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b09bc6cbae4dd3a2d35722668ef2c502a7b8b093
However, it only applies itself on SB700, maybe because the patch author probably did not know that SB600 are affected too.
I did not test it yet.
Comment 24 Roman Mamedov 2008-11-21 13:45:53 UTC
Created attachment 18965 [details]
Add the SB600 device as needing the USB hang workaround

And indeed, after applying the attached patch on top of 2.6.28-rc6, I could do a high-speed transfer from an USB flash and have no problems with other devices. This is with the Genesys USB 2.0 4-port hub plugged in.

$ dd if=/dev/sdb of=/dev/null bs=1M
3911+1 records in
3911+1 records out
4102028288 bytes (4.1 GB) copied, 153.569 s, 26.7 MB/s

Before the patch, this would lock up the USB keyboard and/or mouse within a couple of seconds.

Perhaps the workaround needs more refinement with regard to which devices exactly need it to be applied. The original author of the solution hardcoded 4396 (SB700 USB 2.0) specifically with 3a and 3b revisions of SMBus. I added the device 4386 (SB600 USB 2.0) without any SMBus revision checking. This might be too broad, I don't know. Feel free to further test/modify/improve it.
Comment 25 Shane Huang 2008-11-24 18:40:33 UTC
Thanks for reporting this bug and providing the testing patch, we will check
this issue on SB600 and submit one formal workaround patch if necessary.
Comment 26 Per 2008-11-29 10:05:31 UTC
I can confirm that Roman Mamedov's patch for the SB600 works to fix this problem when applied to the 2.6.27 kernel, after first applying Andiry Xu's patch for the SB700.
Comment 27 Shane Huang 2008-11-30 17:36:54 UTC
The patch for SB600 has been accepted by Greg, here is the temp link,
which will be merged to linus source tree soon:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/usb.current/usb-fix-sb600-usb-subsystem-hang-bug.patch

Thanks,
Comment 28 raffaele 2008-12-02 00:37:56 UTC
Roman's fix (id=18965) works for me on the original hw setup (Hub embedded in Philips monitor connected to the SB600-based motherboard). The behavior is now that during a file transfer to a key directly attached to the motherboard there is an interruption after several seconds, the syslog reports a reset of the peripheral, and then the transfer resumes. This is on 2.6.28-rc6 kernel.
Comment 29 Shane Huang 2009-05-25 01:40:18 UTC
Fixed by 0a99e8ac430a27825bd055719765fd0d65cd797f

Note You need to log in before you can comment on or make changes to this bug.