svn commit: r220911 - head/sys/dev/ata

Alexander Motin mav at FreeBSD.org
Thu Apr 21 07:26:14 UTC 2011


Author: mav
Date: Thu Apr 21 07:26:14 2011
New Revision: 220911
URL: http://svn.freebsd.org/changeset/base/220911

Log:
  Make PATA-like soft-reset in ata(4) more strict in checking disk signature.
  It allows to avoid false positive device detection under Xen, that caused
  long probe delays due to subsequent IDENTIFY command timeouts.
  
  MFC after:	1 month

Modified:
  head/sys/dev/ata/ata-lowlevel.c

Modified: head/sys/dev/ata/ata-lowlevel.c
==============================================================================
--- head/sys/dev/ata/ata-lowlevel.c	Thu Apr 21 07:14:10 2011	(r220910)
+++ head/sys/dev/ata/ata-lowlevel.c	Thu Apr 21 07:26:14 2011	(r220911)
@@ -535,7 +535,7 @@ ata_generic_reset(device_t dev)
 		    if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
 			ch->devices |= ATA_ATAPI_MASTER;
 		    }
-		    else if (stat0 & ATA_S_READY) {
+		    else if (lsb == 0 && msb == 0 && (stat0 & ATA_S_READY)) {
 			ch->devices |= ATA_ATA_MASTER;
 		    }
 		}
@@ -568,7 +568,7 @@ ata_generic_reset(device_t dev)
 		    if (lsb == ATAPI_MAGIC_LSB && msb == ATAPI_MAGIC_MSB) {
 			ch->devices |= ATA_ATAPI_SLAVE;
 		    }
-		    else if (stat1 & ATA_S_READY) {
+		    else if (lsb == 0 && msb == 0 && (stat1 & ATA_S_READY)) {
 			ch->devices |= ATA_ATA_SLAVE;
 		    }
 		}


More information about the svn-src-all mailing list