From owner-freebsd-acpi@FreeBSD.ORG Thu Jun 21 13:50:32 2012 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02F301065673; Thu, 21 Jun 2012 13:50:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id CA34C8FC0C; Thu, 21 Jun 2012 13:50:31 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 344D2B983; Thu, 21 Jun 2012 09:50:31 -0400 (EDT) From: John Baldwin To: freebsd-acpi@freebsd.org Date: Thu, 21 Jun 2012 09:50:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <1340121728.5203.8.camel@powernoodle> <1340210648.2858.9.camel@powernoodle.corp.yahoo.com> <1340234916.2858.29.camel@powernoodle.corp.yahoo.com> In-Reply-To: <1340234916.2858.29.camel@powernoodle.corp.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201206210950.23259.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 21 Jun 2012 09:50:31 -0400 (EDT) Cc: Sean Bruno Subject: Re: [CFT] Sparse Cstate Support -- Its possible, that I don't know what I'm doing. X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 13:50:32 -0000 On Wednesday, June 20, 2012 7:28:36 pm Sean Bruno wrote: > On Wed, 2012-06-20 at 09:44 -0700, Sean Bruno wrote: > > On Tue, 2012-06-19 at 09:02 -0700, Sean Bruno wrote: > > > http://people.freebsd.org/~sbruno/acpi_cpu_cstate_sparse.txt > > > > also, I wanted to point out that I'm returning BUS_PROBE_GENERIC here. > > > > I want to emulate the Intel acpi_idle code that exists in linux-land and > > I *thought* that I could setup an acpi_cpu_idle module that would come > > in at a higher priority on Intel cpus, however there's some SYSINIT() > > hackery going on that I don't know how to handle gracefully. I'm not > > sure how to proceed with a different idle module here. thoughts? > > > > e.g. > > > > static void > > acpi_cpu_postattach(void *unused __unused) > > { > > device_t *devices; > > int err; > > int i, n; > > > > err = devclass_get_devices(acpi_cpu_devclass, &devices, &n); > > if (err != 0) { > > printf("devclass_get_devices(acpi_cpu_devclass) failed\n"); > > return; > > } > > for (i = 0; i < n; i++) > > bus_generic_probe(devices[i]); > > for (i = 0; i < n; i++) > > bus_generic_attach(devices[i]); > > free(devices, M_TEMP); > > } > > > > SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, > > acpi_cpu_postattach, NULL); > > > > > > > Ohhhhhh ... right. This entire idea is stupid and fully demonstrates my > lack of understanding. bus_probe/attach can't be used, there's no BUS > here. So, SYSINIT() to the rescue. Ok, that changes things around a > lot for me. This BUS_PROBE_GENERIC idea is a dud. No, every device in new-bus can be a bus (and acpi_cpuX is in fact a bus). The issue here is that this driver is deferring attaching child devices until later in the boot. This is a bit of a lame workaround that should be using new-bus multipass instead. -- John Baldwin