From owner-freebsd-acpi@FreeBSD.ORG Fri Jun 22 07:25:50 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 56DD7106566C; Fri, 22 Jun 2012 07:25:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 684F88FC0A; Fri, 22 Jun 2012 07:25:49 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA17435; Fri, 22 Jun 2012 10:25:48 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ShyFX-000MYM-S5; Fri, 22 Jun 2012 10:25:47 +0300 Message-ID: <4FE41DFB.7010008@FreeBSD.org> Date: Fri, 22 Jun 2012 10:25:47 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120613 Thunderbird/13.0 MIME-Version: 1.0 To: John Baldwin References: <1340121728.5203.8.camel@powernoodle> <1340210648.2858.9.camel@powernoodle.corp.yahoo.com> <1340234916.2858.29.camel@powernoodle.corp.yahoo.com> <201206210950.23259.jhb@freebsd.org> In-Reply-To: <201206210950.23259.jhb@freebsd.org> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@FreeBSD.org, 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: Fri, 22 Jun 2012 07:25:50 -0000 on 21/06/2012 16:50 John Baldwin said the following: > 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. > Yes. The only excuse is that the hack was introduced, if I remember correctly, before the multipass support. -- Andriy Gapon