提交 7aae5134 编写于 作者: A Alan Stern 提交者: James Bottomley

[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: NAlan Stern <stern@rowland.harvard.edu>
Reported-by: NSven Neumann <s.neumann@raumfeld.com>
Tested-by: NDaniel Mack <zonque@gmail.com>
CC: <stable@vger.kernel.org>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 aed97b8b
...@@ -1463,8 +1463,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp) ...@@ -1463,8 +1463,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
sd_print_sense_hdr(sdkp, &sshdr); sd_print_sense_hdr(sdkp, &sshdr);
/* we need to evaluate the error return */ /* we need to evaluate the error return */
if (scsi_sense_valid(&sshdr) && if (scsi_sense_valid(&sshdr) &&
/* 0x3a is medium not present */ (sshdr.asc == 0x3a || /* medium not present */
sshdr.asc == 0x3a) sshdr.asc == 0x20)) /* invalid command */
/* this is no error here */ /* this is no error here */
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册