Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2008 15:58:02 +0200
From:      Andriy Gapon <avg@icyb.net.ua>
To:        freebsd-usb@freebsd.org
Cc:        Warner Losh <imp@FreeBSD.org>
Subject:   Re: scsi_da quirk for a device with "no name"
Message-ID:  <4798996A.8090205@icyb.net.ua>
In-Reply-To: <46C44170.3040108@icyb.net.ua>
References:  <46C44170.3040108@icyb.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

This is me again on the issue of a weird umass device that reports empty
strings to SCSI inquiry command. Currently the only way to specify some
SCSI-level quirk for such a device is to create a quirk entry with all
fields set to wildcard "*", but apparently such a quirk would be applied
to many more devices.
A suggestion: what about umass intercepting a response of inquiry
command and generating some names in such a case. E.g. vendor and
product identification could be generated from the USB ids like
Vendor_abcd, Product_1234.
In this case we would get some sufficient identification for such devices.

P.S. it also seems that if NO_INQUIRY umass quirk is specified for a
device, then its identification will be empty as well. I think that this
is not good because, for example, scsi_da quirks are troublesome then.

P.P.S. it is currently impossible to have scsi_da quirk entries with
empty fields (""), they get ignored.

on 16/08/2007 15:22 Andriy Gapon said the following:
> I have ASUS P535 PPC+phone with Windows Mobile 5 on it.
> It has an option to act as a USB mass storage (instead of attempting
> acivesync).
> 
> When I tried it, it first got recognized by umass and then it
> immediately panicked my system.
> 
> From messages:
> kernel: umass0: ASUS Generic Mass Storage, rev 2.00/0.00, addr 3
> kernel: da0 at umass-sim0 bus 0 target 0 lun 0
> kernel: da0: <  > Removable Direct Access SCSI-0 device
> kernel: da0: 1.000MB/s transfers
> kernel: da0: 1952MB (3998720 512 byte sectors: 255H 63S/T 248C)
> 
> From panic (typed from memory):
> umass0: Invalid CSW: tag 7 should be 8
> (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x0, scsi
> status == 0x4
> 
> I googled up several reports of similar and not so similar panics.
> Here's a small overview that is not directly related to a question that
> I really want to ask:
> 
> 1. Invalid CSW problems where a signature is wrong, I see that
> WRONG_CSWSIG umass quirk is recommended for that;
> 2. Invalid CSW problems where a tag is wrong and the values are very
> different, I see that one person attempted to cure that with a new
> hand-rolled quirk to simply ignore the mismatch;
> 3. Invalid CSW problems where a tag is wrong and the difference is
> exactly one. I don't know if there is anything special about that, but
> it looks the most interesting of all the cases.
> 
> In some cases but not all "Invalid CSW" comes together with "Synchronize
> cache failed" and DA_Q_NO_SYNC_CACHE scsi_da quirk is recommended for that.
> 
> So I attempted the latter quirk and it helped me! But there is one not
> good thing about the way I did that - I used wild cards ("*") for all
> three of vendor, product and revision. This is because they all appear
> to be empty/unset. This is shown in both kernel messages and by
> camcontrol devlist and by camcontrol inquiry.
> I am not sure if there are any risks of applying the quirk to all
> possible da devices, there will be only umass ones in my case, but I
> still would like to do something more specific to the device in question.
> 
> Will empty patterns work ? I mean if I put "", "", "" entry into the
> quirk array. Actually, I can test this myself soon, but not today.
> 
> Thank you.
> 
> P.S. some links to the problems that others have reported:
> http://www.freebsd.org/cgi/query-pr.cgi?pr=114916&cat=
> http://osdir.com/ml/os.freebsd.devel.usb/2005-12/msg00039.html
> http://lists.freebsd.org/pipermail/freebsd-bugs/2004-November/010483.html
> http://lists.freebsd.org/pipermail/freebsd-bugs/2004-January/005170.html
> http://lists.freebsd.org/mailman/htdig/freebsd-usb/2004-December/000318.html
> http://lists.freebsd.org/mailman/htdig/freebsd-usb/2005-February/000660.html
> 


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4798996A.8090205>