[PATCH v3 4/6] powerpc/powernv: hold device_hotplug_lock when calling device_online()

David Hildenbrand david at redhat.com
Thu Sep 27 19:25:52 AEST 2018


device_online() should be called with device_hotplug_lock() held.

Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Cc: Paul Mackerras <paulus at samba.org>
Cc: Michael Ellerman <mpe at ellerman.id.au>
Cc: Rashmica Gupta <rashmica.g at gmail.com>
Cc: Balbir Singh <bsingharora at gmail.com>
Cc: Michael Neuling <mikey at neuling.org>
Reviewed-by: Pavel Tatashin <pavel.tatashin at microsoft.com>
Reviewed-by: Rashmica Gupta <rashmica.g at gmail.com>
Signed-off-by: David Hildenbrand <david at redhat.com>
---
 arch/powerpc/platforms/powernv/memtrace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index 773623f6bfb1..fdd48f1a39f7 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -242,9 +242,11 @@ static int memtrace_online(void)
 		 * we need to online the memory ourselves.
 		 */
 		if (!memhp_auto_online) {
+			lock_device_hotplug();
 			walk_memory_range(PFN_DOWN(ent->start),
 					  PFN_UP(ent->start + ent->size - 1),
 					  NULL, online_mem_block);
+			unlock_device_hotplug();
 		}
 
 		/*
-- 
2.17.1



More information about the Linuxppc-dev mailing list