Linux ACPI
 help / color / mirror / Atom feed
* [PATCH] ACPI / scan: Set the visited flag for all enumerated devices
@ 2017-04-10 22:23 Rafael J. Wysocki
  2017-04-11  9:36 ` Mika Westerberg
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2017-04-10 22:23 UTC (permalink / raw)
  To: Linux ACPI; +Cc: LKML, Mika Westerberg

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Commit 10c7e20b2ff3 (ACPI / scan: fix enumeration (visited) flags for
bus rescans) attempted to fix a problem with ACPI-based enumerateion
of I2C/SPI devices, but it forgot to ensure that the visited flag
will be set for all of the other enumerated devices, so fix that.

Fixes: 10c7e20b2ff3 (ACPI / scan: fix enumeration (visited) flags for bus rescans)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/scan.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

Index: linux-pm/drivers/acpi/scan.c
===================================================================
--- linux-pm.orig/drivers/acpi/scan.c
+++ linux-pm/drivers/acpi/scan.c
@@ -1857,15 +1857,20 @@ static void acpi_bus_attach(struct acpi_
 		return;
 
 	device->flags.match_driver = true;
-	if (!ret) {
-		ret = device_attach(&device->dev);
-		if (ret < 0)
-			return;
-
-		if (!ret && device->pnp.type.platform_id)
-			acpi_default_enumeration(device);
+	if (ret > 0) {
+		acpi_device_set_enumerated(device);
+		goto ok;
 	}
 
+	ret = device_attach(&device->dev);
+	if (ret < 0)
+		return;
+
+	if (ret > 0 || !device->pnp.type.platform_id)
+		acpi_device_set_enumerated(device);
+	else
+		acpi_default_enumeration(device);
+
  ok:
 	list_for_each_entry(child, &device->children, node)
 		acpi_bus_attach(child);


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

end of thread, other threads:[~2017-04-11 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-10 22:23 [PATCH] ACPI / scan: Set the visited flag for all enumerated devices Rafael J. Wysocki
2017-04-11  9:36 ` Mika Westerberg
2017-04-11 14:15   ` Rafael J. Wysocki
2017-04-11 14:29     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox