lkml.org 
[lkml]   [2017]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] ACPI / scan: Avoid enumerating devices more than once
Date
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);
\
 
 \ /
  Last update: 2017-04-17 01:27    [W:0.046 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site