summaryrefslogtreecommitdiff
path: root/linux/dev/drivers
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2006-01-26 14:25:49 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:26:30 +0200
commitb946deee920ef00d65d675ad5d0b6e44884e5c62 (patch)
treedc60157d41a7c1b2a59d2ed4a6b7ead5602e9087 /linux/dev/drivers
parent7b40a0341368d20be9ae7060d35f1310224d70fb (diff)
2006-01-26 Samuel Thibault <samuel.thibault@ens-lyon.org>
* linux/dev/drivers/block/ide.c (read_intr): Set the IRQ handler before issuing a request. (write_intr): Likewise. (multwrite_intr): Likewise.
Diffstat (limited to 'linux/dev/drivers')
-rw-r--r--linux/dev/drivers/block/ide.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linux/dev/drivers/block/ide.c b/linux/dev/drivers/block/ide.c
index 3be7787..5dcd0aa 100644
--- a/linux/dev/drivers/block/ide.c
+++ b/linux/dev/drivers/block/ide.c
@@ -1129,6 +1129,9 @@ read_next:
msect -= nsect;
} else
nsect = 1;
+ i = rq->nr_sectors - nsect;
+ if (i > 0 && !msect)
+ ide_set_handler (drive, &read_intr, WAIT_CMD);
ide_input_data(drive, rq->buffer, nsect * SECTOR_WORDS);
#ifdef DEBUG
printk("%s: read: sectors(%ld-%ld), buffer=0x%08lx, remaining=%ld\n",
@@ -1138,14 +1141,11 @@ read_next:
rq->sector += nsect;
rq->buffer += nsect<<9;
rq->errors = 0;
- i = (rq->nr_sectors -= nsect);
+ rq->nr_sectors = i;
if ((rq->current_nr_sectors -= nsect) <= 0)
ide_end_request(1, HWGROUP(drive));
- if (i > 0) {
- if (msect)
- goto read_next;
- ide_set_handler (drive, &read_intr, WAIT_CMD);
- }
+ if (i > 0 && msect)
+ goto read_next;
}
/*
@@ -1173,8 +1173,8 @@ static void write_intr (ide_drive_t *drive)
if (rq->current_nr_sectors <= 0)
ide_end_request(1, hwgroup);
if (i > 0) {
- ide_output_data (drive, rq->buffer, SECTOR_WORDS);
ide_set_handler (drive, &write_intr, WAIT_CMD);
+ ide_output_data (drive, rq->buffer, SECTOR_WORDS);
}
return;
}
@@ -1231,8 +1231,8 @@ static void multwrite_intr (ide_drive_t *drive)
if (OK_STAT(stat=GET_STAT(),DRIVE_READY,drive->bad_wstat)) {
if (stat & DRQ_STAT) {
if (rq->nr_sectors) {
- ide_multwrite(drive, drive->mult_count);
ide_set_handler (drive, &multwrite_intr, WAIT_CMD);
+ ide_multwrite(drive, drive->mult_count);
return;
}
} else {