Re: [PATCH v4 1/2] powerpc/eeh: fix pseries_eeh_configure_bridge()

2020-05-06 Thread Nathan Lynch
oop. > > Fix this by correctly bailing out on negative values. Reviewed-by: Nathan Lynch Thanks.

Re: [PATCH v2 3/4] powerpc/memhotplug: Make lmb size 64bit

2020-08-20 Thread Nathan Lynch
"Aneesh Kumar K.V" writes: > @@ -322,12 +322,16 @@ static int pseries_remove_mem_node(struct device_node > *np) > /* >* Find the base address and size of the memblock >*/ > - regs = of_get_property(np, "reg", NULL); > - if (!regs) > + prop = of_get_property(np,

Re: [PATCH v2 1/4] powerpc/drmem: Make lmb_size 64 bit

2020-08-20 Thread Nathan Lynch
u64 lmb_size; > }; > > extern struct drmem_lmb_info *drmem_info; > @@ -67,7 +67,7 @@ struct of_drconf_cell_v2 { > #define DRCONF_MEM_RESERVED 0x0080 > #define DRCONF_MEM_HOTREMOVABLE 0x0100 > > -static inline u32 drmem_lmb_size(void) >

Re: [PATCH v3] pseries/drmem: don't cache node id in drmem_lmb struct

2020-08-14 Thread Nathan Lynch
ion or other events. I'm satisfied that this change does not reintroduce that problem. The removal path still derives the node without going to the device tree, but now performs a more efficient lookup. Reviewed-by: Nathan Lynch

Re: [PATCH v3] pseries/drmem: don't cache node id in drmem_lmb struct

2020-08-14 Thread Nathan Lynch
Nathan Lynch writes: > I'm satisfied that this change does not reintroduce that problem. The > removal path still derives the node without going to the device tree, > but now performs a more efficient lookup. Er, actually it's slightly less efficient in the remove path, as you not

[PATCH 0/2] pseries extended cede cpu offline mode removal

2020-06-01 Thread Nathan Lynch
partition suspend implementation to the Linux suspend framework, and I expect that having only one offline mode for CPUs will make that task quite a bit less complex. Nathan Lynch (2): powerpc/pseries: remove cede offline state for CPUs powerpc/rtas: don't online CPUs for partition suspend Doc

[PATCH 2/2] powerpc/rtas: don't online CPUs for partition suspend

2020-06-01 Thread Nathan Lynch
ot;powerpc/rtas: retry when cpu offline races with suspend/migration") [3] commit dfd718a2ed1f ("powerpc/rtas: Fix a potential race between CPU-Offline & Migration") Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hibernation") Signed

[PATCH 1/2] powerpc/pseries: remove cede offline state for CPUs

2020-06-01 Thread Nathan Lynch
e partition suspend code which temporarily onlines all present CPUs. Fixes: 3aa565f53c39 ("powerpc/pseries: Add hooks to put the CPU into an appropriate offline state") Signed-off-by: Nathan Lynch --- Documentation/core-api/cpu_hotplug.rst| 7 - arch/powerp

Re: Build regressions/improvements in v5.10-rc1

2020-10-26 Thread Nathan Lynch
Geert Uytterhoeven writes: > On Mon, Oct 26, 2020 at 10:46 AM Geert Uytterhoeven > wrote: >> Below is the list of build error/warning regressions/improvements in >> v5.10-rc1[1] compared to v5.9[2]. >> >> Summarized: >> - build errors: +3/-7 >> - build warnings: +26/-28 >> >> Happy fixing!

Re: [PATCH 2/2] powerpc/numa: Remove a redundant variable

2020-07-21 Thread Nathan Lynch
Srikar Dronamraju writes: > In of_drconf_to_nid_single() default_nid always refers to NUMA_NO_NODE. > Hence replace it with NUMA_NO_NODE. > > No functional changes. > ... > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > index a2c5fe0d0cad..b066d89c2975 100644 > ---

Re: [PATCH 1/2] powerpc/numa: Limit possible nodes to within num_possible_nodes

2020-07-21 Thread Nathan Lynch
allocations. If the platform now > increases the nodes to over what was already exposed, then it may lead > to inconsistencies. Hence limit it to the already exposed nodes. > > Suggested-by: Nathan Lynch > Cc: linuxppc-dev > Cc: Michael Ellerman > Cc: Nathan Lynch > Cc: Tyr

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-06 Thread Nathan Lynch
"Aneesh Kumar K.V" writes: > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > index e437a9ac4956..6c659aada55b 100644 > --- a/arch/powerpc/mm/numa.c > +++ b/arch/powerpc/mm/numa.c > @@ -221,25 +221,51 @@ static void initialize_distance_lookup_table(int nid, > } > } > >

