svn commit: r229289 - stable/9/sys/dev/ahci
Alexander Motin
mav at FreeBSD.org
Mon Jan 2 17:13:57 UTC 2012
Author: mav
Date: Mon Jan 2 17:13:56 2012
New Revision: 229289
URL: http://svn.freebsd.org/changeset/base/229289
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/9/sys/dev/ahci/ahci.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/amd64/include/xen/ (props changed)
stable/9/sys/boot/ (props changed)
stable/9/sys/boot/i386/efi/ (props changed)
stable/9/sys/boot/ia64/efi/ (props changed)
stable/9/sys/boot/ia64/ski/ (props changed)
stable/9/sys/boot/powerpc/boot1.chrp/ (props changed)
stable/9/sys/boot/powerpc/ofw/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
stable/9/sys/conf/ (props changed)
stable/9/sys/contrib/dev/acpica/ (props changed)
stable/9/sys/contrib/octeon-sdk/ (props changed)
stable/9/sys/contrib/pf/ (props changed)
stable/9/sys/contrib/x86emu/ (props changed)
Modified: stable/9/sys/dev/ahci/ahci.c
==============================================================================
--- stable/9/sys/dev/ahci/ahci.c Mon Jan 2 17:02:45 2012 (r229288)
+++ stable/9/sys/dev/ahci/ahci.c Mon Jan 2 17:13:56 2012 (r229289)
@@ -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-9
mailing list