[PATCH 1/2] powerpc/lib/code-patching: refactor patch_instruction()

2017-11-23 Thread Christophe Leroy
patch_instruction() uses almost the same sequence as __patch_instruction() This patch refactor it so that patch_instruction() uses __patch_instruction() instead of duplicating code. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/code-patching.c | 30

[PATCH 2/2] powerpc/lib/feature-fixups: use raw_patch_instruction()

2017-11-23 Thread Christophe Leroy
feature fixups need to use patch_instruction() early in the boot, even before the code is relocated to its final address, requiring patch_instruction() to use PTRRELOC() in order to address data. But feature fixups applies on code before it is set to read only, even for modules. Therefore,

Re: [PATCH 1/2] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-23 Thread Vaibhav Jain
Thanks Mpe for reviewing the patch Michael Ellerman writes: >> To fix this the patch assigns the return value of assign_thread_tidr() >> to a temporary int and assigns it to thread.tidr iff its '> 0'. > > .. and changes the calling convention of the function. > > Now it

Re: [PATCH 2/3] libnvdimm: Add a device-tree interface

2017-11-23 Thread Michael Ellerman
Rob Herring writes: > On Thu, Nov 16, 2017 at 04:51:30AM +1100, Oliver O'Halloran wrote: ... >> diff --git a/drivers/nvdimm/of_nvdimm.c b/drivers/nvdimm/of_nvdimm.c >> new file mode 100644 >> index ..765cbbae8bcb >> --- /dev/null >> +++ b/drivers/nvdimm/of_nvdimm.c >>

Re: [PATCH 1/2] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-23 Thread Michael Ellerman
Vaibhav Jain writes: > There is an unsafe signed to unsigned conversion in set_thread_tidr() > that may cause an error value to be assigned to SPRN_TIDR register and > used as thread-id. > > The issue happens as assign_thread_tidr() returns an int and > thread.tidr is

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Michael Ellerman
"Naveen N. Rao" writes: > Michael Ellerman wrote: >> Balbir Singh writes: >> >>> On Thu, Nov 23, 2017 at 4:32 AM, Mahesh J Salgaonkar >>> wrote: From: Mahesh Salgaonkar

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Michael Ellerman
Balbir Singh writes: > On Fri, Nov 24, 2017 at 12:11 AM, Naveen N. Rao > wrote: >> Michael Ellerman wrote: >>> Balbir Singh writes: ... >>> I think the right thing in the longer run might be to do a

