From 3c198486dc571326bb7245d03480f1f181bf367f Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 13 Aug 2008 16:09:40 +0000 Subject: [PATCH] Attach the cpufreq child devices with specific orders to enforce relative priority of some of the drivers that manage the same state (e.g. ichss0 vs est0). Specifically, powernow, est, and p4tcc are added at order 10, ichss at order 20, and smist at order 30. Previously, some laptops were seeing both ichss0 and est0 attaching and stomping on each other. XXX: This isn't quite ideal, but works with the existing hacks, I think what we really want instead is a single "speedstep0" device for CPUs that the ichss, est, and smist drivers probe (but with differing priorities). MFC after: 1 week --- sys/dev/cpufreq/ichss.c | 2 +- sys/i386/cpufreq/est.c | 2 +- sys/i386/cpufreq/p4tcc.c | 2 +- sys/i386/cpufreq/powernow.c | 2 +- sys/i386/cpufreq/smist.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/cpufreq/ichss.c b/sys/dev/cpufreq/ichss.c index 179886e0e162..fc7f0acd3d1e 100644 --- a/sys/dev/cpufreq/ichss.c +++ b/sys/dev/cpufreq/ichss.c @@ -181,7 +181,7 @@ ichss_identify(driver_t *driver, device_t parent) } DPRINT("ichss: PMBASE is %#x\n", pmbase); - child = BUS_ADD_CHILD(parent, 0, "ichss", 0); + child = BUS_ADD_CHILD(parent, 20, "ichss", 0); if (child == NULL) { device_printf(parent, "add SpeedStep child failed\n"); return; diff --git a/sys/i386/cpufreq/est.c b/sys/i386/cpufreq/est.c index ac99e040257b..8732cbd68e16 100644 --- a/sys/i386/cpufreq/est.c +++ b/sys/i386/cpufreq/est.c @@ -967,7 +967,7 @@ est_identify(driver_t *driver, device_t parent) * We add a child for each CPU since settings must be performed * on each CPU in the SMP case. */ - child = BUS_ADD_CHILD(parent, 0, "est", -1); + child = BUS_ADD_CHILD(parent, 10, "est", -1); if (child == NULL) device_printf(parent, "add est child failed\n"); } diff --git a/sys/i386/cpufreq/p4tcc.c b/sys/i386/cpufreq/p4tcc.c index 4dc206a9e075..10236ec32daf 100644 --- a/sys/i386/cpufreq/p4tcc.c +++ b/sys/i386/cpufreq/p4tcc.c @@ -131,7 +131,7 @@ p4tcc_identify(driver_t *driver, device_t parent) * of the IA32 Intel Architecture Software Developer's Manual, * Volume 3, for more info. */ - if (BUS_ADD_CHILD(parent, 0, "p4tcc", -1) == NULL) + if (BUS_ADD_CHILD(parent, 10, "p4tcc", -1) == NULL) device_printf(parent, "add p4tcc child failed\n"); } diff --git a/sys/i386/cpufreq/powernow.c b/sys/i386/cpufreq/powernow.c index b9b6310f0af2..34b40cc4a84a 100644 --- a/sys/i386/cpufreq/powernow.c +++ b/sys/i386/cpufreq/powernow.c @@ -894,7 +894,7 @@ pn_identify(driver_t *driver, device_t parent) } if (device_find_child(parent, "powernow", -1) != NULL) return; - if ((child = BUS_ADD_CHILD(parent, 0, "powernow", -1)) == NULL) + if ((child = BUS_ADD_CHILD(parent, 10, "powernow", -1)) == NULL) device_printf(parent, "powernow: add child failed\n"); } diff --git a/sys/i386/cpufreq/smist.c b/sys/i386/cpufreq/smist.c index 2e41ed7d3444..d174427dc322 100644 --- a/sys/i386/cpufreq/smist.c +++ b/sys/i386/cpufreq/smist.c @@ -308,7 +308,7 @@ smist_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "smist", -1) != NULL) return; - if (BUS_ADD_CHILD(parent, 0, "smist", -1) == NULL) + if (BUS_ADD_CHILD(parent, 30, "smist", -1) == NULL) device_printf(parent, "smist: add child failed\n"); }