From owner-freebsd-usb@FreeBSD.ORG Tue Feb 8 16:00:20 2011 Return-Path: Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 868891065672 for ; Tue, 8 Feb 2011 16:00:20 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3CBB68FC13 for ; Tue, 8 Feb 2011 16:00:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p18G0Krt019532 for ; Tue, 8 Feb 2011 16:00:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p18G0KtG019519; Tue, 8 Feb 2011 16:00:20 GMT (envelope-from gnats) Resent-Date: Tue, 8 Feb 2011 16:00:20 GMT Resent-Message-Id: <201102081600.p18G0KtG019519@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Artem Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8735106566C for ; Tue, 8 Feb 2011 15:52:10 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id A6A718FC12 for ; Tue, 8 Feb 2011 15:52:10 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p18FqA3L097413 for ; Tue, 8 Feb 2011 15:52:10 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p18FqA8D097389; Tue, 8 Feb 2011 15:52:10 GMT (envelope-from nobody) Message-Id: <201102081552.p18FqA8D097389@red.freebsd.org> Date: Tue, 8 Feb 2011 15:52:10 GMT From: Artem To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: usb/154593: Input/output error writing to external USB drive X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2011 16:00:20 -0000 >Number: 154593 >Category: usb >Synopsis: Input/output error writing to external USB drive >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 08 16:00:19 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Artem >Release: 8.1-RELEASE >Organization: >Environment: FreeBSD storage.lan 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: When writing to an external USB driver using dd, it fails with Input/output error. It seems the smaller the block the faster it fails, so could be some kind of race condition. Tried # usbconfig add_quirk UQ_MSC_NO_SYNC_CACHE, but it did not have any effect. The same USB driver works fine under Windows XP and Linux 64bit. # dd if=/dev/random of=/dev/da2 dd: /dev/da2: Input/output error 50+0 records in 49+0 records out 25088 bytes transferred in 0.610338 secs (41105 bytes/sec) # dd if=/dev/random of=/dev/da2 dd: /dev/da2: Input/output error 5+0 records in 4+0 records out 2048 bytes transferred in 0.591235 secs (3464 bytes/sec) # dd if=/dev/random of=/dev/da2 bs=8192 dd: /dev/da2: Input/output error 2779+0 records in 2778+0 records out 22757376 bytes transferred in 23.276072 secs (977715 bytes/sec) # dd if=/dev/random of=/dev/da2 bs=65536 dd: /dev/da2: Input/output error 2067+0 records in 2066+0 records out 135397376 bytes transferred in 32.066219 secs (4222430 bytes/sec) relevant /var/log/messages Feb 8 07:04:13 storage root: Unknown USB device: vendor 0x2116 product 0x0320 bus uhub4 Feb 8 07:04:13 storage kernel: ugen4.4: at usbus4 Feb 8 07:04:13 storage kernel: umass2: on usbus4 Feb 8 07:04:13 storage kernel: umass2: SCSI over Bulk-Only; quirks = 0x0000 Feb 8 07:04:15 storage kernel: umass2:2:2:-1: Attached to scbus2 Feb 8 07:04:15 storage kernel: da2 at umass-sim2 bus 2 scbus2 target 0 lun 0 Feb 8 07:04:15 storage kernel: da2: Fixed Direct Access SCSI-0 device Feb 8 07:04:15 storage kernel: da2: 40.000MB/s transfers Feb 8 07:04:15 storage kernel: da2: 156334MB (320173057 512 byte sectors: 255H 63S/T 19929C) Feb 8 07:06:28 storage kernel: (da2:umass-sim2:2:0:0): AutoSense failed Feb 8 07:09:09 storage kernel: (da2:umass-sim2:2:0:0): AutoSense failed Feb 8 07:10:29 storage last message repeated 2 times relevant device is ugen4.4: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON, the other one is usb flash, which seems to work fine. # usbconfig ugen0.1: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.1: at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen4.1: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen4.2: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen4.3: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen4.4: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON >How-To-Repeat: >Fix: Patch attached with submission follows: Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Genuine Intel(R) CPU 230 @ 1.60GHz (1596.01-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x106c2 Family = 6 Model = 1c Stepping = 2 Features=0xbfe9fbff Features2=0x40e31d AMD Features=0x20100800 AMD Features2=0x1 TSC: P-state invariant real memory = 2147483648 (2048 MB) avail memory = 2044645376 (1949 MB) ACPI APIC Table: <091908 APIC1843> FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs FreeBSD/SMP: 1 package(s) x 1 core(s) x 2 HTT threads cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 ioapic0: Changing APIC ID to 2 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 acpi0: <091908 XSDT1843> on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi0: reservation of 0, a0000 (3) failed acpi0: reservation of 100000, 7f700000 (3) failed Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 cpu0: on acpi0 cpu1: on acpi0 acpi_hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 900 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 vgapci0: port 0xdc00-0xdc07 mem 0xfe980000-0xfe9fffff,0xe0000000-0xefffffff,0xfe940000-0xfe97ffff irq 16 at device 2.0 on pci0 agp0: on vgapci0 agp0: detected 7932k stolen memory agp0: aperture size is 256M hdac0: mem 0xfe938000-0xfe93bfff irq 16 at device 27.0 on pci0 hdac0: HDA Driver Revision: 20100226_0142 hdac0: [ITHREAD] pcib1: irq 16 at device 28.0 on pci0 pci1: on pcib1 re0: port 0xe800-0xe8ff mem 0xfeaff000-0xfeafffff,0xfdff0000-0xfdffffff irq 16 at device 0.0 on pci1 re0: Using 1 MSI messages re0: Chip rev. 0x3c000000 re0: MAC rev. 0x00400000 miibus0: on re0 rgephy0: PHY 1 on miibus0 rgephy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto re0: Ethernet address: 00:21:85:9c:63:23 re0: [FILTER] pcib2: irq 17 at device 28.1 on pci0 pci2: on pcib2 iwn0: mem 0xfebfe000-0xfebfffff irq 17 at device 0.0 on pci2 iwn0: MIMO 2T3R, MoW1, address 00:21:5c:5f:89:87 iwn0: [ITHREAD] iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps pcib3: irq 18 at device 28.2 on pci0 pci3: on pcib3 pcib4: irq 19 at device 28.3 on pci0 pci4: on pcib4 uhci0: port 0xd880-0xd89f irq 23 at device 29.0 on pci0 uhci0: [ITHREAD] usbus0: on uhci0 uhci1: port 0xd800-0xd81f irq 19 at device 29.1 on pci0 uhci1: [ITHREAD] usbus1: on uhci1 uhci2: port 0xd480-0xd49f irq 18 at device 29.2 on pci0 uhci2: [ITHREAD] usbus2: on uhci2 uhci3: port 0xd400-0xd41f irq 16 at device 29.3 on pci0 uhci3: [ITHREAD] usbus3: on uhci3 ehci0: mem 0xfe937c00-0xfe937fff irq 23 at device 29.7 on pci0 ehci0: [ITHREAD] usbus4: EHCI version 1.0 usbus4: on ehci0 pcib5: at device 30.0 on pci0 pci5: on pcib5 isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 31.1 on pci0 ata0: on atapci0 ata0: [ITHREAD] atapci1: port 0xd080-0xd087,0xd000-0xd003,0xcc00-0xcc07,0xc880-0xc883,0xc800-0xc80f irq 19 at device 31.2 on pci0 atapci1: [ITHREAD] ata2: on atapci1 ata2: [ITHREAD] ata3: on atapci1 ata3: [ITHREAD] ichsmb0: port 0x400-0x41f irq 19 at device 31.3 on pci0 ichsmb0: [ITHREAD] smbus0: on ichsmb0 acpi_button0: on acpi0 atrtc0: port 0x70-0x71 irq 8 on acpi0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 atkbdc0: at port 0x60,0x64 on isa0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] ppc0: cannot reserve I/O port range p4tcc0: on cpu0 p4tcc1: on cpu1 ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present; to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf. ZFS filesystem version 3 ZFS storage pool version 14 Timecounters tick every 1.000 msec usbus0: 12Mbps Full Speed USB v1.0 usbus1: 12Mbps Full Speed USB v1.0 usbus2: 12Mbps Full Speed USB v1.0 usbus3: 12Mbps Full Speed USB v1.0 usbus4: 480Mbps High Speed USB v2.0 ata0: DMA limited to UDMA33, controller found non-ATA66 cable ad0: 7695MB at ata0-master UDMA33 ugen0.1: at usbus0 uhub0: on usbus0 ugen1.1: at usbus1 uhub1: on usbus1 ugen2.1: at usbus2 uhub2: on usbus2 ugen3.1: at usbus3 uhub3: on usbus3 ugen4.1: at usbus4 uhub4: on usbus4 ad4: 476940MB at ata2-master UDMA100 SATA ad6: 476940MB at ata3-master UDMA100 SATA hdac0: HDA Codec #0: Realtek ALC888 pcm0: at cad 0 nid 1 on hdac0 pcm1: at cad 0 nid 1 on hdac0 SMP: AP CPU #1 Launched! Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0 uhub1: 2 ports with 2 removable, self powered uhub0: 2 ports with 2 removable, self powered uhub2: 2 ports with 2 removable, self powered uhub3: 2 ports with 2 removable, self powered Root mount waiting for: usbus4 Root mount waiting for: usbus4 Root mount waiting for: usbus4 uhub4: 8 ports with 8 removable, self powered ugen4.2: at usbus4 umass0: on usbus4 umass0: SCSI over Bulk-Only; quirks = 0x0000 Root mount waiting for: usbus4 umass0:0:0:-1: Attached to scbus0 Root mount waiting for: usbus4 (probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0 (probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error (probe0:umass-sim0:0:0:0): SCSI status: Check Condition (probe0:umass-sim0:0:0:0): SCSI sense: NOT READY asc:3a,0 (Medium not present) da0 at umass-sim0 bus 0 scbus0 target 0 lun 0 da0: Removable Direct Access SCSI-0 device da0: 40.000MB/s transfers da0: Attempt to query device size failed: NOT READY, Medium not present ugen4.3: at usbus4 umass1: on usbus4 umass1: SCSI over Bulk-Only; quirks = 0x0000 Root mount waiting for: usbus4 umass1:1:1:-1: Attached to scbus1 Trying to mount root from ufs:/dev/gpt/sdc0 da1 at umass-sim1 bus 1 scbus1 target 0 lun 0 da1: Removable Direct Access SCSI-0 device da1: 40.000MB/s transfers da1: 1946MB (3985408 512 byte sectors: 255H 63S/T 248C) ipfw2 (+ipv6) initialized, divert loadable, nat loadable, rule-based forwarding disabled, default to deny, logging disabled re0: link state changed to UP ugen4.4: at usbus4 umass2: on usbus4 umass2: SCSI over Bulk-Only; quirks = 0x4000 umass2:2:2:-1: Attached to scbus2 da2 at umass-sim2 bus 2 scbus2 target 0 lun 0 da2: Fixed Direct Access SCSI-0 device da2: 40.000MB/s transfers da2: 156334MB (320173057 512 byte sectors: 255H 63S/T 19929C) >Release-Note: >Audit-Trail: >Unformatted: