diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-12-24 09:23:44 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-12-24 09:23:44 -0500 |
commit | 8606ab094cfe909f83deedf1fac86993d7c9a9ad (patch) | |
tree | 874070ddf54b0cfcc07b191de8255fe26f4ee89c /drivers/ide/ide-cd.c | |
parent | 5744a06134c8f4e77ad14016420aac308c763454 (diff) |
ide-cd: fix 'ireason' reporting in cdrom_pc_intr()
Mask 'ireason' variable so only the valid interrupt reason bits
will be reported on "drive appears confused" error.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 522580f29ddc..c7d77f0ad892 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1446,7 +1446,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) | |||
1446 | return ide_stopped; | 1446 | return ide_stopped; |
1447 | 1447 | ||
1448 | /* Read the interrupt reason and the transfer length. */ | 1448 | /* Read the interrupt reason and the transfer length. */ |
1449 | ireason = HWIF(drive)->INB(IDE_IREASON_REG); | 1449 | ireason = HWIF(drive)->INB(IDE_IREASON_REG) & 0x3; |
1450 | lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); | 1450 | lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); |
1451 | highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); | 1451 | highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); |
1452 | 1452 | ||
@@ -1487,7 +1487,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) | |||
1487 | if (thislen > len) thislen = len; | 1487 | if (thislen > len) thislen = len; |
1488 | 1488 | ||
1489 | /* The drive wants to be written to. */ | 1489 | /* The drive wants to be written to. */ |
1490 | if ((ireason & 3) == 0) { | 1490 | if (ireason == 0) { |
1491 | if (!rq->data) { | 1491 | if (!rq->data) { |
1492 | blk_dump_rq_flags(rq, "cdrom_pc_intr, write"); | 1492 | blk_dump_rq_flags(rq, "cdrom_pc_intr, write"); |
1493 | goto confused; | 1493 | goto confused; |
@@ -1509,7 +1509,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) | |||
1509 | } | 1509 | } |
1510 | 1510 | ||
1511 | /* Same drill for reading. */ | 1511 | /* Same drill for reading. */ |
1512 | else if ((ireason & 3) == 2) { | 1512 | else if (ireason == 2) { |
1513 | if (!rq->data) { | 1513 | if (!rq->data) { |
1514 | blk_dump_rq_flags(rq, "cdrom_pc_intr, read"); | 1514 | blk_dump_rq_flags(rq, "cdrom_pc_intr, read"); |
1515 | goto confused; | 1515 | goto confused; |