Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 2003 14:18:50 +0400
From:      "Igor B. Bykhalo" <goshik@binep.ac.ru>
To:        "FreeBSD Questions" <freebsd-questions@FreeBSD.org>
Cc:        freebsd-stable@freebsd.org
Subject:   A-DATA flash drive: "Attempt to query device size failed"
Message-ID:  <000b01c35b3a$fb4771a0$ea2ce9c1@binep.ac.ru>

next in thread | raw e-mail | index | archive | help
I purchased the 256 MB A-DATA flash drive (USB 2.0 SpeedDrive),
but the system can't query its size. Here is corresponding parts
of system messages (boot -v):

>>>>>>>>>>>
Aug  5 12:53:57 goshik /kernel: Copyright (c) 1992-2003 The FreeBSD Project.
Aug  5 12:53:57 goshik /kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
Aug  5 12:53:57 goshik /kernel: The Regents of the University of California. All rights reserved.
Aug  5 12:53:57 goshik /kernel: FreeBSD 4.8-STABLE #13: Tue Aug  5 12:45:23 MSD 2003
Aug  5 12:53:57 goshik /kernel: goshik@goshik.binep.ac.ru:/usr/obj/usr/src/sys/GO
Aug  5 12:53:57 goshik /kernel: Calibrating clock(s) ... TSC clock: 1334887219 Hz, i8254 clock: 1193117 Hz
Aug  5 12:53:57 goshik /kernel: Timecounter "i8254"  frequency 1193117 Hz
Aug  5 12:53:57 goshik /kernel: CPU: AMD Athlon(tm) XP 1500+ (1334.89-MHz 686-class CPU)
Aug  5 12:53:57 goshik /kernel: Origin = "AuthenticAMD"  Id = 0x662  Stepping = 2
Aug  5 12:53:57 goshik /kernel: Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
Aug  5 12:53:57 goshik /kernel: AMD Features=0xc0480000<MP,AMIE,DSP,3DNow!>
Aug  5 12:53:57 goshik /kernel: Data TLB: 32 entries, fully associative
Aug  5 12:53:57 goshik /kernel: Instruction TLB: 16 entries, fully associative
Aug  5 12:53:57 goshik /kernel: L1 data cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative
Aug  5 12:53:57 goshik /kernel: L1 instruction cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative
Aug  5 12:53:57 goshik /kernel: L2 internal cache: 256 kbytes, 64 bytes/line, 1 lines/tag, 8-way associative
Aug  5 12:53:57 goshik /kernel: real memory  = 268369920 (262080K bytes)
Aug  5 12:53:57 goshik /kernel: Physical memory chunk(s):
Aug  5 12:53:57 goshik /kernel: 0x00001000 - 0x0009ffff, 651264 bytes (159 pages)
Aug  5 12:53:57 goshik /kernel: 0x00363000 - 0x0ffe7fff, 264785920 bytes (64645 pages)
Aug  5 12:53:57 goshik /kernel: config> en apm0
Aug  5 12:53:57 goshik /kernel: config> di psm0
Aug  5 12:53:57 goshik /kernel: config> di ppc0
Aug  5 12:53:57 goshik /kernel: config> q
Aug  5 12:53:57 goshik /kernel: avail memory = 257871872 (251828K bytes)
Aug  5 12:53:57 goshik /kernel: bios32: Found BIOS32 Service Directory header at 0xc00faf90
Aug  5 12:53:57 goshik /kernel: bios32: Entry = 0xfb400 (c00fb400)  Rev = 0  Len = 1
Aug  5 12:53:57 goshik /kernel: pcibios: PCI BIOS entry at 0xb430
Aug  5 12:53:57 goshik /kernel: pnpbios: Found PnP BIOS data at 0xc00fbef0
Aug  5 12:53:57 goshik /kernel: pnpbios: Entry = f0000:bf20  Rev = 1.0
Aug  5 12:53:57 goshik /kernel: Other BIOS signatures found:
Aug  5 12:53:57 goshik /kernel: ACPI: 000f66f0
Aug  5 12:53:57 goshik /kernel: Preloaded elf kernel "kernel" at 0xc033c000.
Aug  5 12:53:57 goshik /kernel: Preloaded userconfig_script "/boot/kernel.conf" at 0xc033c0a8.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "vesa.ko" at 0xc033c0f8.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "vn.ko" at 0xc033c194.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "if_ef.ko" at 0xc033c230.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "if_sis.ko" at 0xc033c2d0.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "miibus.ko" at 0xc033c370.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "snd_via8233.ko" at 0xc033c410.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "snd_pcm.ko" at 0xc033c4b4.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "usb.ko" at 0xc033c554.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "umass.ko" at 0xc033c5f0.
Aug  5 12:53:57 goshik /kernel: Preloaded elf module "snp.ko" at 0xc033c690.
[...]
Aug  5 12:53:57 goshik /kernel: uhci0: <VIA 83C572 USB controller> port 0xd800-0xd81f irq 12 at device 17.2 on pci0
Aug  5 12:53:57 goshik /kernel: usb0: <VIA 83C572 USB controller> on uhci0
Aug  5 12:53:57 goshik /kernel: usb0: USB revision 1.0
Aug  5 12:53:57 goshik /kernel: uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
Aug  5 12:53:57 goshik /kernel: uhub0: 2 ports with 2 removable, self powered
Aug  5 12:53:57 goshik /kernel: uhub1: A-DATA Technology Inc. USB Embedded Hub, class 9/0, rev 2.00/0.01, addr 2
Aug  5 12:53:58 goshik /kernel: uhub1: 1 port with 0 removable, self powered
Aug  5 12:53:58 goshik /kernel: umass0: A-DATA Technology Inc. USB Mass Storage Device, rev 2.00/0.01, addr 3
Aug  5 12:53:58 goshik /kernel: umass0:0:0:-1: Attached to scbus0 as device 0
Aug  5 12:53:58 goshik /kernel: uhci1: <VIA 83C572 USB controller> port 0xdc00-0xdc1f irq 12 at device 17.3 on pci0
Aug  5 12:53:58 goshik /kernel: using shared irq12.
Aug  5 12:53:58 goshik /kernel: usb1: <VIA 83C572 USB controller> on uhci1
Aug  5 12:53:58 goshik /kernel: usb1: USB revision 1.0
Aug  5 12:53:58 goshik /kernel: uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
Aug  5 12:53:58 goshik /kernel: uhub2: 2 ports with 2 removable, self powered
[...]
Aug  5 12:53:58 goshik /kernel: Creating DISK da0
Aug  5 12:53:58 goshik /kernel: pass0 at umass-sim0 bus 0 target 0 lun 0
Aug  5 12:53:58 goshik /kernel: pass0: <A-DATA Flash 2.0 P1.0> Removable Direct Access SCSI-0 device
Aug  5 12:53:58 goshik /kernel: pass0: Serial Number 
Aug  5 12:53:58 goshik /kernel: pass0: 650KB/s transfers
Aug  5 12:53:58 goshik /kernel: ad0s1: type 0xa5, start 63, end = 78156224, size 78156162 : OK
Aug  5 12:53:58 goshik /kernel: Mounting root from ufs:/dev/ad0s1a
Aug  5 12:53:58 goshik /kernel: ad0s1: type 0xa5, start 63, end = 78156224, size 78156162 : OK
Aug  5 12:53:58 goshik /kernel: start_init: trying /sbin/init
Aug  5 12:53:58 goshik /kernel: (da0:umass-sim0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0
Aug  5 12:53:58 goshik /kernel: (da0:umass-sim0:0:0:0): NOT READY asc:3a,0
Aug  5 12:53:58 goshik /kernel: (da0:umass-sim0:0:0:0): Medium not present
Aug  5 12:53:58 goshik /kernel: da0 at umass-sim0 bus 0 target 0 lun 0
Aug  5 12:53:58 goshik /kernel: da0: <A-DATA Flash 2.0 P1.0> Removable Direct Access SCSI-0 device
Aug  5 12:53:58 goshik /kernel: da0: Serial Number 
Aug  5 12:53:58 goshik /kernel: da0: 650KB/s transfers
Aug  5 12:53:58 goshik /kernel: da0: Attempt to query device size failed: NOT READY, Medium not present
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
Aug  5 13:28:29 goshik /kernel: usbd
Aug  5 13:28:29 goshik /kernel: usbd: opened /dev/usb0
Aug  5 13:28:29 goshik /kernel: usbd: reading configuration file /etc/usbd.conf
Aug  5 13:28:29 goshik /kernel: usbd: opened /dev/usb
Aug  5 13:28:29 goshik /kernel: usbd: device-attach event at 0.014087000, UHCI root hub, VIA:
Aug  5 13:28:29 goshik /kernel: vndr=0x0000 prdct=0x0000 rlse=0x0100 clss=0x0009 subclss=0x0000 prtcl=0x0000
Aug  5 13:28:30 goshik /kernel: device names: uhub0
Aug  5 13:28:30 goshik /kernel: usbd: Found action 'USB device' for UHCI root hub, VIA at uhub0
Aug  5 13:28:30 goshik /kernel: usbd: device-attach event at 0.020285000, USB Embedded Hub, A-DATA Technology Inc.:
Aug  5 13:28:30 goshik /kernel: vndr=0x067b prdct=0x2515 rlse=0x0001 clss=0x0009 subclss=0x0000 prtcl=0x0000
Aug  5 13:28:30 goshik /kernel: device names: uhub1
Aug  5 13:28:30 goshik /kernel: usbd: Found action 'USB device' for USB Embedded Hub, A-DATA Technology Inc. at uhub1
Aug  5 13:28:30 goshik /kernel: usbd: device-attach event at 0.023338000, USB Mass Storage Device, A-DATA Technology Inc.:
Aug  5 13:28:30 goshik /kernel: vndr=0x067b prdct=0x2517 rlse=0x0001 clss=0x0000 subclss=0x0000 prtcl=0x0000
Aug  5 13:28:30 goshik /kernel: device names: umass0
Aug  5 13:28:30 goshik /kernel: usbd: Found action 'USB device' for USB Mass Storage Device, A-DATA Technology Inc. at umass0
Aug  5 13:28:30 goshik /kernel: usbd: device-attach event at 0.029601000, UHCI root hub, VIA:
Aug  5 13:28:30 goshik /kernel: vndr=0x0000 prdct=0x0000 rlse=0x0100 clss=0x0009 subclss=0x0000 prtcl=0x0000
Aug  5 13:28:30 goshik /kernel: device names: uhub2
Aug  5 13:28:30 goshik /kernel: usbd: Found action 'USB device' for UHCI root hub, VIA at uhub2
<<<<<<<<<<<<<

The corresponding kernel options:

[...]
# SCSI peripherals
device  scbus  # SCSI bus (required)
device  da  # Direct Access (disks)
device  pass  # CAM passthrough driver

options  CAMDEBUG
#options  CAM_DEBUG_BUS=-1
#options  CAM_DEBUG_TARGET=-1
#options  CAM_DEBUG_LUN=-1
#options  CAM_DEBUG_FLAGS="CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB"
options  SCSI_DELAY=8000 # Be pessimistic about Joe SCSI device
[...]

usbdevs and camcontrol output:

>>>> Script started on Tue Aug  5 13:41:23 2003
goshik# usbdevs -v
Controller /dev/usb0:
addr 1: self powered, config 1, UHCI root hub(0x0000), VIA(0x0000), rev 1.00
 port 1 addr 2: self powered, config 1, USB Embedded Hub(0x2515), A-DATA Technology Inc.(0x067b), rev 0.01
  port 1 addr 3: self powered, config 1, USB Mass Storage Device(0x2517), A-DATA Technology Inc.(0x067b), rev 0.01
 port 2 powered
goshik# usbdevs -vd
Controller /dev/usb0:
addr 1: self powered, config 1, UHCI root hub(0x0000), VIA(0x0000), rev 1.00
  uhub0
 port 1 addr 2: self powered, config 1, USB Embedded Hub(0x2515), A-DATA Technology Inc.(0x067b), rev 0.01
   uhub1
  port 1 addr 3: self powered, config 1, USB Mass Storage Device(0x2517), A-DATA Technology Inc.(0x067b), rev 0.01
    umass0
 port 2 powered
goshik# camcontrol devlist -v
scbus0 on umass-sim0 bus 0:
<A-DATA Flash 2.0 P1.0>            at scbus0 target 0 lun 0 (pass0,da0)
scbus-1 on xpt0 bus 0:
<  >                               at scbus-1 target -1 lun -1 (xpt0)
goshik# camcontrol inquiry da0
pass0: <A-DATA Flash 2.0 P1.0> Removable Direct Access SCSI-0 device
pass0: Serial Number 
pass0: 650KB/s transfers
goshik# exit
exit

>>>> Script done on Tue Aug  5 13:42:17 2003

I tried to add the following quirk to cam/scsi/scsi_da.c
and rebuilt kernel, but nothing changed. (Actually,
i tried also with only DA_Q_NO_6_BYTE, but this didn't help either)

{
  /*
   * A-DATA USB Flash 2.0 P1.0 SpeedDrive
   */
  {T_DIRECT, SIP_MEDIA_REMOVABLE, "A-DATA", "Flash Disk", "*"},
  /*quirks*/ DA_Q_NO_6_BYTE|DA_Q_NO_SYNC_CACHE
}

Can someone help me with this? I don't know what else
to do...

TIA,
Igor



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000b01c35b3a$fb4771a0$ea2ce9c1>