Skip to contentSkip to conversation

liberal acceptance of 0x28 asc in sd.c

PATCH In review Oliver Neukum 2 participants 3 messages Oct 30, 2008 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 liberal acceptance of 0x28 asc in sd.c

Hi,

Quoted 1 line

From reading the SCSI spec it seems that having the valid bit 0 (0x70

checked in scsi_sense_valid) should does not invalidate the ASC or ASQ. [See page 37 of spc4r02.pdf]. It should only invalidate the INFORMATION field. Therefore remove the sense_valid check from the USB quirk.

This is needed for a strange USB storage device.

---

drivers/scsi/sd.c +1 -2
index e5e7d78..ac119a0 100644
@@ -1204,8 +1204,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)
 		 * Yes, this sense key/ASC combination shouldn't
 		 * occur here.  It's characteristic of these devices.
 		 */
-		} else if (sense_valid &&
-				sshdr.sense_key == UNIT_ATTENTION &&
+		} else if (sshdr.sense_key == UNIT_ATTENTION &&
 				sshdr.asc == 0x28) {
 			if (!spintime) {
 				spintime_expire = jiffies + 5 * HZ;
maintainer
#1 lore raw
Quoted 3 lines · Oliver Neukum
Quoted 1 line

From reading the SCSI spec it seems that having the valid bit 0 (0x70

checked in scsi_sense_valid) should does not invalidate the ASC or ASQ. [See page 37 of spc4r02.pdf].

That's a correct reading of the spec as regards the valid bit for non descriptor sense data, but not applicable to this situation. sense_valid is generated from (byte[0] & 0x70 == 0x70) (see scsi_sense_valid() in include/scsi/scsi_eh.h) not from the valid bit. This test is *required* by the standard otherwise what we have isn't sense data.

Quoted 4 lines

It should only invalidate the INFORMATION
field. Therefore remove the sense_valid check from the USB quirk.

This is needed for a strange USB storage device.

Could you elaborate a bit more? What's its problem (and what is it replying as byte 0 to a REQUEST_SENSE)?

Also:

Quoted 2 lines

These signoffs don't make sense for what you sent ... this implies that its Brandon's patch which you altered, in which case it needs a From: at the beginning to make him the author.

James

#2 lore raw

Am Donnerstag, 30. Oktober 2008 15:01:13 schrieb James Bottomley:

Quoted 11 lines · Oliver Neukum
Quoted 3 lines
Quoted 1 line

From reading the SCSI spec it seems that having the valid bit 0 (0x70

checked in scsi_sense_valid) should does not invalidate the ASC or ASQ. [See page 37 of spc4r02.pdf].

That's a correct reading of the spec as regards the valid bit for non descriptor sense data, but not applicable to this situation. sense_valid is generated from (byte[0] & 0x70 == 0x70) (see scsi_sense_valid() in include/scsi/scsi_eh.h) not from the valid bit. This test is *required* by the standard otherwise what we have isn't sense data.

Quoted 7 lines
Quoted 4 lines

It should only invalidate the INFORMATION
field. Therefore remove the sense_valid check from the USB quirk.

This is needed for a strange USB storage device.

Could you elaborate a bit more? What's its problem (and what is it replying as byte 0 to a REQUEST_SENSE)?

I got a report about a storage device that reports 0x28 and scsi_sense_valid() returns false.

Quoted 6 lines
Quoted 2 lines

These signoffs don't make sense for what you sent ... this implies that its Brandon's patch which you altered, in which case it needs a From: at the beginning to make him the author.

I wrote it.

Regards
Oliver