diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-05-08 14:18:37 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-05-12 14:14:45 +0200 |
commit | 4960e05e22604ee270a023f968e0e4f9bd0c6fef (patch) | |
tree | abdc39a81c6ab9868bc75f0f50ddedb7fcb10f9b /include | |
parent | e2ff39400d81233374e780b133496a2296643d7d (diff) |
Driver core: Introduce offline/online callbacks for memory blocks
Introduce .offline() and .online() callbacks for memory_subsys
that will allow the generic device_offline() and device_online()
to be used with device objects representing memory blocks. That,
in turn, allows the ACPI subsystem to use device_offline() to put
removable memory blocks offline, if possible, before removing
memory modules holding them.
The 'online' sysfs attribute of memory block devices will attempt to
put them offline if 0 is written to it and will attempt to apply the
previously used online type when onlining them (i.e. when 1 is
written to it).
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/memory.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/memory.h b/include/linux/memory.h index 85c31a8e290..3d534658302 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h @@ -26,6 +26,7 @@ struct memory_block { unsigned long start_section_nr; unsigned long end_section_nr; unsigned long state; + int last_online; int section_count; /* |