diff options
| author | Søren Schmidt <sos@FreeBSD.org> | 2003-09-16 15:21:37 +0000 |
|---|---|---|
| committer | Søren Schmidt <sos@FreeBSD.org> | 2003-09-16 15:21:37 +0000 |
| commit | 855deec44c7f8c8422780eb28b5b21001750f23e (patch) | |
| tree | b4b17b38ad698c14a780e876a03ae3e307350090 /sys/dev/ata/ata-lowlevel.c | |
| parent | 853c84ddf652aa505be2a41b080d62a4cc2fb7bd (diff) | |
Notes
Diffstat (limited to 'sys/dev/ata/ata-lowlevel.c')
| -rw-r--r-- | sys/dev/ata/ata-lowlevel.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c index 8b4bf5c0fa04..9af651dfc849 100644 --- a/sys/dev/ata/ata-lowlevel.c +++ b/sys/dev/ata/ata-lowlevel.c @@ -270,14 +270,28 @@ ata_interrupt(void *data) { struct ata_channel *ch = (struct ata_channel *)data; struct ata_request *request = ch->running; - u_int8_t status; int length; - /* if the channel is idle this interrupt is not for us (shared) */ - if (ch->state == ATA_IDLE) + /* ignore this interrupt if there is no running request */ + if (!request) { + if (ATA_LOCK_CH(ch, ATA_CONTROL)) { + u_int8_t status = ATA_IDX_INB(ch, ATA_STATUS); + u_int8_t error = ATA_IDX_INB(ch, ATA_ERROR); + + if (bootverbose) + ata_printf(ch, -1, + "spurious interrupt - status=0x%02x error=0x%02x\n", + status, error); + ATA_UNLOCK_CH(ch); + } + else { + if (bootverbose) + ata_printf(ch, -1, "spurious interrupt - channel busy\n"); + } return; + } - /* if device is busy it didn't interrupt, ignore interrupt (shared) */ + /* ignore interrupt if device is busy */ if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) { DELAY(100); if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DRQ)) @@ -285,22 +299,7 @@ ata_interrupt(void *data) } /* clear interrupt and get status */ - status = ATA_IDX_INB(ch, ATA_STATUS); - - /* if we dont have a running request shout and ignore this interrupt */ - if (request == NULL) { - if (1 || bootverbose) { - printf("ata%d: spurious interrupt - ", device_get_unit(ch->dev)); - if (request) - printf("request OK - "); - printf("status=0x%02x error=0x%02x reason=0x%02x\n", - status, ATA_IDX_INB(ch, ATA_ERROR), - ATA_IDX_INB(ch, ATA_IREASON)); - } - return; - } - - request->status = status; + request->status = ATA_IDX_INB(ch, ATA_STATUS); switch (request->flags & (ATA_R_ATAPI | ATA_R_DMA)) { |