Re: [PATCH] powerpc/pseries/hotplug-cpu: increase wait time for vCPU death

2020-08-07 Thread Nathan Lynch
Hi everyone, Michael Ellerman writes: > Greg Kurz writes: >> On Tue, 04 Aug 2020 23:35:10 +1000 >> Michael Ellerman wrote: >>> Spinning forever seems like a bad idea, but as has been demonstrated at >>> least twice now, continuing when we don't know the state of the other >>> CPU can lead to

Re: [PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-08-11 Thread Nathan Lynch
Nathan Lynch writes: > Michael Ellerman writes: >> One thought, which I possibly should not put in writing, is that we >> could use the alignment of the pointer as a poor man's substitute for a >> counter, eg: >> >> +static inline struct drmem_lmb *drm

[PATCH v2] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-08-11 Thread Nathan Lynch
calls which can each take up to 250us, so this ensures the check is performed at worst every few milliseconds. Fixes: 6c6ea53725b3 ("powerpc/mm: Separate ibm, dynamic-memory data from DT format") Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/drmem.h | 18

Re: [PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-08-10 Thread Nathan Lynch
Michael Ellerman writes: > One thought, which I possibly should not put in writing, is that we > could use the alignment of the pointer as a poor man's substitute for a > counter, eg: > > +static inline struct drmem_lmb *drmem_lmb_next(struct drmem_lmb *lmb) > +{ > + if (lmb % PAGE_SIZE == 0)

Re: [PATCH v2] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-08-12 Thread Nathan Lynch
Hi Christophe, Christophe Leroy writes: >> +static inline struct drmem_lmb *drmem_lmb_next(struct drmem_lmb *lmb) >> +{ >> +const unsigned int resched_interval = 20; >> + >> +BUG_ON(lmb < drmem_info->lmbs); >> +BUG_ON(lmb >= drmem_info->lmbs + drmem_info->n_lmbs); > > BUG_ON() shall

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-07 Thread Nathan Lynch
"Aneesh Kumar K.V" writes: > On 8/7/20 9:54 AM, Nathan Lynch wrote: >> "Aneesh Kumar K.V" writes: >>> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c >>> index e437a9ac4956..6c659aada55b 100644 >>> --- a/arch/powerpc/mm/numa.c

Re: [PATCH v2 2/2] powerpc/pseries: new lparcfg key/value pair: partition_affinity_score

2020-08-06 Thread Nathan Lynch
Michael Ellerman writes: > Tyrel Datwyler writes: >> On 7/27/20 11:46 AM, Scott Cheloha wrote: >>> The H_GetPerformanceCounterInfo (GPCI) PHYP hypercall has a subcall, >>> Affinity_Domain_Info_By_Partition, which returns, among other things, >>> a "partition affinity score" for a given LPAR.

Re: [PATCH v2 2/2] powerpc/pseries: new lparcfg key/value pair: partition_affinity_score

2020-08-06 Thread Nathan Lynch
,6 +520,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void > *v) > partition_active_processors * 100); > } > > + show_gpci_data(m); > + > seq_printf(m, "partition_active_processors=%d\n", > partition_active_processors); Acked-by: Nathan Lynch

Re: [PATCH v2 1/2] powerpc/perf: consolidate GPCI hcall structs into asm/hvcall.h

2020-08-06 Thread Nathan Lynch
> > Signed-off-by: Scott Cheloha Acked-by: Nathan Lynch

