Re: [PATCH v3 2/2] cxl: Enable global TLBIs for cxl contexts

2017-09-07 Thread Nicholas Piggin
On Sun, 3 Sep 2017 20:15:13 +0200 Frederic Barrat wrote: > The PSL and nMMU need to see all TLB invalidations for the memory > contexts used on the adapter. For the hash memory model, it is done by > making all TLBIs global as soon as the cxl driver is in use. For > radix, we need something simi

Re: [RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes

2017-09-07 Thread Benjamin Herrenschmidt
On Fri, 2017-09-08 at 14:44 +1000, Nicholas Piggin wrote: > On Fri, 08 Sep 2017 08:05:38 +1000 > Benjamin Herrenschmidt wrote: > > > On Fri, 2017-09-08 at 00:51 +1000, Nicholas Piggin wrote: > > > When permissiveness is relaxed, or found to have been relaxed by > > > another thread, we flush that

Re: [RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes

2017-09-07 Thread Aneesh Kumar K.V
Nicholas Piggin writes: > When permissiveness is relaxed, or found to have been relaxed by > another thread, we flush that address out of the TLB to avoid a > future fault or micro-fault due to a stale TLB entry. > > Currently for processes with TLBs on other CPUs, this flush is always > done wit

Re: [PATCH] ASoC: fsl_ssi: Override bit clock rate based on slot number

2017-09-07 Thread Nicolin Chen
On Thu, Sep 07, 2017 at 10:23:43PM -0700, Nicolin Chen wrote: > The set_sysclk() now is used to override the output bit clock rate. > But this is not a common way to implement a set_dai_sysclk(). And > this creates a problem when a general machine driver (simple-card > for example) tries to do set_

Re: [PATCH v2 1/2] powerpc/npu: Use flush_all_mm() instead of flush_tlb_mm()

2017-09-07 Thread kbuild test robot
Hi Alistair, [auto build test ERROR on powerpc/next] [also build test ERROR on next-20170907] [cannot apply to v4.13] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Alistair-Popple/powerpc-npu

[PATCH] ASoC: fsl-asoc-card: Don't error out if ENOTSUPP

2017-09-07 Thread Nicolin Chen
The snd_soc_component_set_sysclk() and snd_soc_dai_set_tdm_slot() in the soc-core.c will return -ENOTSUPP if there is no function implementation for them in the dai and component drivers. So this patch tries to ignore this errno. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl-asoc-card.c | 1

[PATCH] ASoC: fsl_ssi: Override bit clock rate based on slot number

2017-09-07 Thread Nicolin Chen
The set_sysclk() now is used to override the output bit clock rate. But this is not a common way to implement a set_dai_sysclk(). And this creates a problem when a general machine driver (simple-card for example) tries to do set_dai_sysclk() by passing an input clock rate for the baud clock instead

Re: [RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes

2017-09-07 Thread Nicholas Piggin
On Fri, 08 Sep 2017 08:05:38 +1000 Benjamin Herrenschmidt wrote: > On Fri, 2017-09-08 at 00:51 +1000, Nicholas Piggin wrote: > > When permissiveness is relaxed, or found to have been relaxed by > > another thread, we flush that address out of the TLB to avoid a > > future fault or micro-fault due

Re: [PATCH 2/2] powerpc/powernv/npu: Don't explicitly flush nmmu tlb

2017-09-07 Thread kbuild test robot
Hi Alistair, [auto build test ERROR on powerpc/next] [also build test ERROR on next-20170907] [cannot apply to v4.13] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Alistair-Popple/powerpc-npu

Re: [rfc 2/3] powerpc/mce: Extract physical_address for UE errors

2017-09-07 Thread Mahesh Jagannath Salgaonkar
On 09/05/2017 09:45 AM, Balbir Singh wrote: > Walk the page table for NIP and extract the instruction. Then > use the instruction to find the effective address via analyse_instr(). > > We might have page table walking races, but we expect them to > be rare, the physical address extraction is best

Re: Machine Check in P2010(e500v2)

2017-09-07 Thread Scott Wood
On Wed, 2017-09-06 at 10:16 +, Joakim Tjernlund wrote: > On Wed, 2017-09-06 at 10:05 +, Laurentiu Tudor wrote: > > Hi Jocke, > > > > On 09/01/2017 02:32 PM, Joakim Tjernlund wrote: > > > I am trying to debug a Machine Check for a P2010 (e500v2) CPU: > > > > > > [   28.111816] Caused by (f

Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on radix

2017-09-07 Thread Anton Blanchard
Hi Reza, > I may be misunderstanding this, but what if we did something like x86 > does? When trying to unplug a region smaller than the mapping, they > fill that part of the pagetable with 0xFD instead of freeing the > whole thing. Once the whole thing is 0xFD, free it. > > See arch/x86/mm/init

Re: [PATCH] cxl: Dump PSL_FIR1/2 registers on PSL9 error irq

2017-09-07 Thread Andrew Donnellan
LGTM Acked-by: Andrew Donnellan On 07/09/17 22:13, Vaibhav Jain wrote: For PSL9 currently we aren't dumping the PSL FIR1/2 registers when a PSL error interrupt is triggered. Contents of these registers are useful in debugging AFU issues. This patch fixes issue by updating the cxl_native_err_i

Re: [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq

2017-09-07 Thread Nicolin Chen
On Fri, Sep 08, 2017 at 01:10:12AM +0200, Łukasz Majewski wrote: > >Just add a property to this cpu node like: > > clock = <&clks IMX6QDL_CLK_SSI2>; > > This doesn't solve the issue: I have a patch locally that should be able to solve your problem. But I need to first verify on my board toni

Re: [PATCH] cxl: Dump PSL_FIR1/2 registers on PSL9 error irq

2017-09-07 Thread christophe lombard
Le 07/09/2017 à 14:13, Vaibhav Jain a écrit : For PSL9 currently we aren't dumping the PSL FIR1/2 registers when a PSL error interrupt is triggered. Contents of these registers are useful in debugging AFU issues. This patch fixes issue by updating the cxl_native_err_irq_dump_regs() to dump these

Re: [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq

2017-09-07 Thread Łukasz Majewski
Hi Nicolin, On Wed, Sep 06, 2017 at 08:35:50PM +0200, Łukasz Majewski wrote: clocks = <&clks IMX6QDL_CLK_SSI2_IPG>, <&clks IMX6QDL_CLK_SSI2>; clock-names = "ipg", "baud"; dailink_master: cpu { sound-dai =

Re: [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq

2017-09-07 Thread Nicolin Chen
On Thu, Sep 07, 2017 at 02:44:11PM +0100, Mark Brown wrote: > > On the other hand, the sys clock (baudclk in the driver) should be > > configured whenever it's related to external clock outputs. When I > > implemented this set_sysclk() for fsl_ssi.c, I used it to set this > > sys clock (baudclk)

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Benjamin Herrenschmidt
On Thu, 2017-09-07 at 10:19 +, Joakim Tjernlund wrote: > > Problem is that pci_mem_offset is gone, the closed I can find is mem_offset > > but that is an array,maybe just mem_offset[0] ? > > > > > I'm not sure exactly what's going > > > on in your case, if you have a problem can you add printk

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Benjamin Herrenschmidt
On Thu, 2017-09-07 at 08:59 +, Joakim Tjernlund wrote: > > > Hrm it's tricky, you shouldn't just turn that ifdef back on without > > also changing pci_resource_to_user(). > > There are two ifdef to change: > __pci_mmap_make_offset(): > #if 0 /* See comment in pci_resource_to_user() for why th

Re: [RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes

2017-09-07 Thread Benjamin Herrenschmidt
On Fri, 2017-09-08 at 00:51 +1000, Nicholas Piggin wrote: > When permissiveness is relaxed, or found to have been relaxed by > another thread, we flush that address out of the TLB to avoid a > future fault or micro-fault due to a stale TLB entry. > > Currently for processes with TLBs on other CPUs

Re: [PATCH] powerpc/mm: Fix missing mmap_sem release

2017-09-07 Thread Davidlohr Bueso
On Thu, 07 Sep 2017, Laurent Dufour wrote: The commit b5c8f0fd595d ("powerpc/mm: Rework mm_fault_error()") reviewed the way the error path is managed in __do_page_fault() but it was a bit too agressive when handling a case by returning without releasing the mmap_sem. By the way, replacing curre

Re: [PATCH V13 4/4] powerpc/vphn: Fix numa update end-loop bug

2017-09-07 Thread Michael Bringmann
Simplest change IMO: for_each_cpu(sibling, cpu_sibling_mask(cpu)) { ud = &updates[i++]; + ud->next = &updates[i]; ud->cpu = sibling; ud->new_nid = new_nid; ud->old_

RE: Machine Check in P2010(e500v2)

2017-09-07 Thread Leo Li
> -Original Message- > From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com] > Sent: Thursday, September 07, 2017 3:41 AM > To: linuxppc-dev@lists.ozlabs.org; Leo Li ; York Sun > > Subject: Re: Machine Check in P2010(e500v2) > > On Thu, 2017-09-07 at 00:50 +0200, Joakim Tjernlun

[PATCH] powerpc: Expose TSCR via sysfs

2017-09-07 Thread Anton Blanchard
From: Anton Blanchard The thread switch control register (TSCR) is a per core register that configures how the CPU shares resources between SMT threads. Exposing it via sysfs allows us to tune it at run time. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/sysfs.c | 8 1 file

[PATCH] powerpc/mm: Fix missing mmap_sem release

2017-09-07 Thread Laurent Dufour
The commit b5c8f0fd595d ("powerpc/mm: Rework mm_fault_error()") reviewed the way the error path is managed in __do_page_fault() but it was a bit too agressive when handling a case by returning without releasing the mmap_sem. By the way, replacing current->mm->mmap_sem by mm->mmap_sem as mm is set

Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on radix

2017-09-07 Thread Reza Arbab
On Thu, Sep 07, 2017 at 05:17:41AM +, Anton Blanchard wrote: But all of memory on PowerNV should be able to be hot unplugged, so there are two options as I see it - either increase the memory block size, or map everything with 2MB pages. I may be misunderstanding this, but what if we did so

[RFC PATCH 8/8] powerpc/64s/radix: Only flush local TLB for spurious fault flushes

2017-09-07 Thread Nicholas Piggin
When permissiveness is relaxed, or found to have been relaxed by another thread, we flush that address out of the TLB to avoid a future fault or micro-fault due to a stale TLB entry. Currently for processes with TLBs on other CPUs, this flush is always done with a global tlbie. Although that could

[RFC PATCH 7/8] powerpc/64s/radix: Improve TLB flushing for unmaps that free a page table

2017-09-07 Thread Nicholas Piggin
Unmaps that free page tables always flush the PID, which is sub optimal. Allow those to do TLB range flushes with separate PWC flush. Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/tlb-radix.c | 51 +++-- 1 file changed, 40 insertions(+), 11 deletions(

[RFC PATCH 6/8] powerpc/64s/radix: Optimize flush_tlb_range

2017-09-07 Thread Nicholas Piggin
Currently for radix, flush_tlb_range flushes the entire PID, because we don't know about THP vs regular pages. This is quite sub-optimal for small mremap/mprotect/change_protection. Instead, implement this with two range flush passes, one for each page size. If the small page range flush ended up

[RFC PATCH 5/8] powerpc/64s/radix: Introduce local single page ceiling for TLB range flush

2017-09-07 Thread Nicholas Piggin
The single page flush ceiling is the cut-off point at which we switch from invalidating individual pages, to invalidating the entire process address space in response to a range flush. Introduce a local variant of this heuristic because local and global tlbie have significantly different propertie

[RFC PATCH 4/8] powerpc/64s/radix: Implement _tlbie(l)_va_range flush functions

2017-09-07 Thread Nicholas Piggin
Move the barriers and range iteration down into the _tlbie* level, which improves readability. Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/tlb-radix.c | 70 ++--- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/arch/powerpc/mm/tlb-ra

[RFC PATCH 3/8] powerpc/64s/radix: optimize TLB range flush barriers

2017-09-07 Thread Nicholas Piggin
Short range flushes issue a sequences of tlbie(l) instructions for individual effective addresses. These do not all require individual barrier sequences, only one set around all instructions. Commit f7327e0ba3 ("powerpc/mm/radix: Remove unnecessary ptesync") made a similar optimization for tlbiel

[RFC PATCH 2/8] powerpc/64s/radix: tlbie improve preempt handling

2017-09-07 Thread Nicholas Piggin
Preempt should be consistently disabled for mm_is_thread_local tests, so bring the rest of these under preempt_disable(). Preempt does not need to be disabled for the mm->context.id tests, which allows simplification and removal of gotos. Signed-off-by: Nicholas Piggin --- arch/powerpc/mm/tlb-r

[RFC PATCH 1/8] powerpc/64s/radix: Fix theoretical process table entry cache invalidation

2017-09-07 Thread Nicholas Piggin
According to the architecture, the process table entry cache must be flushed with RIC=2 tlbies. This problem doesn't hit in existing implementations that do not cache process table entries over mtpid. The PID is only destroyed and re-used after all CPUs have switched away from the mm, guaranteeing

[RFC PATCH 0/8] Further radix TLB flush optimisations

2017-09-07 Thread Nicholas Piggin
Here is a bit more TLB flush work that mostly attempt to improve range flushes by reducing barriers, and reducing the cases we resort to flushing the entire PID. I haven't done much benchmarking to get good numbers yet for the exact heuristics settings, just interested in comments for the overall

Re: [PATCH] sound: soc: fsl: Do not set DAI sysclk when it is equal to system freq

2017-09-07 Thread Mark Brown
On Tue, Sep 05, 2017 at 10:45:29AM -0700, Nicolin Chen wrote: > The ipg clock is merely used to access registers, and has nothing > (directly) to do with external clock outputs. The driver shall not > change the ipg clock as the system ipg clock (its parent clock) > might be messed and even system

Re: [PATCH V13 4/4] powerpc/vphn: Fix numa update end-loop bug

2017-09-07 Thread Nathan Fontenot
On 09/06/2017 05:03 PM, Michael Bringmann wrote: > > > On 09/06/2017 09:45 AM, Nathan Fontenot wrote: >> On 09/01/2017 10:48 AM, Michael Bringmann wrote: >>> powerpc/vphn: On Power systems with shared configurations of CPUs >>> and memory, there are some issues with the association of additional

[PATCH] cxl: Dump PSL_FIR1/2 registers on PSL9 error irq

2017-09-07 Thread Vaibhav Jain
For PSL9 currently we aren't dumping the PSL FIR1/2 registers when a PSL error interrupt is triggered. Contents of these registers are useful in debugging AFU issues. This patch fixes issue by updating the cxl_native_err_irq_dump_regs() to dump these regs on PSL error interrupt thereby bringing th

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Joakim Tjernlund
On Thu, 2017-09-07 at 10:59 +0200, Joakim Tjernlund wrote: > On Thu, 2017-09-07 at 18:33 +1000, Benjamin Herrenschmidt wrote: > > On Thu, 2017-09-07 at 07:22 +, Joakim Tjernlund wrote: > > > On Thu, 2017-09-07 at 17:16 +1000, Benjamin Herrenschmidt wrote: > > > > On Wed, 2017-09-06 at 15:20 +00

Re: [PATCH resend] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-09-07 Thread Santosh Sivaraj
Hi all, Any comments on the below patch? Thanks, Santosh * Santosh Sivaraj wrote (on 2017-08-28 13:14:40 +0530): > Current vDSO64 implementation does not have support for coarse clocks > (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls back > to system call, increasing the re

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Joakim Tjernlund
On Thu, 2017-09-07 at 18:33 +1000, Benjamin Herrenschmidt wrote: > On Thu, 2017-09-07 at 07:22 +, Joakim Tjernlund wrote: > > On Thu, 2017-09-07 at 17:16 +1000, Benjamin Herrenschmidt wrote: > > > On Wed, 2017-09-06 at 15:20 +, Joakim Tjernlund wrote: > > > > Having problems to mmap PCI UIO

Re: Machine Check in P2010(e500v2)

2017-09-07 Thread Joakim Tjernlund
On Thu, 2017-09-07 at 00:50 +0200, Joakim Tjernlund wrote: > On Wed, 2017-09-06 at 21:13 +, Leo Li wrote: > > > -Original Message- > > > From: Joakim Tjernlund [mailto:joakim.tjernl...@infinera.com] > > > Sent: Wednesday, September 06, 2017 3:54 PM > > > To: linuxppc-dev@lists.ozlabs.or

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Benjamin Herrenschmidt
On Thu, 2017-09-07 at 07:22 +, Joakim Tjernlund wrote: > On Thu, 2017-09-07 at 17:16 +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2017-09-06 at 15:20 +, Joakim Tjernlund wrote: > > > Having problems to mmap PCI UIO devices and stumbeled over this page: > > > http://billfarrow.blogspot.

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Joakim Tjernlund
On Thu, 2017-09-07 at 17:16 +1000, Benjamin Herrenschmidt wrote: > On Wed, 2017-09-06 at 15:20 +, Joakim Tjernlund wrote: > > Having problems to mmap PCI UIO devices and stumbeled over this page: > > http://billfarrow.blogspot.se/2010/09/userspace-access-to-pci-memory.html > > it claims some a

Re: [PATCH] powerpc/powernv: Increase memory block size to 1GB on radix

2017-09-07 Thread Benjamin Herrenschmidt
On Thu, 2017-09-07 at 15:17 +1000, Anton Blanchard wrote: > Hi, > > > There is a similar issue being worked on w.r.t pseries. > > > > https://lkml.kernel.org/r/1502357028-27465-1-git-send-email-bhar...@linux.vnet.ibm.com > > > > The question is should we map these regions ? ie, we need to tell t

Re: UIO memmap of PCi devices not working?

2017-09-07 Thread Benjamin Herrenschmidt
On Wed, 2017-09-06 at 15:20 +, Joakim Tjernlund wrote: > Having problems to mmap PCI UIO devices and stumbeled over this page: > http://billfarrow.blogspot.se/2010/09/userspace-access-to-pci-memory.html > it claims some adjustments are needed for UIO mmap over PCI to work. > These are #if 0 AT

Re: [PATCH v8 00/10] Enable VAS

2017-09-07 Thread Michael Neuling
So this is upstream now but it will cause a crash on boot with older skiboots with: powernv-cpufreq: cpufreq pstate min 101 nominal 50 max 0 powernv-cpufreq: Workload Optimized Frequency is enabled in the platform Disabling lock debugging due to kernel taint Severe Machine check interrupt [Not re