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.
This commit is contained in:
Alexander Motin 2013-03-25 13:58:17 +00:00
parent cd08290b48
commit 6a740c4a4f

View File

@ -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) {