<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/platforms/pseries/hotplug-memory.c, branch linux-3.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-04-28T06:32:14Z</updated>
<entry>
<title>powerpc/pseries: Protect remove_memory() with device hotplug lock</title>
<updated>2014-04-28T06:32:14Z</updated>
<author>
<name>Li Zhong</name>
</author>
<published>2014-04-10T08:25:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42dbfc8649737cb622b2a7e02045401c4c09561c'/>
<id>urn:sha1:42dbfc8649737cb622b2a7e02045401c4c09561c</id>
<content type='text'>
While testing memory hot-remove, I found following dead lock:

Process #1141 is drmgr, trying to remove some memory, i.e. memory499.
It holds the memory_hotplug_mutex, and blocks when trying to remove file
"online" under dir memory499, in kernfs_drain(), at
        wait_event(root-&gt;deactivate_waitq,
                   atomic_read(&amp;kn-&gt;active) == KN_DEACTIVATED_BIAS);

Process #1120 is trying to online memory499 by
   echo 1 &gt; memory499/online

In .kernfs_fop_write, it uses kernfs_get_active() to increase
&amp;kn-&gt;active, thus blocking process #1141. While itself is blocked later
when trying to acquire memory_hotplug_mutex, which is held by process

The backtrace of both processes are shown below:

[&lt;c000000001b18600&gt;] 0xc000000001b18600
[&lt;c000000000015044&gt;] .__switch_to+0x144/0x200
[&lt;c000000000263ca4&gt;] .online_pages+0x74/0x7b0
[&lt;c00000000055b40c&gt;] .memory_subsys_online+0x9c/0x150
[&lt;c00000000053cbe8&gt;] .device_online+0xb8/0x120
[&lt;c00000000053cd04&gt;] .online_store+0xb4/0xc0
[&lt;c000000000538ce4&gt;] .dev_attr_store+0x64/0xa0
[&lt;c00000000030f4ec&gt;] .sysfs_kf_write+0x7c/0xb0
[&lt;c00000000030e574&gt;] .kernfs_fop_write+0x154/0x1e0
[&lt;c000000000268450&gt;] .vfs_write+0xe0/0x260
[&lt;c000000000269144&gt;] .SyS_write+0x64/0x110
[&lt;c000000000009ffc&gt;] syscall_exit+0x0/0x7c

[&lt;c000000001b18600&gt;] 0xc000000001b18600
[&lt;c000000000015044&gt;] .__switch_to+0x144/0x200
[&lt;c00000000030be14&gt;] .__kernfs_remove+0x204/0x300
[&lt;c00000000030d428&gt;] .kernfs_remove_by_name_ns+0x68/0xf0
[&lt;c00000000030fb38&gt;] .sysfs_remove_file_ns+0x38/0x60
[&lt;c000000000539354&gt;] .device_remove_attrs+0x54/0xc0
[&lt;c000000000539fd8&gt;] .device_del+0x158/0x250
[&lt;c00000000053a104&gt;] .device_unregister+0x34/0xa0
[&lt;c00000000055bc14&gt;] .unregister_memory_section+0x164/0x170
[&lt;c00000000024ee18&gt;] .__remove_pages+0x108/0x4c0
[&lt;c00000000004b590&gt;] .arch_remove_memory+0x60/0xc0
[&lt;c00000000026446c&gt;] .remove_memory+0x8c/0xe0
[&lt;c00000000007f9f4&gt;] .pseries_remove_memblock+0xd4/0x160
[&lt;c00000000007fcfc&gt;] .pseries_memory_notifier+0x27c/0x290
[&lt;c0000000008ae6cc&gt;] .notifier_call_chain+0x8c/0x100
[&lt;c0000000000d858c&gt;] .__blocking_notifier_call_chain+0x6c/0xe0
[&lt;c00000000071ddec&gt;] .of_property_notify+0x7c/0xc0
[&lt;c00000000071ed3c&gt;] .of_update_property+0x3c/0x1b0
[&lt;c0000000000756cc&gt;] .ofdt_write+0x3dc/0x740
[&lt;c0000000002f60fc&gt;] .proc_reg_write+0xac/0x110
[&lt;c000000000268450&gt;] .vfs_write+0xe0/0x260
[&lt;c000000000269144&gt;] .SyS_write+0x64/0x110
[&lt;c000000000009ffc&gt;] syscall_exit+0x0/0x7c

This patch uses lock_device_hotplug() to protect remove_memory() called
in pseries_remove_memblock(), which is also stated before function
remove_memory():

 * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
 * and online/offline operations before this call, as required by
 * try_offline_node().
 */
void __ref remove_memory(int nid, u64 start, u64 size)

