You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qubes-linux-kernel/patches.fixes/sd_liberal_28_sense_invalid...

29 lines
1002 B

From: Oliver Neukum <oneukum@suse.de>
Subject: fix medium presence misdetection in usb storage device
References: bnc#362850
Patch-mainline: not yet
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.
Signed-off-by: Brandon Philips <bphilips@suse.de>
---
drivers/scsi/sd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1390,8 +1390,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;