aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorTARUISI Hiroaki <taruishi.hiroak@jp.fujitsu.com>2011-08-11 07:25:20 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-08-27 10:36:41 -0400
commitdfcf7775815504d13a1d273073810058caf84b9d (patch)
tree148e02241525e2a14df6c7e8b2dc0af455344f44 /drivers/scsi/scsi_error.c
parent2ada7fc5d4c4ddeb15bb624045fa3b36ddc025e6 (diff)
[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: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index a4b9cdbaaa0b..dc6131e6a1ba 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -293,8 +293,16 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
293 * so that we can deal with it there. 293 * so that we can deal with it there.
294 */ 294 */
295 if (scmd->device->expecting_cc_ua) { 295 if (scmd->device->expecting_cc_ua) {
296 scmd->device->expecting_cc_ua = 0; 296 /*
297 return NEEDS_RETRY; 297 * Because some device does not queue unit
298 * attentions correctly, we carefully check
299 * additional sense code and qualifier so as
300 * not to squash media change unit attention.
301 */
302 if (sshdr.asc != 0x28 || sshdr.ascq != 0x00) {
303 scmd->device->expecting_cc_ua = 0;
304 return NEEDS_RETRY;
305 }
298 } 306 }
299 /* 307 /*
300 * if the device is in the process of becoming ready, we 308 * if the device is in the process of becoming ready, we