Bug 69651 - xhci_hcd Too many fragments messages fill up kmsg buffer
Summary: xhci_hcd Too many fragments messages fill up kmsg buffer
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: 2014-01-29 08:47 UTC by druidic
Modified: 2014-02-14 22:46 UTC (History)
3 users (show)

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


Attachments

Description druidic 2014-01-29 08:47:06 UTC
I have a Western Digital external USB drive which I use to store VirtualBox virtual machine images. It is also LUKS encrypted.

When I start a vm and VirtualBox starts to restore the virtual machine state, the kernel message buffer starts to fill up with "Too many fragments" messages.

Attaching the drive works fine:

[ 4363.344705] usb 3-3: new high-speed USB device number 3 using xhci_hcd
[ 4363.470033] usb-storage 3-3:1.0: USB Mass Storage device detected
[ 4363.470288] scsi7 : usb-storage 3-3:1.0
[ 4364.488750] scsi 7:0:0:0: Direct-Access     WD       My Book          1012 PQ: 0 ANSI: 4
[ 4364.500626] scsi 7:0:0:1: Enclosure         WD       My Book Device   1012 PQ: 0 ANSI: 4
[ 4364.501043] ses 7:0:0:1: Attached Enclosure device
[ 4364.513845] sd 7:0:0:0: [sdb] 1953513472 512-byte logical blocks: (1.00 TB/931 GiB)
[ 4364.521558] sd 7:0:0:0: [sdb] Write Protect is off
[ 4364.521561] sd 7:0:0:0: [sdb] Mode Sense: 10 00 00 00
[ 4364.529334] sd 7:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 4364.572289]  sdb: sdb1
[ 4364.640544] sd 7:0:0:0: [sdb] Attached SCSI disk
[ 4369.616867] EXT4-fs (dm-4): mounted filesystem with ordered data mode. Opts: (null)

I can even work with it normally, compile stuff stored on it etc. But as soon as VirtualBox starts to restore a vm stored on it, I get this:

... (millions of "Too many fragments" messages)
[ 4698.386560] xhci_hcd 0000:00:14.0: Too many fragments 136, max 63
[ 4698.386563] xhci_hcd 0000:00:14.0: Too many fragments 136, max 63
[ 4698.386566] xhci_hcd 0000:00:14.0: Too many fragments 136, max 63
[ 4698.386569] xhci_hcd 0000:00:14.0: Too many fragments 136, max 63
[ 4698.386725] systemd-journald[190]: /dev/kmsg buffer overrun, some messages lost.
[ 4698.546593] usb 3-3: reset high-speed USB device number 3 using xhci_hcd
[ 4698.600134] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8802efa7ec80
[ 4698.600137] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8802efa7ecc0
[ 4698.600139] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800d34a74c0
[ 4698.618850] sd 7:0:0:0: [sdb] Unhandled error code
[ 4698.618852] sd 7:0:0:0: [sdb]
[ 4698.618853] Result: hostbyte=0x05 driverbyte=0x00
[ 4698.618854] sd 7:0:0:0: [sdb] CDB:
[ 4698.618855] cdb[0]=0x2a: 2a 00 3f 37 bc 00 00 00 d7 00
[ 4698.618859] end_request: I/O error, dev sdb, sector 1060617216
Comment 1 druidic 2014-01-29 09:08:02 UTC
A similar issue to mine reported downstream here: https://bugs.archlinux.org/task/38508
Comment 2 druidic 2014-01-29 09:31:22 UTC
My USB controllers:

# lspci | grep -i usb
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
Comment 3 Greg Kroah-Hartman 2014-01-29 12:51:13 UTC
On Wed, Jan 29, 2014 at 08:47:06AM +0000, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=69651
> 
>             Bug ID: 69651
>            Summary: xhci_hcd Too many fragments messages fill up kmsg
>                     buffer

Please send to the linux-usb@vger.kernel.org mailing list
Comment 4 Sarah Sharp 2014-01-30 02:10:17 UTC
I know which patch is causing this issue, but we're still debating on the exact fix for it.  In the meantime, you can revert commit 35773dac5f862cb1c82ea151eba3e2f6de51ec3e "usb: xhci: Link TRB must not occur within a USB payload burst".
Comment 5 druidic 2014-01-31 15:32:58 UTC
I found the related mailing list discussion and applied the Debian patches:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733907#25
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733826#69

They fixed the issue for me.

BTW. Is the mailing list the preferred channel for filing bug reports?
Comment 6 Greg Kroah-Hartman 2014-01-31 15:42:53 UTC
> BTW. Is the mailing list the preferred channel for filing bug reports?

Yes.
Comment 7 Sarah Sharp 2014-02-14 22:46:19 UTC
This issue should be fixed in Linus' tree shortly, with the following commits:

3d4b81eda221 Revert "usb: xhci: Link TRB must not occur within a USB payload burst"
9cf00d917082 Revert "xhci: Avoid infinite loop when sg urb requires too many trbs"
1386ff75797a Revert "xhci: Set scatter-gather limit to avoid failed block writes."
247bf557273d xhci 1.0: Limit arbitrarily-aligned scatter gather.

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