With this lock held, the other process(#1120 above) trying to online the
memory block will retry the system call when calling
lock_device_hotplug_sysfs(), and finally find No such device error.

Signed-off-by: Li Zhong &lt;zhong@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc/pseries: Use remove_memory() to remove memory</title>
<updated>2014-03-07T04:53:13Z</updated>
<author>
<name>Nathan Fontenot</name>
</author>
<published>2014-01-27T16:54:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ac8cde938481cd0e3f700b8f071c4eca989c9f6'/>
<id>urn:sha1:9ac8cde938481cd0e3f700b8f071c4eca989c9f6</id>
<content type='text'>
The memory remove code for powerpc/pseries should call remove_memory()
so that we are holding the hotplug_memory lock during memory remove
operations.

This patch updates the memory node remove handler to call remove_memory()
and adds a ppc_md.remove_memory() entry to handle pseries specific work
that is called from arch_remove_memory().

During memory remove in pseries_remove_memblock() we have to stay with
removing memory one section at a time. This is needed because of how memory
resources are handled. During memory add for pseries (via the probe file in
sysfs) we add memory one section at a time which gives us a memory resource
for each section. Future patches will aim to address this so will not have
to remove memory one section at a time.

Signed-off-by: Nathan Fontenot &lt;nfont@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>powerpc: add explicit OF includes</title>
<updated>2013-10-10T01:04:11Z</updated>
<author>
<name>Rob Herring</name>
</author>
<published>2013-09-26T12:40:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=26a2056eb21fff26caf99d19ad5448e9403db55d'/>
<id>urn:sha1:26a2056eb21fff26caf99d19ad5448e9403db55d</id>
<content type='text'>
When removing prom.h include by of.h, several OF headers will no longer
be implicitly included. Add explicit includes of of_*.h as needed.

Signed-off-by: Rob Herring &lt;rob.herring@calxeda.com&gt;
Acked-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Anatolij Gustschin &lt;agust@denx.de&gt;
Cc: Kumar Gala &lt;galak@kernel.crashing.org&gt;
Cc: Olof Johansson &lt;olof@lixom.net&gt;
Cc: linuxppc-dev@lists.ozlabs.org
</content>
</entry>
<entry>
<title>mm, hotplug: avoid compiling memory hotremove functions when disabled</title>
<updated>2013-04-29T22:54:37Z</updated>
<author>
<name>David Rientjes</name>
</author>
<published>2013-04-29T22:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4edd7ceff0662afde195da6f6c43e7cbe1ed2dc4'/>
<id>urn:sha1:4edd7ceff0662afde195da6f6c43e7cbe1ed2dc4</id>
<content type='text'>
__remove_pages() is only necessary for CONFIG_MEMORY_HOTREMOVE.  PowerPC
pseries will return -EOPNOTSUPP if unsupported.

Adding an #ifdef causes several other functions it depends on to also
become unnecessary, which saves in .text when disabled (it's disabled in
most defconfigs besides powerpc, including x86).  remove_memory_block()
becomes static since it is not referenced outside of
drivers/base/memory.c.

Build tested on x86 and powerpc with CONFIG_MEMORY_HOTREMOVE both enabled
and disabled.

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Acked-by: Toshi Kani &lt;toshi.kani@hp.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Wen Congyang &lt;wency@cn.fujitsu.com&gt;
Cc: Tang Chen &lt;tangchen@cn.fujitsu.com&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>powerpc+of: Add of node/property notification chain for adds and removes</title>
<updated>2012-11-15T01:56:41Z</updated>
<author>
<name>Nathan Fontenot</name>
</author>
<published>2012-10-02T16:57:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1cf3d8b3d24cd383ddfd5442c83ec5c355ffc2f7'/>
<id>urn:sha1:1cf3d8b3d24cd383ddfd5442c83ec5c355ffc2f7</id>
<content type='text'>
This patch moves the notification chain for updates to the device tree
from the powerpc/pseries code to the base OF code. This makes this
functionality available to all architectures.

Additionally the notification chain is updated to allow notifications
for property add/remove/update. To make this work a pointer to a new
struct (of_prop_reconfig) is passed to the routines in the notification chain.
The of_prop_reconfig property contains a pointer to the node containing the
property and a pointer to the property itself. In the case of property
updates, the property pointer refers to the new property.

Signed-off-by: Nathan Fontenot &lt;nfont@linux.vnet.ibm.com&gt;
Acked-by: Rob Herring &lt;rob.herring@calxeda.com&gt;
Acked-by: Grant Likely &lt;grant.likely@secretlab.ca&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>arch/powerpc/platforms/pseries/hotplug-memory.c: section removal cleanups</title>
<updated>2012-10-10T23:50:14Z</updated>
<author>
<name>Yasuaki Ishimatsu</name>
</author>
<published>2012-10-10T22:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1633dbbacbaa3a2f95ef901caf9d0b32728c10b6'/>
<id>urn:sha1:1633dbbacbaa3a2f95ef901caf9d0b32728c10b6</id>
<content type='text'>
Followups to d760afd4d257 ("memory-hotplug: suppress "Trying to free
nonexistent resource &lt;XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY&gt;" warning").

 - use unsigned long type, as overflows are conceivable

 - rename `i' to the less-misleading and more informative `section'

Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>arch/powerpc/platforms/pseries/hotplug-memory.c: fix section handling code</title>
<updated>2012-10-10T23:50:13Z</updated>
<author>
<name>Andrew Morton</name>
</author>
<published>2012-10-10T22:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=158544b165d362c23acdde0104d9aab505a262a6'/>
<id>urn:sha1:158544b165d362c23acdde0104d9aab505a262a6</id>
<content type='text'>
Fix

  arch/powerpc/platforms/pseries/hotplug-memory.c: In function 'pseries_remove_memblock':
  arch/powerpc/platforms/pseries/hotplug-memory.c:103:17: error: unused variable 'pfn' [-Werror=unused-variable]

Caused by commit d760afd4d257 ("memory-hotplug: suppress "Trying to free
nonexistent resource &lt;XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY&gt;" warning").

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Tested-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Tested-by: Nathan Fontenot &lt;nfont@linux.vnet.ibm.com&gt;
Tested-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>memory-hotplug: suppress "Trying to free nonexistent resource &lt;XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY&gt;" warning</title>
<updated>2012-10-09T07:23:04Z</updated>
<author>
<name>Yasuaki Ishimatsu</name>
</author>
<published>2012-10-08T23:34:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d760afd4d2570653891f94e13b848e97150dc5a6'/>
<id>urn:sha1:d760afd4d2570653891f94e13b848e97150dc5a6</id>
<content type='text'>
When our x86 box calls __remove_pages(), release_mem_region() shows many
warnings.  And x86 box cannot unregister iomem_resource.

  "Trying to free nonexistent resource &lt;XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY&gt;"

release_mem_region() has been changed to be called in each
PAGES_PER_SECTION by commit de7f0cba9678 ("memory hotplug: release
memory regions in PAGES_PER_SECTION chunks").  Because powerpc registers
iomem_resource in each PAGES_PER_SECTION chunk.  But when I hot add
memory on x86 box, iomem_resource is register in each _CRS not
PAGES_PER_SECTION chunk.  So x86 box unregisters iomem_resource.

The patch fixes the problem.

Signed-off-by: Yasuaki Ishimatsu &lt;isimatu.yasuaki@jp.fujitsu.com&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Jiang Liu &lt;liuj97@gmail.com&gt;
Cc: Len Brown &lt;len.brown@intel.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Minchan Kim &lt;minchan.kim@gmail.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Wen Congyang &lt;wency@cn.fujitsu.com&gt;
Cc: Dave Hansen &lt;dave@linux.vnet.ibm.com&gt;
Cc: Nathan Fontenot &lt;nfont@austin.ibm.com&gt;
Cc: Badari Pulavarty &lt;pbadari@us.ibm.com&gt;
Cc: Yasunori Goto &lt;y-goto@jp.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc</title>
<updated>2011-07-26T05:59:39Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2011-07-26T05:59:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=184475029a724b6b900d88fc3a5f462a6107d5af'/>
<id>urn:sha1:184475029a724b6b900d88fc3a5f462a6107d5af</id>
<content type='text'>
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (99 commits)
  drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
  powerpc/85xx: fix mpic configuration in CAMP mode
  powerpc: Copy back TIF flags on return from softirq stack
  powerpc/64: Make server perfmon only built on ppc64 server devices
  powerpc/pseries: Fix hvc_vio.c build due to recent changes
  powerpc: Exporting boot_cpuid_phys
  powerpc: Add CFAR to oops output
  hvc_console: Add kdb support
  powerpc/pseries: Fix hvterm_raw_get_chars to accept &lt; 16 chars, fixing xmon
  powerpc/irq: Quieten irq mapping printks
  powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs
  powerpc: Add mpt2sas driver to pseries and ppc64 defconfig
  powerpc: Disable IRQs off tracer in ppc64 defconfig
  powerpc: Sync pseries and ppc64 defconfigs
  powerpc/pseries/hvconsole: Fix dropped console output
  hvc_console: Improve tty/console put_chars handling
  powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
  powerpc/mm: Fix output of total_ram.
  powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards
  powerpc: Correct annotations of pmu registration functions
  ...

Fix up trivial Kconfig/Makefile conflicts in arch/powerpc, drivers, and
drivers/cpufreq
</content>
</entry>
<entry>
<title>powerpc/mm: Fix memory_block_size_bytes() for non-pseries</title>
<updated>2011-07-12T01:16:45Z</updated>
<author>
<name>Benjamin Herrenschmidt</name>
</author>
<published>2011-06-14T00:57:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=770e1ac5f29003fca18af4e67eb5a05ddb5b1491'/>
<id>urn:sha1:770e1ac5f29003fca18af4e67eb5a05ddb5b1491</id>
<content type='text'>
Just compiling pseries in the kernel causes it to override
memory_block_size_bytes() regardless of what is the runtime
platform.

This cleans up the implementation of that function, fixing
a bug or two while at it, so that it's harmless (and potentially
useful) for other platforms. Without this, bugs in that code
would trigger a WARN_ON() in drivers/base/memory.c when
booting some different platforms.

If/when we have another platform supporting memory hotplug we
might want to either move that out to a generic place or
make it a ppc_md. callback.

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
</feed>
