Commit 314dc154 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] Fix IDE bus reset and DMA disable when reading blank DVD-R

From Jon Burgess:

  There is a problems with blank DVD media using the ide-cd driver.

  When we attempt to read the blank disk, the drive responds to the read
  request by returning a "blank media" error.  The kernel doesn't have
  any special case handling for this sense value and retries the request
  a couple of times, then gives up and does a bus reset and disables DMA
  to the device.

  Which obviously doesn't help the situation.

  The sense key value of 8 isn't listed in ide-cd.h, but it is listed in
  scsi.h as a "BLANK_CHECK" error.

  This trivial patch treats this error condition as a reason to abort
  the request.  This behaviour is the same as what we do with a blank CD-R.

  It looks like the same fix might be desired for 2.4 as well, although
  is perhaps not so important since scsi-ide is normally used instead.
parent 3f69168f
...@@ -799,6 +799,10 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) ...@@ -799,6 +799,10 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
* sector... If we got here the error is not correctable */ * sector... If we got here the error is not correctable */
ide_dump_status (drive, "media error (bad sector)", stat); ide_dump_status (drive, "media error (bad sector)", stat);
do_end_request = 1; do_end_request = 1;
} else if (sense_key == BLANK_CHECK) {
/* Disk appears blank ?? */
ide_dump_status (drive, "media error (blank)", stat);
do_end_request = 1;
} else if ((err & ~ABRT_ERR) != 0) { } else if ((err & ~ABRT_ERR) != 0) {
/* Go to the default handler /* Go to the default handler
for other errors. */ for other errors. */
......
...@@ -501,6 +501,7 @@ struct cdrom_info { ...@@ -501,6 +501,7 @@ struct cdrom_info {
#define ILLEGAL_REQUEST 0x05 #define ILLEGAL_REQUEST 0x05
#define UNIT_ATTENTION 0x06 #define UNIT_ATTENTION 0x06
#define DATA_PROTECT 0x07 #define DATA_PROTECT 0x07
#define BLANK_CHECK 0x08
#define ABORTED_COMMAND 0x0b #define ABORTED_COMMAND 0x0b
#define MISCOMPARE 0x0e #define MISCOMPARE 0x0e
...@@ -578,7 +579,7 @@ const char * const sense_key_texts[16] = { ...@@ -578,7 +579,7 @@ const char * const sense_key_texts[16] = {
"Illegal request", "Illegal request",
"Unit attention", "Unit attention",
"Data protect", "Data protect",
"(reserved)", "Blank check",
"(reserved)", "(reserved)",
"(reserved)", "(reserved)",
"Aborted command", "Aborted command",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment