From c269e21049464b2cb2058f10736ec6e5c0be1a7e Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Fri, 23 Oct 2009 13:07:22 +0000 Subject: [PATCH] Revert interrupt reason check order back. ATAPI errors may set IF bit together with TFE. --- sys/dev/ahci/ahci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 485ac3d5ce4b..0a2472e77977 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -1001,12 +1001,7 @@ ahci_ch_intr(void *data) /* XXX: reqests in loading state. */ if (((err >> i) & 1) == 0) continue; - if (istatus & AHCI_P_IX_IF) { - if (ch->numtslots == 0 && i != ccs) - et = AHCI_ERR_INNOCENT; - else - et = AHCI_ERR_SATA; - } else if (istatus & AHCI_P_IX_TFE) { + if (istatus & AHCI_P_IX_TFE) { /* Task File Error */ if (ch->numtslots == 0) { /* Untagged operation. */ @@ -1019,6 +1014,11 @@ ahci_ch_intr(void *data) et = AHCI_ERR_NCQ; ncq_err = 1; } + } else if (istatus & AHCI_P_IX_IF) { + if (ch->numtslots == 0 && i != ccs) + et = AHCI_ERR_INNOCENT; + else + et = AHCI_ERR_SATA; } else et = AHCI_ERR_INVALID; ahci_end_transaction(&ch->slot[i], et);