summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-lowlevel.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ata/ata-lowlevel.c')
-rw-r--r--sys/dev/ata/ata-lowlevel.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index 67ed3d1..740f5b7 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -359,6 +359,9 @@ ata_interrupt(void *data)
min((request->bytecount - request->donecount),
request->transfersize);
+ /* clear interrupt seen flag as we need to wait again */
+ request->flags &= ~ATA_R_INTR_SEEN;
+
/* if data write command, output the data */
if (request->flags & ATA_R_WRITE) {
@@ -510,19 +513,15 @@ ata_interrupt(void *data)
break;
}
- /* if we timed out, we hold on to the channel, ata_reinit() will unlock */
- if (request->flags & ATA_R_TIMEOUT) {
- ata_finish(request);
- return;
+ /* if we timed out the unlocking of the ATA channel is done later */
+ if (!(request->flags & ATA_R_TIMEOUT)) {
+ ch->running = NULL;
+ ATA_UNLOCK_CH(ch);
+ ch->locking(ch, ATA_LF_UNLOCK);
}
/* schedule completition for this request */
ata_finish(request);
-
- /* unlock the ATA channel for new work */
- ch->running = NULL;
- ATA_UNLOCK_CH(ch);
- ch->locking(ch, ATA_LF_UNLOCK);
}
/* must be called with ATA channel locked */
OpenPOWER on IntegriCloud