Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423083AbbENXeP (ORCPT ); Thu, 14 May 2015 19:34:15 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:57149 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1422986AbbENXeM (ORCPT ); Thu, 14 May 2015 19:34:12 -0400 From: "Rafael J. Wysocki" To: Luis Henriques Cc: Len Brown , Arjan van de Ven , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ACPI / battery: ensure acpi_battery_init() has finish Date: Fri, 15 May 2015 01:59:24 +0200 Message-ID: <2846184.p0deZ4nZzp@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.0.0+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1431380945-2923-1-git-send-email-luis.henriques@canonical.com> References: <1431380945-2923-1-git-send-email-luis.henriques@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1905 Lines: 52 On Monday, May 11, 2015 10:49:05 PM Luis Henriques wrote: > Make sure that async function scheduled with async_schedule() has already > been executed. > > Signed-off-by: Luis Henriques Queued up for 4.2 (along with the other two battery patches of yours), thanks! > --- > drivers/acpi/battery.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c > index 9c676a6f32ce..547e627611e0 100644 > --- a/drivers/acpi/battery.c > +++ b/drivers/acpi/battery.c > @@ -70,6 +70,7 @@ MODULE_AUTHOR("Alexey Starikovskiy "); > MODULE_DESCRIPTION("ACPI Battery Driver"); > MODULE_LICENSE("GPL"); > > +static async_cookie_t async_cookie; > static int battery_bix_broken_package; > static int battery_notification_delay_ms; > static unsigned int cache_time = 1000; > @@ -1313,12 +1314,13 @@ static int __init acpi_battery_init(void) > if (acpi_disabled) > return -ENODEV; > > - async_schedule(acpi_battery_init_async, NULL); > + async_cookie = async_schedule(acpi_battery_init_async, NULL); > return 0; > } > > static void __exit acpi_battery_exit(void) > { > + async_synchronize_cookie(async_cookie); > acpi_bus_unregister_driver(&acpi_battery_driver); > #ifdef CONFIG_ACPI_PROCFS_POWER > acpi_unlock_battery_dir(acpi_battery_dir); > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/