Contact:       Badari Pulavarty <pbadari@us.ibm.com>
 Description:
                The file /sys/devices/system/memory/memoryX/phys_device
-               is read-only and is designed to show the name of physical
-               memory device.  Implementation is currently incomplete.
+               is read-only;  it is a legacy interface only ever used on s390x
+               to expose the covered storage increment.
+Users:         Legacy s390-tools lsmem/chmem
 
 What:          /sys/devices/system/memory/memoryX/phys_index
 Date:          September 2008
 
 
                     "online_movable", "online", "offline" command
                     which will be performed on all sections in the block.
-``phys_device``     read-only: designed to show the name of physical memory
-                    device.  This is not well implemented now.
+``phys_device``            read-only: legacy interface only ever used on s390x to
+                   expose the covered storage increment.
 ``removable``       read-only: contains an integer value indicating
                     whether the memory block is removable or not
                     removable.  A value of 1 indicates that the memory
 
 }
 
 /*
- * phys_device is a bad name for this.  What I really want
- * is a way to differentiate between memory ranges that
- * are part of physical devices that constitute
- * a complete removable unit or fru.
- * i.e. do these ranges belong to the same physical device,
- * s.t. if I offline all of these sections I can then
- * remove the physical device?
+ * Legacy interface that we cannot remove: s390x exposes the storage increment
+ * covered by a memory block, allowing for identifying which memory blocks
+ * comprise a storage increment. Since a memory block spans complete
+ * storage increments nowadays, this interface is basically unused. Other
+ * archs never exposed != 0.
  */
 static ssize_t phys_device_show(struct device *dev,
                                struct device_attribute *attr, char *buf)
 {
        struct memory_block *mem = to_memory_block(dev);
+       unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr);
 
-       return sysfs_emit(buf, "%d\n", mem->phys_device);
+       return sysfs_emit(buf, "%d\n",
+                         arch_get_memory_phys_device(start_pfn));
 }
 
 #ifdef CONFIG_MEMORY_HOTREMOVE
 static DEVICE_ATTR_WO(hard_offline_page);
 #endif
 
-/*
- * Note that phys_device is optional.  It is here to allow for
- * differentiation between which *physical* devices each
- * section belongs to...
- */
+/* See phys_device_show(). */
 int __weak arch_get_memory_phys_device(unsigned long start_pfn)
 {
        return 0;
 static int init_memory_block(unsigned long block_id, unsigned long state)
 {
        struct memory_block *mem;
-       unsigned long start_pfn;
        int ret = 0;
 
        mem = find_memory_block_by_id(block_id);
 
        mem->start_section_nr = block_id * sections_per_block;
        mem->state = state;
-       start_pfn = section_nr_to_pfn(mem->start_section_nr);
-       mem->phys_device = arch_get_memory_phys_device(start_pfn);
        mem->nid = NUMA_NO_NODE;
 
        ret = register_memory(mem);