Commit 7291edca authored by David Hildenbrand's avatar David Hildenbrand Committed by Linus Torvalds
Browse files

drivers/acpi/scan.c: document why we don't need the device_hotplug_lock

Let's document why the lock is not needed in acpi_scan_init(), right now
this is not really obvious.

[akpm@linux-foundation.org: fix tpyo]
Link: http://lkml.kernel.org/r/20190731135306.31524-1-david@redhat.com


Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Oscar Salvador <osalvador@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 14c5ceba
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -2204,6 +2204,12 @@ int __init acpi_scan_init(void)
	acpi_gpe_apply_masked_gpes();
	acpi_gpe_apply_masked_gpes();
	acpi_update_all_gpes();
	acpi_update_all_gpes();


	/*
	 * Although we call __add_memory() that is documented to require the
	 * device_hotplug_lock, it is not necessary here because this is an
	 * early code when userspace or any other code path cannot trigger
	 * hotplug/hotunplug operations.
	 */
	mutex_lock(&acpi_scan_lock);
	mutex_lock(&acpi_scan_lock);
	/*
	/*
	 * Enumerate devices in the ACPI namespace.
	 * Enumerate devices in the ACPI namespace.