Re: [PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-07-31 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> Michael Ellerman writes: >>> Nathan Lynch writes: >>>> Laurent Dufour writes: >>>>> Le 28/07/2020 à 19:37, Nathan Lynch a écrit : >>>>>> The drmem lmb list can have hundreds

Re: [PATCH v2] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-08-12 Thread Nathan Lynch
Michael Ellerman writes: > Tyrel Datwyler writes: >> On 8/11/20 6:20 PM, Nathan Lynch wrote: >>> >>> +static inline struct drmem_lmb *drmem_lmb_next(struct drmem_lmb *lmb) >>> +{ >>> + const unsigned int resched_interval = 20; >>> + >

[PATCH v3] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-08-13 Thread Nathan Lynch
Signed-off-by: Nathan Lynch --- Notes: Changes since v2: * Make drmem_lmb_next() more general. * Adjust reschedule interval for better code generation. * Add commentary to drmem_lmb_next() to explain the cond_resched() call. * Remove bounds assertions. Changes since v1:

Re: [RFC PATCH 1/2] powerpc/numa: Introduce logical numa id

2020-08-13 Thread Nathan Lynch
Hi Aneesh, "Aneesh Kumar K.V" writes: > "Aneesh Kumar K.V" writes: >> On 8/8/20 2:15 AM, Nathan Lynch wrote: >>> "Aneesh Kumar K.V" writes: >>>> On 8/7/20 9:54 AM, Nathan Lynch wrote: >>>>> "Aneesh Kumar K

Re: [PATCH] powerpc/pseries/hotplug-cpu: increase wait time for vCPU death

2020-08-11 Thread Nathan Lynch
Michael Ellerman writes: > Michael Roth writes: >> Quoting Nathan Lynch (2020-08-07 02:05:09) > ... >>> wait_for_cpu_stopped() should be able to accommodate a time-based >>> warning if necessary, but speaking as a likely recipient of any bug >>> reports t

Re: [PATCH] powerpc/numa: Restrict possible nodes based on platform

2020-07-10 Thread Nathan Lynch
;> > >> > $ cat /sys/devices/system/node/possible ##After patch >> > 0-1 >> > >> > Note the maximum nodes this platform can support is only 2 but the >> > possible nodes is set to 32. >> >> But what about LPM to a system with more nodes? &g

Re: [PATCH] powerpc/numa: Restrict possible nodes based on platform

2020-07-06 Thread Nathan Lynch
Srikar Dronamraju writes: > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > index 9fcf2d195830..3d55cef1a2dc 100644 > --- a/arch/powerpc/mm/numa.c > +++ b/arch/powerpc/mm/numa.c > @@ -897,7 +897,7 @@ static void __init find_possible_nodes(void) > return; > >

Re: [PATCH] powerpc/pseries: new lparcfg key/value pair: partition_affinity_score

2020-06-19 Thread Nathan Lynch
Hi Tyrel, Tyrel Datwyler writes: > On 6/19/20 8:34 AM, Scott Cheloha wrote: >> The H_GetPerformanceCounterInfo PHYP hypercall has a subcall, >> Affinity_Domain_Info_By_Partition, which returns, among other things, >> a "partition affinity score" for a given LPAR. This score, a value on >>

[PATCH 03/18] powerpc/numa: remove ability to enable topology updates

2020-06-11 Thread Nathan Lynch
Remove the /proc/powerpc/topology_updates interface and the topology_updates=on/off command line argument. The internal topology_updates_enabled flag remains for now, but always false. Signed-off-by: Nathan Lynch --- arch/powerpc/mm/numa.c | 71 +- 1 file

[PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events

2020-06-11 Thread Nathan Lynch
in normal operation and usually arise from operator-initiated actions such as a DPO (Dynamic Platform Optimizer) run. Eventually we do want to consume these events and update the device tree, but that needs more care to be safe vs LPM and DLPAR. Signed-off-by: Nathan Lynch --- arch/powerpc/kernel

[PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const

2020-06-11 Thread Nathan Lynch
Previous changes have made it so these flags are never changed; enforce this by making them const. Signed-off-by: Nathan Lynch --- arch/powerpc/mm/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 9e20f12e6caf

[PATCH 06/18] powerpc/numa: remove unreachable topology timer code

2020-06-11 Thread Nathan Lynch
Since vphn_enabled is always 0, we can stub out timed_topology_update() and remove the code which becomes unreachable. Signed-off-by: Nathan Lynch --- arch/powerpc/mm/numa.c | 21 - 1 file changed, 21 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c

[PATCH 16/18] powerpc/pseries: remove memory "re-add" implementation

2020-06-11 Thread Nathan Lynch
dlpar_memory() no longer has any callers which pass PSERIES_HP_ELOG_ACTION_READD. Remove this case and the corresponding unreachable code. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 - .../platforms/pseries/hotplug-memory.c| 42

[PATCH 01/18] powerpc/pseries: remove cede offline state for CPUs

2020-06-11 Thread Nathan Lynch
e partition suspend code which temporarily onlines all present CPUs. Fixes: 3aa565f53c39 ("powerpc/pseries: Add hooks to put the CPU into an appropriate offline state") Signed-off-by: Nathan Lynch Reviewed-by: Gautham R. Shenoy --- Documentation/core-api/cpu_hotplug.rst| 7 - arch

[PATCH 00/18] remove extended cede offline mode and bogus topology update code

2020-06-11 Thread Nathan Lynch
ustain new features. Nathan Lynch (18): powerpc/pseries: remove cede offline state for CPUs powerpc/rtas: don't online CPUs for partition suspend powerpc/numa: remove ability to enable topology updates powerpc/numa: remove unreachable topology update code powerpc/numa: make vphn_enabled, pr

[PATCH 11/18] powerpc/numa: remove start/stop_topology_update()

2020-06-11 Thread Nathan Lynch
These APIs have become no-ops, so remove them and all call sites. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/topology.h | 10 -- arch/powerpc/mm/numa.c| 20 arch/powerpc/platforms/pseries/mobility.c | 4 arch/powerpc

[PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code

2020-06-11 Thread Nathan Lynch
Since vphn_enabled is always 0, we can remove the call to topology_schedule_update() and remove the code which becomes unreachable as a result. Signed-off-by: Nathan Lynch --- arch/powerpc/mm/numa.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch

[PATCH 18/18] powerpc/pseries: remove obsolete memory hotplug DT notifier code

2020-06-11 Thread Nathan Lynch
in user space. I don't see a purpose for it now. Signed-off-by: Nathan Lynch --- .../platforms/pseries/hotplug-memory.c| 65 +-- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries

[PATCH 04/18] powerpc/numa: remove unreachable topology update code

2020-06-11 Thread Nathan Lynch
Since the topology_updates_enabled flag is now always false, remove it and the code which has become unreachable. This is the minimum change that prevents 'defined but unused' warnings emitted by the compiler after stubbing out the start/stop_topology_updates() functions. Signed-off-by: Nathan

[PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology()

2020-06-11 Thread Nathan Lynch
becomes unreachable as a result. Signed-off-by: Nathan Lynch --- arch/powerpc/mm/numa.c | 193 + 1 file changed, 1 insertion(+), 192 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 8749d7f2b1a6..b220e5b60140 100644

[PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags

2020-06-11 Thread Nathan Lynch
These flags are always zero now; remove them and suitably adjust the remaining references to them. Signed-off-by: Nathan Lynch --- arch/powerpc/mm/numa.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 8415481a7f13

[PATCH 15/18] powerpc/pseries: remove prrn special case from DT update path

2020-06-11 Thread Nathan Lynch
(). Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 27 --- 1 file changed, 27 deletions(-) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index c0b09f6f0ae3..78cd772a579b 100644 --- a/arch/powerpc

[PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology

2020-06-11 Thread Nathan Lynch
Since arch_update_cpu_topology() doesn't do anything on powerpc now, remove it and associated dead code. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/topology.h | 6 -- arch/powerpc/mm/numa.c | 10 -- 2 files changed, 16 deletions(-) diff --git a/arch

[PATCH 10/18] powerpc/numa: remove timed_topology_update()

2020-06-11 Thread Nathan Lynch
timed_topology_update is a no-op now, so remove it and all call sites. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/topology.h | 5 - arch/powerpc/mm/numa.c | 9 - arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 -- 3 files changed, 16

[PATCH 13/18] powerpc/numa: remove prrn_is_enabled()

2020-06-11 Thread Nathan Lynch
All users of this prrn_is_enabled() are gone; remove it. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/topology.h | 5 - arch/powerpc/mm/numa.c | 5 - 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm

[PATCH 02/18] powerpc/rtas: don't online CPUs for partition suspend

2020-06-11 Thread Nathan Lynch
ot;powerpc/rtas: retry when cpu offline races with suspend/migration") [3] commit dfd718a2ed1f ("powerpc/rtas: Fix a potential race between CPU-Offline & Migration") Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hibernation") Signed

[PATCH 17/18] powerpc/pseries: remove dlpar_cpu_readd()

2020-06-11 Thread Nathan Lynch
dlpar_cpu_readd() is unused now. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/topology.h | 1 - arch/powerpc/platforms/pseries/hotplug-cpu.c | 19 --- 2 files changed, 20 deletions(-) diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include

Re: [PATCH 1/2] powerpc/pseries: remove cede offline state for CPUs

2020-06-03 Thread Nathan Lynch
Hi Gautham, Gautham R Shenoy writes: > On Mon, Jun 01, 2020 at 11:31:39PM -0500, Nathan Lynch wrote: >> This effectively reverts commit 3aa565f53c39 ("powerpc/pseries: Add >> hooks to put the CPU into an appropriate offline state"), which added >> an offline mode

Re: [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-07-24 Thread Nathan Lynch
Pingfan Liu writes: > On Thu, Jul 23, 2020 at 9:27 PM Nathan Lynch wrote: >> Pingfan Liu writes: >> > This will introduce extra dt updating payload for each involved lmb when >> > hotplug. >> > But it should be fine since drmem_update_dt() is mem

Re: [PATCHv3 2/2] powerpc/pseries: update device tree before ejecting hotplug uevents

2020-07-23 Thread Nathan Lynch
Pingfan Liu writes: > A bug is observed on pseries by taking the following steps on rhel: > -1. drmgr -c mem -r -q 5 > -2. echo c > /proc/sysrq-trigger > > And then, the failure looks like: > kdump: saving to /sysroot//var/crash/127.0.0.1-2020-01-16-02:06:14/ > kdump: saving vmcore-dmesg.txt >

Re: [PATCH v3 0/4] powerpc/mm/radix: Memory unplug fixes

2020-07-16 Thread Nathan Lynch
"Aneesh Kumar K.V" writes: > This is the next version of the fixes for memory unplug on radix. > The issues and the fix are described in the actual patches. I guess this isn't actually causing problems at runtime right now, but I notice calls to resize_hpt_for_hotplug() from arch_add_memory()

[PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-07-28 Thread Nathan Lynch
. Rather than placing cond_resched() calls within various for_each_drmem_lmb() loop blocks in the code, put it in the iteration expression of the loop macro itself so users can't omit it. Fixes: 6c6ea53725b3 ("powerpc/mm: Separate ibm, dynamic-memory data from DT format") Signed-off-by: Na

Re: [PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-07-28 Thread Nathan Lynch
Hi Laurent, Laurent Dufour writes: > Le 28/07/2020 à 19:37, Nathan Lynch a écrit : >> The drmem lmb list can have hundreds of thousands of entries, and >> unfortunately lookups take the form of linear searches. As long as >> this is the case, traversals have the potential

Re: [PATCHv3 1/2] powerpc/pseries: group lmb operation and memblock's

2020-07-23 Thread Nathan Lynch
Pingfan Liu writes: > This patch prepares for the incoming patch which swaps the order of KOBJ_ > uevent and dt's updating. > > It has no functional effect, just groups lmb operation and memblock's in > order to insert dt updating operation easily, and makes it easier to > review. ... > diff

Re: [PATCH] powerpc/pseries: explicitly reschedule during drmem_lmb list traversal

2020-07-30 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> Laurent Dufour writes: >>> Le 28/07/2020 à 19:37, Nathan Lynch a écrit : >>>> The drmem lmb list can have hundreds of thousands of entries, and >>>> unfortunately lookups take the form of linear

Re: [PATCH] powerpc/numa: Restrict possible nodes based on platform

2020-07-06 Thread Nathan Lynch
Tyrel Datwyler writes: >> --- a/arch/powerpc/mm/numa.c >> +++ b/arch/powerpc/mm/numa.c >> @@ -897,7 +897,7 @@ static void __init find_possible_nodes(void) >> return; >> >> if (of_property_read_u32_index(rtas, >> -"ibm,max-associativity-domains", >> +

[PATCH] powerpc/pseries/dlpar: handle ibm, configure-connector delay status

2021-01-06 Thread Nathan Lynch
delay status (9900..9905) goes completely unhandled, causing the configuration to unnecessarily terminate. Fix both of these issues by using rtas_busy_delay(). Fixes: ab519a011caa ("powerpc/pseries: Kernel DLPAR Infrastructure") Signed-off-by: Nathan Lynch --- arch/powerpc/platfor

Re: [PATCH 01/29] powerpc/rtas: move rtas_call_reentrant() out of pseries guards

2020-12-04 Thread Nathan Lynch
Nathan Lynch writes: > rtas_call_reentrant() isn't platform-dependent; move it out of > CONFIG_PPC_PSERIES-guarded code. As reported by the 0-day CI, this is mistaken, and it breaks non-pseries builds: >> arch/powerpc/kernel/rtas.c:938:21: error: no member named >> 'r

[PATCH v2 01/28] powerpc/rtas: prevent suspend-related sys_rtas use on LE

2020-12-07 Thread Nathan Lynch
. drmgr is the only known (or plausible) user of ibm,suspend-me, ibm,update-nodes, and ibm,update-properties, so allow them only in big-endian configurations. Signed-off-by: Nathan Lynch --- arch/powerpc/kernel/rtas.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel

[PATCH v2 05/28] powerpc/rtas: add rtas_activate_firmware()

2020-12-07 Thread Nathan Lynch
. Just log it and continue. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/rtas.c | 30 ++ 2 files changed, 31 insertions(+) diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index

[PATCH v2 09/28] powerpc/pseries/mobility: error message improvements

2020-12-07 Thread Nathan Lynch
- Convert printk(KERN_ERR) to pr_err(). - Include errno in property update failure message. - Remove reference to "Post-mobility" from device tree update message: with pr_err() it will have a "mobility:" prefix. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/ps

[PATCH v2 15/28] powerpc/rtas: dispatch partition migration requests to pseries

2020-12-07 Thread Nathan Lynch
-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 5 + arch/powerpc/kernel/rtas.c| 2 +- arch/powerpc/platforms/pseries/mobility.c | 5 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h

[PATCH v2 20/28] powerpc/machdep: remove suspend_disable_cpu()

2020-12-07 Thread Nathan Lynch
There are no users left of the suspend_disable_cpu() callback, remove it. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/machdep.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 475687f24f4a

[PATCH v2 23/28] powerpc/rtas: remove unused rtas_suspend_last_cpu()

2020-12-07 Thread Nathan Lynch
rtas_suspend_last_cpu() is now unused, remove it and __rtas_suspend_last_cpu() which also becomes unused. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 - arch/powerpc/kernel/rtas.c | 43 - 2 files changed, 44 deletions(-) diff --git

[PATCH v2 11/28] powerpc/pseries/mobility: extract VASI session polling logic

2020-12-07 Thread Nathan Lynch
-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 69 +-- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 01ac7c03558e..573ed48b43d8 100644 --- a/arch

[PATCH v2 04/28] powerpc/rtas: add rtas_ibm_suspend_me()

2020-12-07 Thread Nathan Lynch
Now that the name is available, provide a simple wrapper for ibm,suspend-me which returns both a Linux errno and optionally the actual RTAS status to the caller. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/rtas.c | 57

[PATCH v2 12/28] powerpc/pseries/mobility: use stop_machine for join/suspend

2020-12-07 Thread Nathan Lynch
/ watchdog on resume to prevent lockup warnings when the OS has been suspended for a time exceeding the threshold. Fixes: 91dc182ca6e2 ("[PATCH] powerpc: special-case ibm,suspend-me RTAS call") Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 132 +++

[PATCH v2 24/28] powerpc/pseries/hibernation: remove redundant cacheinfo update

2020-12-07 Thread Nathan Lynch
redundant since commit e610a466d16a ("powerpc/pseries/mobility: rebuild cacheinfo hierarchy post-migration"). Fixes: e610a466d16a ("powerpc/pseries/mobility: rebuild cacheinfo hierarchy post-migration") Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/suspe

[PATCH v2 06/28] powerpc/hvcall: add token and codes for H_VASI_SIGNAL

2020-12-07 Thread Nathan Lynch
H_VASI_SIGNAL can be used by a partition to request cancellation of its migration. To be used in future changes. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/hvcall.h | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc

[PATCH v2 17/28] powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops

2020-12-07 Thread Nathan Lynch
optional, so we can simply remove that assignment with no loss of function. Fixes: 32d8ad4e621d ("powerpc/pseries: Partition hibernation support") Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/suspend.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/p

[PATCH v2 27/28] powerpc/rtas: remove unused rtas_suspend_me_data

2020-12-07 Thread Nathan Lynch
All code which used this type has been removed. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas-types.h | 8 1 file changed, 8 deletions(-) diff --git a/arch/powerpc/include/asm/rtas-types.h b/arch/powerpc/include/asm/rtas-types.h index aa420561bc10..8df6235d64d1 100644

[PATCH v2 18/28] powerpc/pseries/hibernation: pass stream id via function arguments

2020-12-07 Thread Nathan Lynch
There is no need for the stream id to be a file-global variable; pass it from hibernate_store() to pseries_suspend_begin() for the H_VASI_STATE call. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/suspend.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

[PATCH v2 26/28] powerpc/pseries/hibernation: remove prepare_late() callback

2020-12-07 Thread Nathan Lynch
The pseries hibernate code no longer calls into the original join/suspend code in kernel/rtas.c, so pseries_prepare_late() and related code don't accomplish anything now. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/suspend.c | 25 1 file changed, 25

[PATCH v2 14/28] powerpc/pseries/mobility: retry partition suspend after error

2020-12-07 Thread Nathan Lynch
log event on each unsuccessful attempt. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 59 ++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobili

[PATCH v2 28/28] powerpc/pseries/mobility: refactor node lookup during DT update

2020-12-07 Thread Nathan Lynch
and corresponding refcount management. Move the lookup and of_node_put() into pseries_devicetree_update(), and emit a warning on any failed lookups. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 49 --- 1 file changed, 17 insertions(+), 32 deletions

[PATCH v2 00/28] partition suspend updates

2020-12-07 Thread Nathan Lynch
pseries") - Fix refcount imbalance in add_dt_node() error path. ("powerpc/pseries/mobility: refactor node lookup during DT update") Nathan Lynch (28): powerpc/rtas: prevent suspend-related sys_rtas use on LE powerpc/rtas: complete ibm,suspend-me status codes powerpc/rtas: rtas_ibm_suspe

[PATCH v2 07/28] powerpc/pseries/mobility: don't error on absence of ibm, update-nodes

2020-12-07 Thread Nathan Lynch
Treat the absence of the ibm,update-nodes function as benign instead of reporting an error. If the platform does not provide that facility, it's not a problem for Linux. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 10/28] powerpc/pseries/mobility: use rtas_activate_firmware() on resume

2020-12-07 Thread Nathan Lynch
It's incorrect to abort post-suspend processing if ibm,activate-firmware isn't available. Use rtas_activate_firmware(), which logs this condition appropriately and allows us to proceed. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 15 +-- 1 file

[PATCH v2 22/28] powerpc/pseries/hibernation: switch to rtas_ibm_suspend_me()

2020-12-07 Thread Nathan Lynch
the rtas_ibm_suspend_me() wrapper function directly from pseries_suspend_enter() instead of using rtas_suspend_last_cpu(). Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/suspend.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/pseries/suspend.c

[PATCH v2 08/28] powerpc/pseries/mobility: add missing break to default case

2020-12-07 Thread Nathan Lynch
update_dt_node() has a switch statement where the default case lacks a break statement. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries

[PATCH v2 13/28] powerpc/pseries/mobility: signal suspend cancellation to platform

2020-12-07 Thread Nathan Lynch
. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 5a3951626a96..f234a7ed87aa 100644 --- a/arch/powerpc

[PATCH v2 21/28] powerpc/rtas: remove rtas_suspend_cpu()

2020-12-07 Thread Nathan Lynch
rtas_suspend_cpu() no longer has users; remove it and __rtas_suspend_cpu() which now becomes unused as well. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 - arch/powerpc/kernel/rtas.c | 52 - 2 files changed, 53 deletions(-) diff

[PATCH v2 25/28] powerpc/pseries/hibernation: perform post-suspend fixups later

2020-12-07 Thread Nathan Lynch
pseries_suspend_enable_irqs(). Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/suspend.c | 21 - 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c index 6a94cc0deb88..589a91730db8 100644

[PATCH v2 03/28] powerpc/rtas: rtas_ibm_suspend_me -> rtas_ibm_suspend_me_unsafe

2020-12-07 Thread Nathan Lynch
it should not gain users. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 2 +- arch/powerpc/kernel/rtas.c| 6 +++--- arch/powerpc/platforms/pseries/mobility.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/as

[PATCH v2 02/28] powerpc/rtas: complete ibm,suspend-me status codes

2020-12-07 Thread Nathan Lynch
We don't completely account for the possible return codes for ibm,suspend-me. Add definitions for these. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc

[PATCH v2 16/28] powerpc/rtas: remove rtas_ibm_suspend_me_unsafe()

2020-12-07 Thread Nathan Lynch
rtas_ibm_suspend_me_unsafe() is now unused; remove it and rtas_percpu_suspend_me() which becomes unused as a result. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 - arch/powerpc/kernel/rtas.c | 67 + 2 files changed, 1 insertion

[PATCH v2 19/28] powerpc/pseries/hibernation: remove pseries_suspend_cpu()

2020-12-07 Thread Nathan Lynch
Since commit 48f6e7f6d948 ("powerpc/pseries: remove cede offline state for CPUs"), ppc_md.suspend_disable_cpu() is no longer used and all CPUs (save one) are placed into true offline state as opposed to H_JOIN. So pseries_suspend_cpu() is effectively unused; remove it. Signed-off-by: Na

Re: [PATCH 12/29] powerpc/pseries/mobility: extract VASI session polling logic

2020-12-04 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> The behavior of rtas_ibm_suspend_me_unsafe() is to return -EAGAIN to >> the caller until the specified VASI suspend session state makes the >> transition from H_VASI_ENABLED to H_VASI_SUSPENDING. In the interest >

Re: [PATCH 03/29] powerpc/rtas: complete ibm,suspend-me status codes

2020-12-04 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> We don't completely account for the possible return codes for >> ibm,suspend-me. Add definitions for these. >> >> Signed-off-by: Nathan Lynch >> --- >> arch/powerpc/include/asm/rtas.h | 7 ++- >>

Re: [PATCH 13/29] powerpc/pseries/mobility: use stop_machine for join/suspend

2020-12-04 Thread Nathan Lynch
Hi Michael, Michael Ellerman writes: > Nathan Lynch writes: >> The partition suspend sequence as specified in the platform >> architecture requires that all active processor threads call >> H_JOIN, which: > ... >> diff --git a/arch/powerpc/platforms/pseries

Re: [PATCH 16/29] powerpc/rtas: dispatch partition migration requests to pseries

2020-12-04 Thread Nathan Lynch
Michael Ellerman writes: > Nathan Lynch writes: >> sys_rtas() cannot call ibm,suspend-me directly in the same way it >> handles other inputs. Instead it must dispatch the request to code >> that can first perform the H_JOIN sequence before any call to >> ibm,suspen

Re: [PATCH] powerpc/pseries/hotplug-cpu: Fix memleak when cpus node not exist

2020-11-10 Thread Nathan Lynch
Zhang Xiaoxu writes: > From: zhangxiaoxu > > If the cpus nodes not exist, we lost to free the 'cpu_drcs', which > will leak memory. > > Fixes: a0ff72f9f5a7 ("powerpc/pseries/hotplug-cpu: Remove double free in > error path") > Reported-by: Hulk Robot > Signed-off-by: zhangxiaoxu > --- >

Re: [PATCH 29/29] powerpc/pseries/mobility: refactor node lookup during DT update

2020-11-20 Thread Nathan Lynch
Nathan Lynch writes: > In pseries_devicetree_update(), with each call to ibm,update-nodes the > partition firmware communicates the node to be deleted or updated by > placing its phandle in the work buffer. Each of delete_dt_node(), > update_dt_node(), and add_dt_node() have dupli

Re: [PATCH 02/29] powerpc/rtas: prevent suspend-related sys_rtas use on LE

2020-10-30 Thread Nathan Lynch
Andrew Donnellan writes: > On 30/10/20 12:17 pm, Nathan Lynch wrote: >> While drmgr has had work in some areas to make its RTAS syscall >> interactions endian-neutral, its code for performing partition >> migration via the syscall has never worked on LE. While it is ab

[PATCH 10/29] powerpc/pseries/mobility: error message improvements

2020-10-29 Thread Nathan Lynch
- Convert printk(KERN_ERR) to pr_err(). - Include errno in property update failure message. - Remove reference to "Post-mobility" from device tree update message: with pr_err() it will have a "mobility:" prefix. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/ps

[PATCH 11/29] powerpc/pseries/mobility: use rtas_activate_firmware() on resume

2020-10-29 Thread Nathan Lynch
It's incorrect to abort post-suspend processing if ibm,activate-firmware isn't available. Use rtas_activate_firmware(), which logs this condition appropriately and allows us to proceed. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 15 +-- 1 file

[PATCH 12/29] powerpc/pseries/mobility: extract VASI session polling logic

2020-10-29 Thread Nathan Lynch
-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 76 +-- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index dc6abf164db7..1b8ae221b98a 100644 --- a/arch

[PATCH 14/29] powerpc/pseries/mobility: signal suspend cancellation to platform

2020-10-29 Thread Nathan Lynch
. Signed-off-by: Nathan Lynch --- arch/powerpc/platforms/pseries/mobility.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index 44ca7d4e143d..0f592246f345 100644 --- a/arch/powerpc

[PATCH 16/29] powerpc/rtas: dispatch partition migration requests to pseries

2020-10-29 Thread Nathan Lynch
returning, but experimentation indicates this is tolerated fine by legacy user space. Signed-off-by: Nathan Lynch --- arch/powerpc/include/asm/rtas.h | 1 + arch/powerpc/kernel/rtas.c| 8 +++- arch/powerpc/platforms/pseries/mobility.c | 5 + 3 files changed, 13

<    1   2   3   4   5   6   7   8   9   >