All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI / battery: ensure acpi_battery_init() has finish
@ 2015-05-11 21:49 Luis Henriques
  2015-05-14 23:59 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Luis Henriques @ 2015-05-11 21:49 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown
  Cc: Arjan van de Ven, linux-acpi, linux-kernel, Luis Henriques

Make sure that async function scheduled with async_schedule() has already
been executed.

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 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 <astarikovskiy@suse.de>");
 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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI / battery: ensure acpi_battery_init() has finish
  2015-05-11 21:49 [PATCH] ACPI / battery: ensure acpi_battery_init() has finish Luis Henriques
@ 2015-05-14 23:59 ` Rafael J. Wysocki
  2015-05-15 23:09     ` Luis Henriques
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2015-05-14 23:59 UTC (permalink / raw)
  To: Luis Henriques; +Cc: Len Brown, Arjan van de Ven, linux-acpi, linux-kernel

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 <luis.henriques@canonical.com>

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 <astarikovskiy@suse.de>");
>  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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI / battery: ensure acpi_battery_init() has finish
  2015-05-14 23:59 ` Rafael J. Wysocki
@ 2015-05-15 23:09     ` Luis Henriques
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Henriques @ 2015-05-15 23:09 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Len Brown, Arjan van de Ven, linux-acpi, linux-kernel

On Fri, May 15, 2015 at 01:59:24AM +0200, Rafael J. Wysocki wrote:
> 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 <luis.henriques@canonical.com>
> 
> Queued up for 4.2 (along with the other two battery patches of yours), thanks!
> 

Awesome, thanks!

Cheers,
--
Luís
--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI / battery: ensure acpi_battery_init() has finish
@ 2015-05-15 23:09     ` Luis Henriques
  0 siblings, 0 replies; 4+ messages in thread
From: Luis Henriques @ 2015-05-15 23:09 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Len Brown, Arjan van de Ven, linux-acpi, linux-kernel

On Fri, May 15, 2015 at 01:59:24AM +0200, Rafael J. Wysocki wrote:
> 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 <luis.henriques@canonical.com>
> 
> Queued up for 4.2 (along with the other two battery patches of yours), thanks!
> 

Awesome, thanks!

Cheers,
--
Luís

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-15 23:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 21:49 [PATCH] ACPI / battery: ensure acpi_battery_init() has finish Luis Henriques
2015-05-14 23:59 ` Rafael J. Wysocki
2015-05-15 23:09   ` Luis Henriques
2015-05-15 23:09     ` Luis Henriques

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.