From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arjan van de Ven Subject: Re: acpi_battery_init() boot speed Date: Fri, 17 Dec 2010 08:02:35 -0800 Message-ID: <20101217080235.50838925@infradead.org> References: <20101215030054.0aae9e1e@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from casper.infradead.org ([85.118.1.10]:33686 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755521Ab0LQP7x (ORCPT ); Fri, 17 Dec 2010 10:59:53 -0500 In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Len Brown Cc: linux-acpi@vger.kernel.org On Fri, 17 Dec 2010 03:46:12 -0500 (EST) Len Brown wrote: > > wonder if the code could do just enough to register the device, and > > do everything else in the background? > > or do it later on demand... that makes complete sense... but you can even just do that async.. to cut down the time of first use.... if you want I can propose a patch for that based on the patch below... > > This patch reduces acpi_battery_init() time > on the Lenovo S10-3 from 901,603 usec to 657 usec. > > AFAICT, the battery monitor etc worked fine. > > diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c > index 95649d3..79e8ba3 100644 > --- a/drivers/acpi/battery.c > +++ b/drivers/acpi/battery.c > @@ -943,7 +943,6 @@ static int acpi_battery_add(struct acpi_device > *device) if (ACPI_SUCCESS(acpi_get_handle(battery->device->handle, > "_BIX", &handle))) > set_bit(ACPI_BATTERY_XINFO_PRESENT, &battery->flags); > - acpi_battery_update(battery); > #ifdef CONFIG_ACPI_PROCFS_POWER > result = acpi_battery_add_fs(device); > #endif > > > -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org