USB serial regression 2.6.31.1 -> 2.6.31.2
Quoted 11 lines · ----- "Alan Stern
The device presented two LUNs on the mass-storage interface. LUN 0 was
the emulated CDROM (named "Mass Storage") and LUN 1 was direct-access(named "SD Storage"). LUN 0 appeared to work normally, although it reported Not Ready, No Medium Present errors. LUN 1 did the same thing, but in its response to the REQUEST SENSE command it set the additional-sense-length byte to
0x12instead of0x0a, for no apparent reason. This caused usb-storage to assume the device supported SANE SENSE, which presumably it doesn't.
<SNIP>
Quoted 13 lines
Thus the two bugs in the Huawei device are: Incorrect additional-sense-length byte for LUN 1, and incorrect CSW for a 96-byte
REQUEST SENSE on LUN 1.I can see two approaches for working around this. The first is to make
the SENSE SENSE test more discriminating. For example, test for additional-sense-length values larger than0x12instead of larger than0x0a. Ben Efros, would this be acceptable?
Quoted 4 lines
The second approach is to add a
SINGLE_LUNflag to all the Huawei entries inunusual_devs.h. It's not clear that this is a good idea; if one of those devices really does have an SD card then people might want to be able to use it.
Most SAT devices will never set an additional sense length value higher than 0x0e on the Descriptor Format Sense Data when returning an ATA Return Descriptor. I'd prefer not to arbitrarily set the range check to be > 0x12 for SANE_SENSE to kick in. If that is the ultimate solution, then I'd rather see the whole SANE_SENSE detection if-block removed in its entirely. I really don't think that will be necessary.
Both proposed solutions seem to have their drawbacks. Maybe its time to start noting buggy devices that are known to be "insane" in regards to sense data. If the device has usb flag "INSANE_SENSE" then we'll never ever set SANE_SENSE.
Ben Herrenschmidt's patch[1] to retry without SANE_SENSE might be combined be able to be used to detect this 'INSANE_SENSE' scenario, but not in its current form.
Devices lying about the "additional sense length" doesn't seem all that common, so it might be better to just flag the device as insane and not worry about reworking Ben Herrenschmidt's patch.
Quoted 8 lines · Ben Efros
Ben Herrenschmidt's patch[1] to retry without
SANE_SENSEmight be combined be able to be used to detect this 'INSANE_SENSE' scenario, but not in its current form.Devices lying about the "additional sense length" doesn't seem all that common, so it might be better to just flag the device as insane and not worry about reworking Ben Herrenschmidt's patch.
I don't like flagging devices ... though we already somewhat do it for the mode switch so it would be possible to stick the flag there.
Another option is to set the insane flag from a retry path similar to what I posted so that it doesn't ping pong.
In any case, a decision should be made soon as current -stable is broken and these devices are very common.
Cheers,
Ben.