Re: [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels

2017-11-23 Thread David Gibson
On Fri, Nov 24, 2017 at 02:51:02PM +1100, Michael Ellerman wrote: > The code that cleans up the IAMR/AMOR before kexec'ing failed to > remember that when we're running as a guest AMOR is not writable, it's > hypervisor privileged. > > They symptom is that the kexec stops before entering purgatory

Re: [PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels

2017-11-23 Thread Balbir Singh
On Fri, Nov 24, 2017 at 2:51 PM, Michael Ellerman wrote: > The code that cleans up the IAMR/AMOR before kexec'ing failed to > remember that when we're running as a guest AMOR is not writable, it's > hypervisor privileged. > > They symptom is that the kexec stops before

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Balbir Singh
On Fri, Nov 24, 2017 at 12:11 AM, Naveen N. Rao wrote: > Michael Ellerman wrote: >> >> Balbir Singh writes: >> >>> On Thu, Nov 23, 2017 at 4:32 AM, Mahesh J Salgaonkar >>> wrote: From: Mahesh Salgaonkar

[PATCH] powerpc/kexec: Fix kexec/kdump in P9 guest kernels

2017-11-23 Thread Michael Ellerman
The code that cleans up the IAMR/AMOR before kexec'ing failed to remember that when we're running as a guest AMOR is not writable, it's hypervisor privileged. They symptom is that the kexec stops before entering purgatory and nothing else is seen on the console. If you examine the state of the

Re: [RFC PATCH kernel] KVM: PPC: Book3S PR: Fix WIMG handling under pHyp

2017-11-23 Thread Greg Kurz
On Wed, 22 Nov 2017 14:42:21 +1100 Alexey Kardashevskiy wrote: > 96df226 "KVM: PPC: Book3S PR: Preserve storage control bits" added WIMG > bits preserving but it missed 2 special cases: > - a magic page in kvmppc_mmu_book3s_64_xlate() and > - guest real mode in

[PATCH v2 2/2] ASoC: fsl_ssi: add 20-bit sample format for AC'97 and use it for capture

2017-11-23 Thread Maciej S. Szmigiero
When testing AC'97 capture on UDOO board (currently the only user of fsl_ssi driver in the AC'97 mode) it become obvious that there is a massive distortion above certain, small input signal. This problem has been traced to silicon errata ERR003778: "In AC97, 16-bit mode, received data is shifted

[PATCH v2 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20

2017-11-23 Thread Maciej S. Szmigiero
This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not allow 3-byte accesses (including DMA) so a 4-byte (more conventional) format is needed for it. Signed-off-by: Maciej S. Szmigiero

Re: [PATCH] cxl: Add support for ASB_Notify on POWER9

2017-11-23 Thread Benjamin Herrenschmidt
On Thu, 2017-11-23 at 12:05 +0100, Christophe Lombard wrote: > The POWER9 core supports a new feature: ASB_Notify which requires the > support of the Special Purpose Register: TIDR. > > The ASB_Notify command, generated by the AFU, will attempt to > wake-up the host thread identified by the

Re: [PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive()

2017-11-23 Thread Benjamin Herrenschmidt
On Thu, 2017-11-23 at 10:06 +0100, Laurent Vivier wrote: > This is needed to map kvmppc_xive_set_xive() behavior > to kvmppc_xics_set_xive(). > > As we store the server, kvmppc_xive_get_xive() can return > the good value and we can also allow kvmppc_xive_int_on(). > > Signed-off-by: Laurent

Re: [PATCH] cxl: Add support for ASB_Notify on POWER9

2017-11-23 Thread christophe lombard
Le 23/11/2017 à 15:16, Vaibhav Jain a écrit : Hi Christophe, Few review comments: Christophe Lombard writes: + +int cxl_context_thread_tidr(struct cxl_context *ctx, int assign) +{ + int rc = 0; + + /* Clear any TIDR value assigned to the current

Re: [PATCH] cxl: Add support for ASB_Notify on POWER9

2017-11-23 Thread Vaibhav Jain
Hi Christophe, Few review comments: Christophe Lombard writes: > + > +int cxl_context_thread_tidr(struct cxl_context *ctx, int assign) > +{ > + int rc = 0; > + > + /* Clear any TIDR value assigned to the current thread */ > + if (!assign) { > +

Re: [PATCH] SB600 for the Nemo board has non-zero devices on non-root bus

2017-11-23 Thread Michael Ellerman
Hi Christian, Thanks for your patch. Christian Zigotzky writes: > Hi All, > > Just a small patch for the P.A. Semi Nemo board: > > - > > diff -rupN a/drivers/pci/probe.c b/drivers/pci/probe.c > --- a/drivers/pci/probe.c    2017-11-16 08:18:40.504012010 +0100 > +++

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Naveen N. Rao
Michael Ellerman wrote: Balbir Singh writes: On Thu, Nov 23, 2017 at 4:32 AM, Mahesh J Salgaonkar wrote: From: Mahesh Salgaonkar Rebooting into a new kernel with kexec fails in trace_tlbie() which is called from

Re: [PATCH v1] mm: relax deferred struct page requirements

2017-11-23 Thread Michael Ellerman
Pavel Tatashin writes: > There is no need to have ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT, > as all the page initialization code is in common code. > > Also, there is no need to depend on MEMORY_HOTPLUG, as initialization code > does not really use hotplug memory

Re: [PATCH v2 1/2] powerpc/pci: convert to use for_each_pci_bridge() helper

2017-11-23 Thread Michael Ellerman
Bjorn Helgaas writes: > On Fri, Nov 10, 2017 at 07:52:29PM +0200, Andy Shevchenko wrote: >> ...which makes code slightly cleaner. >> >> Requires: d43f59ce6c50 ("PCI: Add for_each_pci_bridge() helper") > > Requires: 24a0c654d7d6 ("PCI: Add for_each_pci_bridge() helper") > >

[PATCH 2/2] powerpc: Do not assign thread.tidr if already assigned

2017-11-23 Thread Vaibhav Jain
If set_thread_tidr() is called twice for same task_struct then it will allocated a new tidr value to it leaving the previous value still dangling in the vas_thread_ida table. To fix this the patch changes set_thread_tidr() checks if a tidr value is already assigned to the task_struct and if yes

[PATCH 1/2] powerpc: Avoid signed to unsigned conversion in set_thread_tidr()

2017-11-23 Thread Vaibhav Jain
There is an unsafe signed to unsigned conversion in set_thread_tidr() that may cause an error value to be assigned to SPRN_TIDR register and used as thread-id. The issue happens as assign_thread_tidr() returns an int and thread.tidr is an unsigned-long. So a negative error code returned from

Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S, U}20_4

2017-11-23 Thread Maciej S. Szmigiero
On 23.11.2017 08:40, Takashi Sakamoto wrote: > On Nov 23 2017 08:44, Maciej S. Szmigiero wrote: >> On 23.11.2017 00:27, Takashi Sakamoto wrote: >>> On Nov 23 2017 04:17, Maciej S. Szmigiero wrote: >> (..) --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -236,7

Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4

2017-11-23 Thread Maciej S. Szmigiero
On 23.11.2017 09:08, Takashi Iwai wrote: > On Wed, 22 Nov 2017 20:17:34 +0100, > Maciej S. Szmigiero wrote: >> >> This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep >> 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not >> allow 3-byte accesses (including

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Michael Ellerman
Balbir Singh writes: > On Thu, Nov 23, 2017 at 4:32 AM, Mahesh J Salgaonkar > wrote: >> From: Mahesh Salgaonkar >> >> Rebooting into a new kernel with kexec fails in trace_tlbie() which is >> called from

Re: [PATCH v2] powerpc: fix boot on BOOK3S_32 with CONFIG_STRICT_KERNEL_RWX

2017-11-23 Thread Michael Ellerman
Christophe LEROY writes: > Le 22/11/2017 à 12:48, Michael Ellerman a écrit : >> Christophe LEROY writes: >>> Le 22/11/2017 à 00:07, Balbir Singh a écrit : On Wed, Nov 22, 2017 at 1:28 AM, Christophe Leroy

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Mahesh Jagannath Salgaonkar
On 11/23/2017 04:26 AM, Balbir Singh wrote: > On Thu, Nov 23, 2017 at 4:32 AM, Mahesh J Salgaonkar > wrote: >> From: Mahesh Salgaonkar >> >> Rebooting into a new kernel with kexec fails in trace_tlbie() which is >> called from

[RESEND PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar Rebooting into a new kernel with kexec fails in trace_tlbie() which is called from native_hpte_clear(). This happens if the running kernel has CONFIG_LOCKDEP enabled. With lockdep enabled, the tracepoints always execute few RCU checks regardless

[PATCH] cxl: Add support for ASB_Notify on POWER9

2017-11-23 Thread Christophe Lombard
The POWER9 core supports a new feature: ASB_Notify which requires the support of the Special Purpose Register: TIDR. The ASB_Notify command, generated by the AFU, will attempt to wake-up the host thread identified by the particular LPID:PID:TID. This patch assign a unique TIDR (thread id) for

Re: [PATCH v6 06/10] powerpc/lib/code-patching: Use alternate map for patch_instruction()

2017-11-23 Thread Michael Ellerman
Christophe LEROY writes: > Le 03/07/2017 à 15:01, Michael Ellerman a écrit : >> From: Balbir Singh >> >> This patch creates the window using text_poke_area, allocated via >> get_vm_area(). text_poke_area is per CPU to avoid locking. >>

Re: [PATCH v3] cxl: Check if vphb exists before iterating over AFU devices

2017-11-23 Thread Frederic Barrat
Le 23/11/2017 à 04:38, Vaibhav Jain a écrit : During an eeh a kernel-oops is reported if no vPHB is allocated to the AFU. This happens as during AFU init, an error in creation of vPHB is a non-fatal error. Hence afu->phb should always be checked for NULL before iterating over it for the

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Naveen N. Rao
Mahesh Jagannath Salgaonkar wrote: On 11/23/2017 12:37 AM, Naveen N. Rao wrote: Mahesh J Salgaonkar wrote: From: Mahesh Salgaonkar Rebooting into a new kernel with kexec fails in trace_tlbie() which is called from native_hpte_clear(). This happens if the running

Re: [PATCH] powernv: Avoid calling trace tlbie in kexec path.

2017-11-23 Thread Mahesh Jagannath Salgaonkar
On 11/23/2017 12:37 AM, Naveen N. Rao wrote: > Mahesh J Salgaonkar wrote: >> From: Mahesh Salgaonkar >> >> Rebooting into a new kernel with kexec fails in trace_tlbie() which is >> called from native_hpte_clear(). This happens if the running kernel has >> CONFIG_LOCKDEP

[PATCH] powerpc/xive: store server for masked interrupt in kvmppc_xive_set_xive()

2017-11-23 Thread Laurent Vivier
This is needed to map kvmppc_xive_set_xive() behavior to kvmppc_xics_set_xive(). As we store the server, kvmppc_xive_get_xive() can return the good value and we can also allow kvmppc_xive_int_on(). Signed-off-by: Laurent Vivier --- arch/powerpc/kvm/book3s_xive.c | 20

Re: [PATCH 1/2] ALSA: pcm: add SNDRV_PCM_FORMAT_{S,U}20_4

2017-11-23 Thread Takashi Iwai
On Wed, 22 Nov 2017 20:17:34 +0100, Maciej S. Szmigiero wrote: > > This format is similar to existing SNDRV_PCM_FORMAT_{S,U}20_3 that keep > 20-bit PCM samples in 3 bytes, however i.MX6 platform SSI FIFO does not > allow 3-byte accesses (including DMA) so a 4-byte format is needed for it. > >