From 6a740c4a4f52ac5aa8a0f35e828d20d0bf0692a8 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 25 Mar 2013 13:58:17 +0000 Subject: [PATCH] Read Asynchronous Notification statuses only if Port Multiplier or ATAPI device are connected. ATA disks are not using ANs, while the extra register read operation is quite expensive. --- sys/dev/ahci/ahci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index c39f9741b1ff..f7dba1ebc33f 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -1466,7 +1466,8 @@ ahci_ch_intr(void *data) if (ch->numrslots != ch->numtslots) cstatus |= ATA_INL(ch->r_mem, AHCI_P_CI); /* Read SNTF in one of possible ways. */ - if (istatus & AHCI_P_IX_SDB) { + if ((istatus & AHCI_P_IX_SDB) && + (ch->pm_present || ch->curr[0].atapi != 0)) { if (ch->caps & AHCI_CAP_SSNTF) sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); else if (ch->fbs_enabled) {