Skip to content

Commit

Permalink
[SCSI] Fix out of spec CD-ROM problem with media change
Browse files Browse the repository at this point in the history
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: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
TARUISI Hiroaki authored and James Bottomley committed Aug 27, 2011
1 parent 2ada7fc commit dfcf777
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfcf777

Please sign in to comment.