提交 dfcf7775 编写于 作者: T TARUISI Hiroaki 提交者: James Bottomley

[SCSI] Fix out of spec CD-ROM problem with media change

Some CD-ROMs fail to report a media change correctly.  The specific
one for this patch simply fails to respond to commands, then gives a
UNIT ATTENTION after being reset which returns ASC/ASCQ 28/00.  This
is out of spec behaviour, but add a check in the eat CC/UA on reset
path to catch this case so the CD-ROM will function somewhat properly.

[jejb: fixed up white space and accepted without signoff]
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 2ada7fc5
......@@ -293,8 +293,16 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
* so that we can deal with it there.
*/
if (scmd->device->expecting_cc_ua) {
scmd->device->expecting_cc_ua = 0;
return NEEDS_RETRY;
/*
* Because some device does not queue unit
* attentions correctly, we carefully check
* additional sense code and qualifier so as
* not to squash media change unit attention.
*/
if (sshdr.asc != 0x28 || sshdr.ascq != 0x00) {
scmd->device->expecting_cc_ua = 0;
return NEEDS_RETRY;
}
}
/*
* if the device is in the process of becoming ready, we
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册