aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-05 15:42:26 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-11-05 15:42:26 -0500
commit320112bd28d3c477f6990bfe8762ccb978106a08 (patch)
treeb0b4236d3284a73c6986dc3dfdbf26eac1dbaf7b /drivers/ide
parentf7d7f3fd21f06c1f07d1dc9e2cc8a3c43b53faa6 (diff)
ide: check rq->cmd_type in drive_cmd_intr()
drive_cmd_intr() is used by both REQ_TYPE_ATA_CMD and REQ_TYPE_ATA_TASK but commands using PIO-in protocol are valid only for REQ_TYPE_ATA_CMD (&args[4] in case of REQ_TYPE_ATA_TASK points to a value for IDE_LCYL_REG register instead of the data buffer). This fix allows REQ_TYPE_ATA_TASK commands to use non-zero values for IDE_SECTOR_REG (args[3]). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c89f0d3058e9..e04967ac25b6 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -654,7 +654,8 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
654 int retries = 10; 654 int retries = 10;
655 655
656 local_irq_enable_in_hardirq(); 656 local_irq_enable_in_hardirq();
657 if ((stat & DRQ_STAT) && args && args[3]) { 657 if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
658 (stat & DRQ_STAT) && args && args[3]) {
658 u8 io_32bit = drive->io_32bit; 659 u8 io_32bit = drive->io_32bit;
659 drive->io_32bit = 0; 660 drive->io_32bit = 0;
660 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS); 661 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);