tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Adding an entry to src/sys/dev/usb/umass_quirks.c

Hi all.

Whenever I connected a USB stick device to the computer, I get the
following messages:

    sd5 at scsibus2 target 0 lun 0: <Kingston, DataTraveler 2.0, 1.00> disk 
    sd5: fabricating a geometry
    sd5: 15269 MB, 15269 cyl, 64 head, 32 sec, 512 bytes/sect x 31272544 sectors
    sd5(umass2:0:0:0): generic HBA error
    sd5: unable to open device, error = 5

After talking to some #NetBSD guys (at freenode), we concluded that the
device would misinforming some stuff to the system.  In cases like that,
adding an entry to the quirks table may fix the problem.  After some
search, I discovered that quirks table for umass devices in NetBSD is in
src/sys/dev/usb/umass_quirks.c.  There, we read in a commentary:

    * PLEASE NOTE that if you want quirk entries added to this table, you MUST
    * compile a kernel with USB_DEBUG, and submit a full log of the output from
    * whatever operation is "failing" with ?hcidebug=20 or higher and
    * umassdebug=0xffffff.  (It's usually helpful to also set MSGBUFSIZE to
    * something "large" unless you're using a serial console.)  Without this

So, I changed the variables values and compiled a new kernel as
instructed.  After booting the new kernel, I got a huge amount of debug
messages, that I got with dmesg > dmesg.txt and put here:

Maybe the relevant parts are those:

    umass1: Handling BBB state 4 (BBB CSW, 1st attempt), xfer=0xc498cc00, 
    umass1: CSW 103: sig = 0x53425355 (valid), tag = 103, res = 32, status = 
0x01 (failed)
    umass1: Command Failed, res = 32
    umass1: Autosense failed, status 2
    ehci_idone: ex=0xc498cc00 done
    sd4(umass1:0:0:0): generic HBA error


    umass1: Handling BBB state 1 (BBB CBW), xfer=0xc488ac00, NORMAL_COMPLETION
    umass1: no data phase


    umass1: Handling BBB state 4 (BBB CSW, 1st attempt), xfer=0xc498cc00, 
    umass1: CSW 104: sig = 0x53425355 (valid), tag = 104, res = 0, status = 
0x00 (good)
    ehci_idone: ex=0xc498cc00 done
    sd4: unable to open device, error = 5

What do you think?

Is something lacking in the quirks table that I can't use my USB stick?
If yes, how can I interpret the debug messages correctly so I can add an

Thank you very much.

Silas Silva

Home | Main Index | Thread Index | Old Index