diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2014-01-15 15:37:04 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-15 13:19:22 -0400 |
commit | 7aae51347b21eb738dc1981df1365b57a6c5ee4e (patch) | |
tree | 672205f278c8a2a1d9cbd236621ae1743b3c23d9 /drivers/scsi/sd.c | |
parent | aed97b8b8194e818a94cc5ce5662f19b8bdd8adc (diff) |
[SCSI] sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE
Evidently some wacky USB-ATA bridges don't recognize the SYNCHRONIZE
CACHE command, as shown in this email thread:
http://marc.info/?t=138978356200002&r=1&w=2
The fact that we can't tell them to drain their caches shouldn't
prevent the system from going into suspend. Therefore sd_sync_cache()
shouldn't return an error if the device replies with an Invalid
Command ASC.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Sven Neumann <s.neumann@raumfeld.com>
Tested-by: Daniel Mack <zonque@gmail.com>
CC: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 470954aba728..36d1a23f14be 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1463,8 +1463,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp) | |||
1463 | sd_print_sense_hdr(sdkp, &sshdr); | 1463 | sd_print_sense_hdr(sdkp, &sshdr); |
1464 | /* we need to evaluate the error return */ | 1464 | /* we need to evaluate the error return */ |
1465 | if (scsi_sense_valid(&sshdr) && | 1465 | if (scsi_sense_valid(&sshdr) && |
1466 | /* 0x3a is medium not present */ | 1466 | (sshdr.asc == 0x3a || /* medium not present */ |
1467 | sshdr.asc == 0x3a) | 1467 | sshdr.asc == 0x20)) /* invalid command */ |
1468 | /* this is no error here */ | 1468 | /* this is no error here */ |
1469 | return 0; | 1469 | return 0; |
1470 | 1470 | ||