[Midnightbsd-cvs] src [8660] trunk/sys/dev/ata/ata-sata.c: add checks for ata_scr_read return statuses

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 16:27:24 EDT 2016


Revision: 8660
          http://svnweb.midnightbsd.org/src/?rev=8660
Author:   laffer1
Date:     2016-09-25 16:27:24 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
add checks for ata_scr_read return statuses

Modified Paths:
--------------
    trunk/sys/dev/ata/ata-sata.c

Modified: trunk/sys/dev/ata/ata-sata.c
===================================================================
--- trunk/sys/dev/ata/ata-sata.c	2016-09-25 20:26:57 UTC (rev 8659)
+++ trunk/sys/dev/ata/ata-sata.c	2016-09-25 20:27:24 UTC (rev 8660)
@@ -53,7 +53,8 @@
     struct ata_channel *ch = device_get_softc(dev);
     u_int32_t error, status;
 
-    ata_sata_scr_read(ch, port, ATA_SERROR, &error);
+    if (ata_sata_scr_read(ch, port, ATA_SERROR, &error))
+	return;
 
     /* Check that SError value is sane. */
     if (error == 0xffffffff)
@@ -66,8 +67,9 @@
     /* if we have a connection event deal with it */
     if ((error & ATA_SE_PHY_CHANGED) && (ch->pm_level == 0)) {
 	if (bootverbose) {
-	    ata_sata_scr_read(ch, port, ATA_SSTATUS, &status);
-	    if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) &&
+	    if (ata_sata_scr_read(ch, port, ATA_SSTATUS, &status)) {
+		    device_printf(dev, "PHYRDY change\n");
+	    } else if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) &&
 		((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) &&
 		((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) {
 		    device_printf(dev, "CONNECT requested\n");



More information about the Midnightbsd-cvs mailing list