Re: scsi-sd fails with error "Invalid field in cdb" for SATA-to-USB adapter JMicron

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

 



On 2015-11-17 19:18, Alan Stern wrote:
> That line is completely inappropriate for uas; it applies only to 
> usb-storage.  Don't add it.

I got it. My first thought was like you have said (every module uses its
own structure), but I blindly tried to guess.

> Here you need to test devinfo->flags & US_FL_BROKEN_FUA.

Great, that worked!

scsi host6: uas
scsi 6:0:0:0: Direct-Access     JMicron  Generic   0116 PQ: 0 ANSI: 6
sd 6:0:0:0: Attached scsi generic sg2 type 0
sd 6:0:0:0: [sdb] 312581808 512-byte logical blocks: (160 GB/149 GiB)
sd 6:0:0:0: [sdb] 4096-byte physical blocks
sd 6:0:0:0: [sdb] Write Protect is off
sd 6:0:0:0: [sdb] Mode Sense: 53 00 10 08
sd 6:0:0:0: [sdb] Disabling FUA
sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sd 6:0:0:0: [sdb] Attached SCSI disk

>> The show-stopper for me is to know, how the us->fflags is initialized
>> from list of "unusual devices". There is some magic in there, at least
>> this is not something on the surface. I can't get how the definition of
>> these unusual devices is shared between scsiglue.c and uas.c, basically,
>> where is the code that matches the USB vendor/product and sets
>> us->fflags. That code should be called before uas.c:
>> uas_slave_configure():792.
> 
> The code that sets devinfo->flags is in uas_probe().  The flags value 
> comes from uas_use_uas_driver() in uas_detect.h.  The table used by uas 
> is stored in unusual_uas.h, not unusual_devs.h, so you'll have to add a 
> completely new entry there.
> 
> Actually, you should modify both unusual_*.h files, because someone 
> might want to use that device with the usb-storage driver rather than 
> the uas driver.

Actually there is an entry in unusual_uas.h but there is a minor difference:

unusual_uas.h uses  UNUSUAL_DEV(0x152d, 0x0567, 0x0000, 0x9999, ...
unusual_devs.h uses UNUSUAL_DEV(0x152d, 0x0567, 0x0114, 0x0116, ...

so uas module captures the wider set of devices (effectively ignores
bcdDevice). Should it be left like that (then behaviour could be
different for usb-storage vs uas driver) or it makes sense to align
these two?

-- 
With best regards,
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux