aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-04-10 18:23:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-21 03:31:20 -0400
commit6ef2f0178649b3d3c502217c22c2dfe365c74091 (patch)
tree3511fa45013df6fac2948406118eaeada6b51f0a
parent0b914aa8cdc68c4e97ee48e5143cecd514cf1e6d (diff)
ACPI / scan: Set the visited flag for all enumerated devices
commit f406270bf73d71ea7b35ee3f7a08a44f6594c9b1 upstream. 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) Link: https://bugzilla.kernel.org/show_bug.cgi?id=194885 Reported-and-tested-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/acpi/scan.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 5a2fdf156ec9..dd3786acba89 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1827,15 +1827,20 @@ static void acpi_bus_attach(struct acpi_device *device)
1827 return; 1827 return;
1828 1828
1829 device->flags.match_driver = true; 1829 device->flags.match_driver = true;
1830 if (!ret) { 1830 if (ret > 0) {
1831 ret = device_attach(&device->dev); 1831 acpi_device_set_enumerated(device);
1832 if (ret < 0) 1832 goto ok;
1833 return;
1834
1835 if (!ret && device->pnp.type.platform_id)
1836 acpi_default_enumeration(device);
1837 } 1833 }
1838 1834
1835 ret = device_attach(&device->dev);
1836 if (ret < 0)
1837 return;
1838
1839 if (ret > 0 || !device->pnp.type.platform_id)
1840 acpi_device_set_enumerated(device);
1841 else
1842 acpi_default_enumeration(device);
1843
1839 ok: 1844 ok:
1840 list_for_each_entry(child, &device->children, node) 1845 list_for_each_entry(child, &device->children, node)
1841 acpi_bus_attach(child); 1846 acpi_bus_attach(child);