ACPI: Create symlinks in acpi_bind_one() under physical_node_lock
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 Aug 2013 23:19:37 +0000 (01:19 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Aug 2013 21:41:47 +0000 (23:41 +0200)
Put the creation of symlinks in acpi_bind_one() under the
physical_node_lock mutex of the given ACPI device object, because
that is part of the binding operation logically (those links are
already removed under that mutex too).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
drivers/acpi/glue.c

index 92cacb12ef5c32eb52c40af7d8fe1a18b94c749d..914a3460123160b6daafe9e097c138a8b33ea281 100644 (file)
@@ -242,8 +242,6 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
        list_add(&physical_node->node, physnode_list);
        acpi_dev->physical_node_count++;
 
-       mutex_unlock(&acpi_dev->physical_node_lock);
-
        if (!ACPI_HANDLE(dev))
                ACPI_HANDLE_SET(dev, acpi_dev->handle);
 
@@ -253,6 +251,8 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
        retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj,
                "firmware_node");
 
+       mutex_unlock(&acpi_dev->physical_node_lock);
+
        if (acpi_dev->wakeup.flags.valid)
                device_set_wakeup_capable(dev, true);