NetBSD Problem Report #54977

1vuio0pswjnm71 pts0 comments

NetBSD Problem Report #54977:<br>USB umass hard drive "failed to create xfers" when attaching via xhci(4)

NetBSD Problem Report #54977

From paul@whooppee.com Mon Feb 17 16:37:35 2020<br>Return-Path:<br>Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])<br>(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))<br>(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))<br>by mollari.NetBSD.org (Postfix) with ESMTPS id 806E51A9213<br>for ; Mon, 17 Feb 2020 16:37:35 +0000 (UTC)<br>Message-Id:<br>Date: Mon, 17 Feb 2020 08:37:04 -0800 (PST)<br>From: paul@whooppee.com<br>Reply-To: paul@whooppee.com<br>To: gnats-bugs@NetBSD.org<br>Subject: xhci(4) bug: failed to create xfers<br>X-Send-Pr-Version: 3.95

>Number: 54977<br>>Category: kern<br>>Synopsis: USB umass hard drive "failed to create xfers" when attaching via xhci(4)<br>>Confidential: no<br>>Severity: serious<br>>Priority: high<br>>Responsible: kern-bug-people<br>>State: closed<br>>Class: sw-bug<br>>Submitter-Id: net<br>>Arrival-Date: Mon Feb 17 16:40:00 +0000 2020<br>>Closed-Date: Wed Oct 07 19:21:37 +0000 2020<br>>Last-Modified: Wed Oct 07 19:21:37 +0000 2020<br>>Originator: Paul Goyette<br>>Release: NetBSD 9.99.46<br>>Organization:<br>+--------------------+--------------------------+-----------------------+<br>| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |<br>| (Retired) | FA29 0E3B 35AF E8AE 6651 | paul@whooppee.com |<br>| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette@netbsd.org |<br>+--------------------+--------------------------+-----------------------+<br>>Environment:

System: NetBSD speedy.whooppee.com 9.99.46 NetBSD 9.99.46 (SPEEDY 2020-02-07 16:26:35 UTC) #1: Fri Feb 7 19:37:58 UTC 2020 paul@speedy.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64<br>Architecture: x86_64<br>Machine: amd64<br>>Description:<br>With a 9.99.46 kernel built from sources dated 2020-02-07 16:26:35 UTC<br>I get the following errors when plugging in a USB hard drive:

umass0 at uhub1 port 2 configuration 1 interface 0<br>umass0: Western Digital (0x1058) Ext HDD 1021 (0x1021), rev 2.00/20.02, addr 32<br>umass0: using SCSI over Bulk-Only<br>umass0: autoconfiguration error: failed to create xfers

This worked correctly with a 9.99.42 kernel built from sources dated<br>2020-01-25 19:35:05 UTC:

umass0 at uhub1 port 1 configuration 1 interface 0<br>umass0: Western Digital (0x1058) Ext HDD 1021 (0x1021), rev 2.00/20.02, addr 6<br>umass0: using SCSI over Bulk-Only<br>scsibus0 at umass0: 2 targets, 1 lun per target<br>sd0 at scsibus0 target 0 lun 0: disk fixed<br>sd0: fabricating a geometry<br>sd0: 1863 GB, 1907727 cyl, 64 head, 32 sec, 512 bytes/sect x 3907024896 sectors<br>sd0: fabricating a geometry

On IRC it was suggested (thanks, maya!) that the error message might be<br>related to memory fragmentation. I didn't believe it (given that I have<br>128GB of RAM), but a quick check with top(1) showed that I had more than<br>100GB of 'file cache' active. So, I unmounted all my development trees<br>(to force the cache to get flushed - and unmapped). Sure enough, I was<br>then able to successfully mount the USB drive!

Concensus on IRC is that this is a bug in the xhci(4) driver, and is<br>triggered by fragmentation of kernel virtual address space. It seems that<br>this has been reported/discussed before on the mailing lists, but no PR<br>seems to have been filed.

>How-To-Repeat:<br>Create fragmentation in kernel VA space, then attach a umass hard drive<br>to a xhci(4) USB port.<br>>Fix:<br>Unknown

>Release-Note:

>Audit-Trail:<br>From: "John D. Baker"<br>To: gnats-bugs@NetBSD.org<br>Cc:<br>Subject: Re: kern/54977: xhci(4) bug: failed to create xfers<br>Date: Mon, 17 Feb 2020 12:27:15 -0600 (CST)

This problem is not unique to xhci(4), but also occurs with [eou]hci(4)<br>devices as well--especially on "low"-memory machines (2, 4, 8GB used to<br>be huge...) that have been running for a while before a umass(4) device<br>is plugged in.

|/"\ John D. Baker, KN5UKS NetBSD Darwin/MacOS X<br>|\ / jdbaker[snail]consolidated[flyspeck]net OpenBSD FreeBSD<br>| X No HTML/proprietary data in email. BSD just sits there and works!<br>|/ \ GPGkeyID: D703 4A7E 479F 63F8 D3F4 BD99 9572 8F23 E4AD 1645

From: "David H. Gutteridge"<br>To: gnats-bugs@netbsd.org<br>Cc:<br>Subject: Re: kern/54977<br>Date: Sat, 19 Sep 2020 17:11:22 -0400

(Carrying over from PR kern/55671 -- I didn't know this was already<br>reported.) I don't know if it's of any use, but I captured a USB debug<br>log relating to this, at:

http://www.netbsd.org/~gutteridge/pen_drive_attach_failure.log

(As John D. Baker already noted here, this isn't an xhci(4)-specific<br>issue, it happens with other USB controllers as well.)

From: Nick Hudson<br>To: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org,<br>gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, paul@whooppee.com<br>Cc:<br>Subject: Re: kern/54977<br>Date: Sun, 20 Sep 2020 09:26:09 +0100

On 19/09/2020 22:15, David H. Gutteridge wrote:<br>> The following reply was made to PR kern/54977; it has been noted by GNAT=<br>S.<br>> From: "David H. Gutteridge"<br>> To: gnats-bugs@netbsd.org<br>> Cc:<br>> Subject: Re: kern/54977<br>> Date: Sat, 19 Sep 2020...

netbsd from kern xhci paul umass0

Related Articles