svn commit: r229290 - in stable/8/sys: conf dev/ahci

Alexander Motin mav at FreeBSD.org
Mon Jan 2 17:16:09 UTC 2012


Author: mav
Date: Mon Jan  2 17:16:08 2012
New Revision: 229290
URL: http://svn.freebsd.org/changeset/base/229290

Log:
  MFC r227635:
  Change the way how "not implemented" AHCI channels handled. Instead of
  completely skipping them, create ahcich devices for them to allocate unit
  numbers, but mark them as disabled to prevent driver probe and attach.
  
  Last time some BIOSes tend to report unused channels as "not implemented".
  This change makes ahcichX devices numbering consistent, independently of
  connected disks. It makes per-channel driver hints usable and CAM devices
  wiring possible on such systems.

Modified:
  stable/8/sys/dev/ahci/ahci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.32   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/ahci/ahci.c
==============================================================================
--- stable/8/sys/dev/ahci/ahci.c	Mon Jan  2 17:13:56 2012	(r229289)
+++ stable/8/sys/dev/ahci/ahci.c	Mon Jan  2 17:16:08 2012	(r229290)
@@ -498,13 +498,14 @@ ahci_attach(device_t dev)
 	}
 	/* Attach all channels on this controller */
 	for (unit = 0; unit < ctlr->channels; unit++) {
-		if ((ctlr->ichannels & (1 << unit)) == 0)
-			continue;
 		child = device_add_child(dev, "ahcich", -1);
-		if (child == NULL)
+		if (child == NULL) {
 			device_printf(dev, "failed to add channel device\n");
-		else
-			device_set_ivars(child, (void *)(intptr_t)unit);
+			continue;
+		}
+		device_set_ivars(child, (void *)(intptr_t)unit);
+		if ((ctlr->ichannels & (1 << unit)) == 0)
+			device_disable(child);
 	}
 	bus_generic_attach(dev);
 	return 0;


More information about the svn-src-stable-8 mailing list