Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1624485 > unrolled thread

[PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once

Started by"Rafael J. Wysocki" <rjw@rjwysocki.net>
First post2017-04-17 01:30 +0200
Last post2017-04-19 18:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-04-17 01:30 +0200
    Re: [PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-04-18 12:30 +0200
    Re: [PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once joeyli <jlee@suse.com> - 2017-04-19 18:50 +0200

#1624485 — [PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2017-04-17 01:30 +0200
Subject[PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once
Message-ID<tx1Md-1rQ-7@gated-at.bofh.it>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

acpi_bus_attach() does not check the visited flag for devices that
have been enumerated already and some of them may be enumerated
for multiple times as a result, because some callers of
acpi_bus_scan() don't check the visited flag either.

For this reason, modify acpi_bus_attach() to check the visited flag
and avoid enumerating devices that have already been enumerated.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/scan.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -1850,6 +1850,8 @@ static void acpi_bus_attach(struct acpi_
 			device->flags.power_manageable = 0;
 
 		device->flags.initialized = true;
+	} else if (device->flags.visited) {
+		goto ok;
 	}
 
 	ret = acpi_scan_attach_handler(device);

[toc] | [next] | [standalone]


#1625219

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2017-04-18 12:30 +0200
Message-ID<txyyu-51l-11@gated-at.bofh.it>
In reply to#1624485
On Mon, Apr 17, 2017 at 01:20:48AM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> acpi_bus_attach() does not check the visited flag for devices that
> have been enumerated already and some of them may be enumerated
> for multiple times as a result, because some callers of
> acpi_bus_scan() don't check the visited flag either.
> 
> For this reason, modify acpi_bus_attach() to check the visited flag
> and avoid enumerating devices that have already been enumerated.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

[toc] | [prev] | [next] | [standalone]


#1626506

Fromjoeyli <jlee@suse.com>
Date2017-04-19 18:50 +0200
Message-ID<ty0XM-5M7-17@gated-at.bofh.it>
In reply to#1624485
On Mon, Apr 17, 2017 at 01:20:48AM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> acpi_bus_attach() does not check the visited flag for devices that
> have been enumerated already and some of them may be enumerated
> for multiple times as a result, because some callers of
> acpi_bus_scan() don't check the visited flag either.
> 
> For this reason, modify acpi_bus_attach() to check the visited flag
> and avoid enumerating devices that have already been enumerated.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Joey Lee <jlee@suse.com>

Thanka a lot!
Joey Lee

> ---
>  drivers/acpi/scan.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> Index: linux-pm/drivers/acpi/scan.c
> ===================================================================
> --- linux-pm.orig/drivers/acpi/scan.c
> +++ linux-pm/drivers/acpi/scan.c
> @@ -1850,6 +1850,8 @@ static void acpi_bus_attach(struct acpi_
>  			device->flags.power_manageable = 0;
>  
>  		device->flags.initialized = true;
> +	} else if (device->flags.visited) {
> +		goto ok;
>  	}
>  
>  	ret = acpi_scan_attach_handler(device);
> 
> --
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web