[Midnightbsd-cvs] src [9293] trunk/sys/dev/ahci/ahci.c: Read Asynchronous Notification statuses only if Port Multiplier or ATAPI

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Mar 2 18:16:46 EST 2017


Revision: 9293
          http://svnweb.midnightbsd.org/src/?rev=9293
Author:   laffer1
Date:     2017-03-02 18:16:46 -0500 (Thu, 02 Mar 2017)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/sys/dev/ahci/ahci.c

Modified: trunk/sys/dev/ahci/ahci.c
===================================================================
--- trunk/sys/dev/ahci/ahci.c	2017-03-02 23:16:04 UTC (rev 9292)
+++ trunk/sys/dev/ahci/ahci.c	2017-03-02 23:16:46 UTC (rev 9293)
@@ -1593,7 +1593,8 @@
 	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) {



More information about the Midnightbsd-cvs mailing list