linux/drivers/base
Nathan Fontenot dc18d706a4 memory-hotplug: use dev_online for memhp_auto_online
Commit 31bc3858ea ("add automatic onlining policy for the newly added
memory") provides the capability to have added memory automatically
onlined during add, but this appears to be slightly broken.

The current implementation uses walk_memory_range() to call
online_memory_block, which uses memory_block_change_state() to online
the memory.  Instead, we should be calling device_online() for the
memory block in online_memory_block().  This would online the memory
(the memory bus online routine memory_subsys_online() called from
device_online calls memory_block_change_state()) and properly update the
device struct offline flag.

As a result of the current implementation, attempting to remove a memory
block after adding it using auto online fails.  This is because doing a
remove, for instance

  echo offline > /sys/devices/system/memory/memoryXXX/state

uses device_offline() which checks the dev->offline flag.

Link: http://lkml.kernel.org/r/20170222220744.8119.19687.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-24 17:46:56 -08:00
..
power Merge branches 'pm-core', 'pm-qos' and 'pm-domains' 2017-02-20 14:26:02 +01:00
regmap
test
Kconfig
Makefile
attribute_container.c
base.h
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c mm: validate device_hotplug is held for memory hotplug 2017-02-24 17:46:53 -08:00
cpu.c
dd.c
devcoredump.c
devres.c
devtmpfs.c
dma-coherent.c
dma-contiguous.c mm: wire up GFP flag passing in dma_alloc_from_contiguous 2017-02-24 17:46:55 -08:00
dma-mapping.c
driver.c
firmware.c
firmware_class.c
hypervisor.c
init.c
isa.c
map.c
memory.c memory-hotplug: use dev_online for memhp_auto_online 2017-02-24 17:46:56 -08:00
module.c
node.c
pinctrl.c
platform-msi.c
platform.c driver core patches for 4.11-rc1 2017-02-22 11:44:32 -08:00
property.c
soc.c
syscore.c
topology.c
transport_class.c