<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/platforms/pseries/hotplug-memory.c, branch linux-3.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-09-09T00:37:00Z</updated>
<entry>
<title>powerpc/pseries: Fix endian issues in memory hotplug</title>
<updated>2014-09-09T00:37:00Z</updated>
<author>
<name>Thomas Falcon</name>
</author>
<published>2014-08-19T20:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c9ac408bc7329911237c25508f578fb2fa1c4235'/>
<id>urn:sha1:c9ac408bc7329911237c25508f578fb2fa1c4235</id>
<content type='text'>
Values acquired from Open Firmware are in 32-bit big endian format
and need to be handled on little endian architectures.  This patch
ensures values are in cpu endian when hotplugging memory.

Signed-off-by: Thomas Falcon &lt;tlfalcon@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc</title>
<updated>2014-08-14T16:14:07Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2014-08-14T16:14:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1d508f8ace3e78e96da70f1cf4e36b80f22b5fa9'/>
<id>urn:sha1:1d508f8ace3e78e96da70f1cf4e36b80f22b5fa9</id>
<content type='text'>
Pull more powerpc updates from Ben Herrenschmidt:
 "Here are some more powerpc bits for 3.17, essentially fixes.

  The biggest series, also aimed at -stable, is from Aneesh and is the
  result of weeks and weeks of debugging to find out why the heck or THP
  implementation was occasionally triggering multi-hit errors in our
  level 1 TLB.  It ended up being a combination of issues including
  subtleties as to how we should invalidate those special 'MPSS' pages
  we use to allow the use of 16M pages inside 4K/64K "base page size"
  segments (you really have to love our MMU !)

  Another interesting one in the "OMG" category is the series from
  Michael adding memory barriers to spin_is_locked().  That's also the
  result of many days of debugging to figure out why the semaphore code
  would occasionally crash in ways that made no sense.  It ended up
  being some creative lock stacking that was defeated by the fact that
  our locks allow a load inside the locked section to be re-ordered with
  the load of the lock value itself (I'm still of two mind about whether
  to kill that once and for all by putting a heavier barrier back into
  our lock implementation...).  The fixes come with a long explanation
  in the cset comments, feel free to read it if you feel like having a
  headache today"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (25 commits)
  powerpc/thp: Add tracepoints to track hugepage invalidate
  powerpc/mm: Use read barrier when creating real_pte
  powerpc/thp: Use ACCESS_ONCE when loading pmdp
  powerpc/thp: Invalidate with vpn in loop
  powerpc/thp: Handle combo pages in invalidate
  powerpc/thp: Invalidate old 64K based hash page mapping before insert of 4k pte
  powerpc/thp: Don't recompute vsid and ssize in loop on invalidate
  powerpc/thp: Add write barrier after updating the valid bit
  powerpc: reorder per-cpu NUMA information's initialization
  powerpc/perf/hv-24x7: Use kmem_cache_free
  powerpc/pseries/hvcserver: Fix endian issue in hvcs_get_partner_info
  powerpc: Hard disable interrupts in xmon
  powerpc: remove duplicate definition of TEXASR_FS
  powerpc/pseries: Avoid deadlock on removing ddw
  powerpc/pseries: Failure on removing device node
  powerpc/boot: Use correct zlib types for comparison
  powerpc/powernv: Interface to register/unregister opal dump region
  printk: Add function to return log buffer address and size
  powerpc: Add POWER8 features to CPU_FTRS_POSSIBLE/ALWAYS
  powerpc/ppc476: Disable BTAC
  ...
</content>
</entry>
<entry>
<title>powerpc/pseries: Failure on removing device node</title>
<updated>2014-08-13T05:13:46Z</updated>
<author>
<name>Gavin Shan</name>
</author>
<published>2014-08-11T09:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1b3929c232784580e5d8ee324b6bc634e709575'/>
<id>urn:sha1:f1b3929c232784580e5d8ee324b6bc634e709575</id>
<content type='text'>
While running command "drmgr -c phb -r -s 'PHB 528'", following
backtrace jumped out because the target device node isn't marked
with OF_DETACHED by of_detach_node(), which caused by error
returned from memory hotplug related reconfig notifier when
disabling CONFIG_MEMORY_HOTREMOVE. The patch fixes it.

ERROR: Bad of_node_put() on /pci@800000020000210/ethernet@0
CPU: 14 PID: 2252 Comm: drmgr Tainted: G        W     3.16.0+ #427
Call Trace:
[c000000012a776a0] [c000000000013d9c] .show_stack+0x88/0x148 (unreliable)
[c000000012a77750] [c00000000083cd34] .dump_stack+0x7c/0x9c
[c000000012a777d0] [c0000000006807c4] .of_node_release+0x58/0xe0
[c000000012a77860] [c00000000038a7d0] .kobject_release+0x174/0x1b8
[c000000012a77900] [c00000000038a884] .kobject_put+0x70/0x78
[c000000012a77980] [c000000000681680] .of_node_put+0x28/0x34
[c000000012a77a00] [c000000000681ea8] .__of_get_next_child+0x64/0x70
[c000000012a77a90] [c000000000682138] .of_find_node_by_path+0x1b8/0x20c
[c000000012a77b40] [c000000000051840] .ofdt_write+0x308/0x688
[c000000012a77c20] [c000000000238430] .proc_reg_write+0xb8/0xd4
[c000000012a77cd0] [c0000000001cbeac] .vfs_write+0xec/0x1f8
[c000000012a77d70] [c0000000001cc3b0] .SyS_write+0x58/0xa0
[c000000012a77e30] [c00000000000a064] syscall_exit+0x0/0x98

Cc: stable@vger.kernel.org
Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<entry>
<title>of: Reorder device tree changes and notifiers</title>
<updated>2014-07-23T23:08:13Z</updated>
<author>
<name>Grant Likely</name>
</author>
<published>2014-07-16T18:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=259092a35c7e11f1d4616b0f5b3ba7b851fe4fa6'/>
<id>urn:sha1:259092a35c7e11f1d4616b0f5b3ba7b851fe4fa6</id>
<content type='text'>
Currently, devicetree reconfig notifiers get emitted before the change
is applied to the tree, but that behaviour is problematic if the
receiver wants the determine the new state of the tree. The current
users don't care, but the changeset code to follow will be making
multiple changes at once. Reorder notifiers to get emitted after the
change has been applied to the tree so that callbacks see the new tree
state.

At the same time, fixup the existing callbacks to expect the new order.
There are a few callbacks that compare the old and new values of a
changed property. Put both property pointers into the of_prop_reconfig
structure.

The current notifiers also allow the notifier callback to fail and
cancel the change to the tree, but that feature isn't actually used.
It really isn't valid to ignore a tree modification provided by firmware
anyway, so remove the ability to cancel a change to the tree.

Signed-off-by: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Nathan Fontenot &lt;nfont@austin.ibm.com&gt;
</content>
</entry>
<entry>
<title>powerpc: Allow ppc_md platform hook to override memory_block_size_bytes</title>
<updated>2014-06-05T03:20:39Z</updated>
<author>
<name>Anton Blanchard</name>
</author>
<published>2014-06-04T07:50:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5d862576a64cb3e0c22dc9cc2170e4d750714f9'/>
<id>urn:sha1:a5d862576a64cb3e0c22dc9cc2170e4d750714f9</id>
<content type='text'>
The pseries platform code unconditionally overrides
memory_block_size_bytes regardless of the running platform.

Create a ppc_md hook that so each platform can choose to
do what it wants.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
<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>
</feed>
