From owner-freebsd-usb@FreeBSD.ORG Tue Dec 11 00:46:22 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61815BB4 for ; Tue, 11 Dec 2012 00:46:22 +0000 (UTC) (envelope-from robert_cargil@gmx.com) Received: from mailout-eu.gmx.com (mailout-eu.gmx.com [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id CD3BC8FC14 for ; Tue, 11 Dec 2012 00:46:21 +0000 (UTC) Received: (qmail 27571 invoked by uid 0); 11 Dec 2012 00:46:14 -0000 Received: from 107.194.225.105 by rms-eu009 with HTTP Date: Tue, 11 Dec 2012 01:46:13 +0100 From: robert_cargil@gmx.com Message-ID: <20121211004614.221100@gmx.com> MIME-Version: 1.0 Subject: Re: USB Harddrive g_vfs_done() Errors To: freebsd-usb@freebsd.org X-Authenticated: #118708984 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 X-GMX-UID: Aee0cDo3eSEqJ5k5eHMh4Xp+IGRvbwAM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 00:46:22 -0000 Hi, Windows operating systems and Linux will hide these errors from the user interface. They silently reset the drive when such errors occur and go on. Such a reset sequence can be noticed by that the device is not responding for several hundred milliseconds. There is no reason that USB traffic should stop at the USB host side, except for a known lost interrupt bug. See the hw.usb.ehci.lostintrbug sysctl. If this variable is set and you still see errors, then there is most likely a USB firmware error in your device and not FreeBSD that makes the so-called USB endpoints on the device side stop receving data suddenly. You can verify my claims by checking the USB traffic using usbdump -i usbusX -f Y . --HPS Thank you for your reply. I see I mistakenly wrote Western Digital USB 2gig drive. I meant to write 2 terrabyte drive. Both usb drives that I am having errors writing to are the Western Digital 2 terrabyte drives. Both are formatted msdosfs. I added hw.usb.ehci.lostintrbug=1 to my /boot/loader.conf. Verified it was set: sysctl -a | grep hw.usb.ehci.lostintrbug hw.usb.ehci.lostintrbug: 1 Any file operation immediately fails with the g_vfs_errors in /var/log/messages. Even just simply touching a new file from a shell at the root of the USB drive fails. Reading from the drive works perfectly. I ran usbdump before trying any IO on the the USB drive. This is the output: sudo usbdump -i usbus1 -f 3 15:41:24.450550 usbus1.3 SUBM-BULK-EP=00000002,SPD=HIGH,NFR=1,SLEN=32,IVAL=0 15:41:24.450678 usbus1.3 DONE-BULK-EP=00000002,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=0 15:41:24.450687 usbus1.3 SUBM-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=0,IVAL=0 15:41:24.835080 usbus1.3 DONE-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=32768,IVAL=0,ERR=0 15:41:24.835099 usbus1.3 SUBM-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=0,IVAL=0 15:41:24.835180 usbus1.3 DONE-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=16,IVAL=0,ERR=0 15:42:00.986199 usbus1.3 SUBM-BULK-EP=00000002,SPD=HIGH,NFR=1,SLEN=32,IVAL=0 15:42:00.986334 usbus1.3 DONE-BULK-EP=00000002,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=0 I checked smartctl for the drive and it showed that the overall self-assesment test result: PASSED Thank you for your help in trying to track down what the problem is.