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

From: David Hildenbrand <[email-masked]>
Date: Tue, 18 Sep 2018 13:48:20 +0200

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

Cc: Benjamin Herrenschmidt <[email-masked]>
Cc: Paul Mackerras <[email-masked]>
Cc: Michael Ellerman <[email-masked]>
Cc: Rashmica Gupta <[email-masked]>
Cc: Balbir Singh <[email-masked]>
Cc: Michael Neuling <[email-masked]>
Reviewed-by: Pavel Tatashin <[email-masked]>
Signed-off-by: David Hildenbrand <[email-masked]>
---
 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 8f1cd4f3bfd5..ef7181d4fe68 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -229,9 +229,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