mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
mm, devm_memremap_pages: hold device_hotplug lock over mem_hotplug_{begin, done}
am: f1faaec484
Change-Id: I7e37ea31b7376f63e9ff38b5d40020e793a64c1a
This commit is contained in:
@@ -246,9 +246,13 @@ static void devm_memremap_pages_release(struct device *dev, void *data)
|
||||
/* pages are dead and unused, undo the arch mapping */
|
||||
align_start = res->start & ~(SECTION_SIZE - 1);
|
||||
align_size = ALIGN(resource_size(res), SECTION_SIZE);
|
||||
|
||||
lock_device_hotplug();
|
||||
mem_hotplug_begin();
|
||||
arch_remove_memory(align_start, align_size);
|
||||
mem_hotplug_done();
|
||||
unlock_device_hotplug();
|
||||
|
||||
untrack_pfn(NULL, PHYS_PFN(align_start), align_size);
|
||||
pgmap_radix_release(res);
|
||||
dev_WARN_ONCE(dev, pgmap->altmap && pgmap->altmap->alloc,
|
||||
@@ -360,9 +364,11 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
|
||||
if (error)
|
||||
goto err_pfn_remap;
|
||||
|
||||
lock_device_hotplug();
|
||||
mem_hotplug_begin();
|
||||
error = arch_add_memory(nid, align_start, align_size, true);
|
||||
mem_hotplug_done();
|
||||
unlock_device_hotplug();
|
||||
if (error)
|
||||
goto err_add_memory;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user