[tip: timers/core] clocksource: mips-gic-timer: Register as sched_clock

2020-06-01 Thread tip-bot2 for Paul Burton
The following commit has been merged into the timers/core branch of tip: Commit-ID: 48016e78d328998b1f00bcfb639adeabca51abe5 Gitweb: https://git.kernel.org/tip/48016e78d328998b1f00bcfb639adeabca51abe5 Author:Paul Burton AuthorDate:Thu, 21 May 2020 23:48:16 +03:00

Re: piix4-poweroff.c I/O BAR usage

2020-05-21 Thread Paul Burton
Hello, On Thu, May 21, 2020 at 6:04 PM Maciej W. Rozycki wrote: > Paul may or may not be reachable anymore, so I'll step in. I'm reachable but lacking free time & with no access to Malta hardware I can't claim to be too useful here, so thanks for responding :) Before being moved to a driver

[PATCH] MIPS: tlbex: Fix build_restore_pagemask KScratch restore

2019-10-18 Thread Paul Burton
precede the MFC0 - it simply needs to be between the MTC0 & MFC0. This bug only affects Cavium Octeon systems which use build_fast_tlb_refill_handler(). Signed-off-by: Paul Burton Fixes: 0b24cae4d535 ("MIPS: Add missing EHB in mtc0 -> mfc0 sequence.") Cc: Dmitry Korotin

Re: [PATCH] MAINTAINERS: Use @kernel.org address for Paul Burton

2019-10-18 Thread Paul Burton
Hello, Paul Burton wrote: > From: Paul Burton > > Switch to using my paulbur...@kernel.org email address in order to avoid > subject mangling that's being imposed on my previous address. Applied to mips-fixes. > commit 0ad8f7aa9f7e > https://git.kernel.org/mips/c/0ad8f7aa9f

[PATCH] MAINTAINERS: Use @kernel.org address for Paul Burton

2019-10-16 Thread Paul Burton
From: Paul Burton Switch to using my paulbur...@kernel.org email address in order to avoid subject mangling that's being imposed on my previous address. Signed-off-by: Paul Burton Signed-off-by: Paul Burton --- .mailmap| 3 ++- MAINTAINERS | 10 +- 2 files changed, 7 insertions

Re: [PATCH] MIPS: Loongson: Make default kernel log buffer size as 128KB for Loongson3

2019-10-15 Thread Paul Burton
Hi Tiezhu & Huacai, On Tue, Oct 15, 2019 at 12:00:25PM +0800, Tiezhu Yang wrote: > On 10/15/2019 11:36 AM, Huacai Chen wrote: > > On Tue, Oct 15, 2019 at 10:12 AM Tiezhu Yang wrote: > > > When I update kernel with loongson3_defconfig based on the Loongson 3A3000 > > > platform, then using dmesg

Re: [EXTERNAL]Re: Build regressions/improvements in v5.4-rc3

2019-10-14 Thread Paul Burton
Hi Geert, Greg, On Mon, Oct 14, 2019 at 09:04:21AM +0200, Geert Uytterhoeven wrote: > On Mon, Oct 14, 2019 at 8:53 AM Geert Uytterhoeven > wrote: > > JFYI, when comparing v5.4-rc3[1] to v5.4-rc2[3], the summaries are: > > - build errors: +1/-0 > > +

[GIT PULL] MIPS fixes

2019-10-12 Thread Paul Burton
cess in firmware handling code for old SNI RM200/300/400 machines. Jiaxun Yang (1): MIPS: elf_hwcap: Export userspace ASEs Paul Burton (1): MIPS: Disable Loongson MMI instructions for kernel build Thomas Bogendoerfe

Re: [PATCH] mips: Fix unroll macro when building with Clang

2019-10-10 Thread Paul Burton
d to mips-next. > commit df3da04880b4 > https://git.kernel.org/mips/c/df3da04880b4 > > Fixes: 6baaeadae911 ("MIPS: Provide unroll() macro, use it for cache ops") > Link: https://github.com/ClangBuiltLinux/linux/issues/736 > Signed-off-by: Nathan Chancellor > Signed-o

Re: [PATCH 0/6] Clean up ARC code and fix IP22/28 early printk

2019-10-09 Thread Paul Burton
gt; https://git.kernel.org/mips/c/d11646b5ce93 > > Signed-off-by: Thomas Bogendoerfer > Signed-off-by: Paul Burton > > MIPS: fw: arc: use call_o32 to call ARC prom from 64bit kernel > commit ce6c0a593b3c > https://git.kernel.org/mips/c/ce6c0a593b3c > > Si

Re: [PATCH] MIPS: fw: sni: Fix out of bounds init of o32 stack

2019-10-09 Thread Paul Burton
Hello, Thomas Bogendoerfer wrote: > Use ARRAY_SIZE to caluculate the top of the o32 stack. Applied to mips-fixes. > commit efcb529694c3 > https://git.kernel.org/mips/c/efcb529694c3 > > Signed-off-by: Thomas Bogendoerfer > Signed-off-by: Paul Burton Thanks, Paul [ Thi

Re: [PATCH] MIPS: include: Mark __xchg as __always_inline

2019-10-09 Thread Paul Burton
which is an error case > for catching bugs and will not happen for correct code, if > __xchg is inlined. Applied to mips-fixes. > commit 46f1619500d0 > https://git.kernel.org/mips/c/46f1619500d0 > > Signed-off-by: Thomas Bogendoerfer > Reviewed-by: Philippe Mathieu-Daudé >

Re: [PATCH v2] MIPS: generic: Use __initconst for const init data

2019-10-08 Thread Paul Burton
data const void *mach_match_data; Applied to mips-next. > commit a14bf1dc494a > https://git.kernel.org/mips/c/a14bf1dc494a > > Fixes: eed0eabd12ef ("MIPS: generic: Introduce generic DT-based board > support") > Signed-off-by: Tiezhu Yang > Signed-off-by: Paul Bur

[PATCH] staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC

2019-10-07 Thread Paul Burton
. Signed-off-by: Paul Burton Reported-by: Geert Uytterhoeven URL: https://lore.kernel.org/linux-mips/CAMuHMdXvu+BppwzsU9imNWVKea_hoLcRt9N+a29Q-QsjW=i...@mail.gmail.com/ Fixes: 171a9bae68c7 ("staging/octeon: Allow test build on !MIPS") Cc: Matthew Wilcox (Oracle) Cc: Greg Kroah-Hartman

Re: [PATCH] mips: check for dsp presence only once before save/restore

2019-10-07 Thread Paul Burton
/c/9662dd752c14 > > Signed-off-by: Aurabindo Jayamohanan > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto-generated; if you believe anything is incorrect then please email paul.bur...@mips.com to report it. ]

Re: [PATCH v2 4/5] MIPS: CI20: DTS: Add Leds

2019-10-07 Thread Paul Burton
Hello, Alexandre GRIVEAUX wrote: > Adding leds and related triggers. Applied to mips-next. > commit 24b0cb4f883a > https://git.kernel.org/mips/c/24b0cb4f883a > > Signed-off-by: Alexandre GRIVEAUX > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto

Re: [PATCH v2 3/5] MIPS: CI20: DTS: Add IW8103 Wifi + bluetooth

2019-10-07 Thread Paul Burton
Hello, Alexandre GRIVEAUX wrote: > Add IW8103 Wifi + bluetooth module to device tree and related power domain. Applied to mips-next. > commit 948f2708f945 > https://git.kernel.org/mips/c/948f2708f945 > > Signed-off-by: Alexandre GRIVEAUX > Signed-off-by: Paul Burton

Re: [PATCH v2 2/5] MIPS: CI20: DTS: Add I2C nodes

2019-10-07 Thread Paul Burton
Hello, Alexandre GRIVEAUX wrote: > Adding missing I2C nodes and some peripheral: > - PMU > - RTC Applied to mips-next. > commit 73f2b940474d > https://git.kernel.org/mips/c/73f2b940474d > > Signed-off-by: Alexandre GRIVEAUX > Signed-off-by: Paul Burton Thanks,

Re: [PATCH 1/2] MIPS: SGI-IP27: remove not used stuff inherited from IRIX

2019-10-07 Thread Paul Burton
46a73e9e6ccc > https://git.kernel.org/mips/c/46a73e9e6ccc > > Signed-off-by: Thomas Bogendoerfer > Signed-off-by: Paul Burton > > MIPS: SGI-IP27: get rid of compact node ids > commit 4bf841ebf17a > https://git.kernel.org/mips/c/4bf841ebf17a > > Signed-o

Re: [PATCH v2 1/5] MIPS: JZ4780: DTS: Add I2C nodes

2019-10-07 Thread Paul Burton
Hello, Alexandre GRIVEAUX wrote: > Add the devicetree nodes for the I2C core of the JZ4780 SoC, disabled > by default. Applied to mips-next. > commit f56a040c9faf > https://git.kernel.org/mips/c/f56a040c9faf > > Signed-off-by: Alexandre GRIVEAUX > Signed-off-by: Paul Burt

Re: [PATCH v2] mips: sgi-ip27: switch from DISCONTIGMEM to SPARSEMEM

2019-10-07 Thread Paul Burton
s Bogendoerfer > Signed-off-by: Thomas Bogendoerfer > Signed-off-by: Mike Rapoport > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto-generated; if you believe anything is incorrect then please email paul.bur...@mips.com to report it. ]

Re: [PATCH v2 00/36] MIPS: barriers & atomics cleanups

2019-10-07 Thread Paul Burton
Hello, Paul Burton wrote: > This series consists of a bunch of cleanups to the way we handle memory > barriers (though no changes to the sync instructions we use to implement > them) & atomic memory accesses. One major goal was to ensure the > Loongson3 LL/SC errata workaro

Re: [PATCH] MIPS: include: Mark __cmpxchd as __always_inline

2019-10-07 Thread Paul Burton
which is a error case > for catching bugs and will not happen for correct code, if > __cmpxchg is inlined. Applied to mips-fixes. > commit 88356d09904b > https://git.kernel.org/mips/c/88356d09904b > > Signed-off-by: Thomas Bogendoerfer > [paul.bur...@mips.com: s/__cmpxchd/__cmpxc

[GIT PULL] MIPS fixes

2019-10-04 Thread Paul Burton
xun Yang (1): MIPS: cpu-bugs64: Mark inline functions as __always_inline Oleksij Rempel (1): MIPS: dts: ar9331: fix interrupt-controller size Paul Burton (7): MIPS: octeon: Include required header; fix octeon ethernet build MIPS: Wire up clone3 syscall MIPS: VDSO: Re

[PATCH v2] mtd: rawnand: au1550nd: Fix au_read_buf16() prototype

2019-10-04 Thread Paul Burton
ruct nand_chip is 0 making mtd_to_nand() effectively a type-cast. Signed-off-by: Paul Burton Fixes: 7e534323c416 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") Cc: Boris Brezillon Cc: Miquel Raynal Cc: David Woodhouse Cc: Brian Norris Cc: Marek Va

[PATCH] mtd: rawnand: au1550nd: Fix au_read_buf16() prototype

2019-10-04 Thread Paul Burton
ruct nand_chip is 0 making mtd_to_nand() effectively a type-cast. Signed-off-by: Paul Burton Fixes: 7e534323c416 ("mtd: rawnand: Pass a nand_chip object to chip->read_xxx() hooks") Cc: Boris Brezillon Cc: Miquel Raynal Cc: David Woodhouse Cc: Brian Norris Cc: Marek Va

Re: [PATCH] MIPS: init: Prevent adding memory before PHYS_OFFSET

2019-10-02 Thread Paul Burton
fixes. > commit bd848d1b9235 > https://git.kernel.org/mips/c/bd848d1b9235 > > Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") > Signed-off-by: Thomas Bogendoerfer > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto-generated; if you believe anything is incorrect then please email paul.bur...@mips.com to report it. ]

Re: [PATCH] MIPS: init: Fix reservation of memory between PHYS_OFFSET and mem start

2019-10-02 Thread Paul Burton
_mem_map") > Signed-off-by: Thomas Bogendoerfer > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto-generated; if you believe anything is incorrect then please email paul.bur...@mips.com to report it. ]

Re: [PATCH] mips: Loongson: Fix the link time qualifier of 'serial_exit()'

2019-10-02 Thread Paul Burton
t; Signed-off-by: Christophe JAILLET > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto-generated; if you believe anything is incorrect then please email paul.bur...@mips.com to report it. ]

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

2019-10-02 Thread Paul Burton
Hi Geert, On Wed, Oct 02, 2019 at 11:17:26AM +0200, Geert Uytterhoeven wrote: > > 15 error regressions: > > + /kisskb/build/tmp/cc1Or5dj.s: Error: can't resolve `_start' {*UND* > > section} - `L0 ' {.text section}: => 663, 1200, 222, 873, 1420 > > + /kisskb/build/tmp/cc2uWmof.s: Error:

Re: [PATCH v2 5/5] MIPS: JZ4780: DTS: Add CPU nodes

2019-10-01 Thread Paul Burton
Hi Alexandre, On Tue, Oct 01, 2019 at 09:09:48PM +0200, Alexandre GRIVEAUX wrote: > The JZ4780 have 2 core, adding to DT. > > Signed-off-by: Alexandre GRIVEAUX > --- > arch/mips/boot/dts/ingenic/jz4780.dtsi | 17 + > 1 file changed, 17 insertions(+) > > diff --git

[PATCH v2 03/36] MIPS: barrier: Add __SYNC() infrastructure

2019-10-01 Thread Paul Burton
rimitives."). Using __SYNC() with the wmb or rmb types will abstract away the Octeon specific behavior and allow us to later clean up asm/barrier.h code that currently includes a plethora of #ifdef's. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/b

[PATCH v2 18/36] MIPS: bitops: Use MIPS_ISA_REV, not #ifdefs

2019-10-01 Thread Paul Burton
Rather than #ifdef on CONFIG_CPU_* to determine whether the ins instruction is supported we can simply check MIPS_ISA_REV to discover whether we're targeting MIPSr2 or higher. Do so in order to clean up the code. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm

[PATCH v2 07/36] MIPS: barrier: Clean up __sync() definition

2019-10-01 Thread Paul Burton
anyway. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/barrier.h | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h index 657ec01120a4..a117c6d95038 100644 --- a/arch/mips

[PATCH v2 09/36] MIPS: atomic: Fix whitespace in ATOMIC_OP macros

2019-10-01 Thread Paul Burton
We define macros in asm/atomic.h which end each line with space characters before a backslash to continue on the next line. Remove the space characters leaving tabs as the whitespace used for conformity with coding convention. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips

[PATCH v2 05/36] MIPS: barrier: Clean up __smp_mb() definition

2019-10-01 Thread Paul Burton
We #ifdef on Cavium Octeon CPUs, but emit the same sync instruction in both cases. Remove the #ifdef & simply expand to the __sync() macro. Whilst here indent the strong ordering case definitions to match the indentation of the weak ordering ones, helping readability. Signed-off-by: Paul Bu

[PATCH v2 02/36] MIPS: Use compact branch for LL/SC loops on MIPSr6+

2019-10-01 Thread Paul Burton
When targeting MIPSr6 or higher make use of a compact branch in LL/SC loops, preventing the insertion of a delay slot nop that only serves to waste space. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/llsc.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v2 15/36] MIPS: atomic: Deduplicate 32b & 64b read, set, xchg, cmpxchg

2019-10-01 Thread Paul Burton
all other functions in asm/atomic.h are generated, and ensures consistency between the 32b & 64b functions. Of note is that this results in the above now being static inline functions rather than macros. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/atomi

[PATCH v2 10/36] MIPS: atomic: Handle !kernel_uses_llsc first

2019-10-01 Thread Paul Burton
Handle the !kernel_uses_llsc path first in our ATOMIC_OP(), ATOMIC_OP_RETURN() & ATOMIC_FETCH_OP() macros & return from within the block. This allows us to de-indent the kernel_uses_llsc path by one level which will be useful when making further changes. Signed-off-by: Paul Burton ---

[PATCH v2 23/36] MIPS: bitops: Avoid redundant zero-comparison for non-LLSC

2019-10-01 Thread Paul Burton
The IRQ-disabling non-LLSC fallbacks for bitops on UP systems already return a zero or one, so there's no need to perform another comparison against zero. Move these comparisons into the LLSC paths to avoid the redundant work. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips

[PATCH v2 32/36] MIPS: barrier: Remove loongson_llsc_mb()

2019-10-01 Thread Paul Burton
The loongson_llsc_mb() macro is no longer used - instead barriers are emitted as part of inline asm using the __SYNC() macro. Remove the now-defunct loongson_llsc_mb() macro. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/barrier.h | 40

[PATCH v2 30/36] MIPS: futex: Emit Loongson3 sync workarounds within asm

2019-10-01 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- Changes in v2: - De-string __WEAK_LLSC_MB to allow its use with __SYNC_ELSE(). arch/mips/include/asm/barrier.h | 13 +++-- arch/mips/include/asm/futex.h | 15 +++ 2 files changed

[PATCH v2 36/36] MIPS: Check Loongson3 LL/SC errata workaround correctness

2019-10-01 Thread Paul Burton
code paths that miss the required workarounds. Signed-off-by: Paul Burton --- Changes in v2: - Only try to build loongson3-llsc-check from arch/mips/Makefile when CONFIG_CPU_LOONGSON3_WORKAROUNDS is enabled. arch/mips/Makefile | 3 + arch/mips/Makefile.post

[PATCH v2 21/36] MIPS: bitops: Allow immediates in test_and_{set,clear,change}_bit

2019-10-01 Thread Paul Burton
The logical operations or & xor used in the test_and_set_bit_lock(), test_and_clear_bit() & test_and_change_bit() functions currently force the value 1< --- Changes in v2: None arch/mips/include/asm/bitops.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v2 31/36] MIPS: syscall: Emit Loongson3 sync workarounds within asm

2019-10-01 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/kernel/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index b0e25e913bdb..3ea288ca35f1 10

[PATCH v2 16/36] MIPS: bitops: Handle !kernel_uses_llsc first

2019-10-01 Thread Paul Burton
implementations, we switch to returning from within each if block making each case easier to read in isolation. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 213 - 1 file changed, 105 insertions(+), 108 deletions(-) diff

[PATCH v2 27/36] MIPS: bitops: Use smp_mb__before_atomic in test_* ops

2019-10-01 Thread Paul Burton
rier within __test_bit_op(). Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index c08b6d225f10..a74769940fbd 100644 --- a/

[PATCH v2 33/36] MIPS: barrier: Make __smp_mb__before_atomic() a no-op for Loongson3

2019-10-01 Thread Paul Burton
Loongson3 systems with CONFIG_CPU_LOONGSON3_WORKAROUNDS enabled already emit a full completion barrier as part of the inline assembly containing LL/SC loops for atomic operations. As such the barrier emitted by __smp_mb__before_atomic() is redundant, and we can remove it. Signed-off-by: Paul

[PATCH v2 26/36] MIPS: bitops: Emit Loongson3 sync workarounds within asm

2019-10-01 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index d39fca2d

[PATCH v2 17/36] MIPS: bitops: Only use ins for bit 16 or higher

2019-10-01 Thread Paul Burton
t1, t1, 0x10 sc t1, 0(t2) The or path already allows immediates to be used, so simply restricting the ins path to bits that don't fit in immediates is sufficient to take advantage of this. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 2 +- 1 file cha

[PATCH v2 25/36] MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG

2019-10-01 Thread Paul Burton
raw_local_irq_{save,restore}(). Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 24 arch/mips/include/asm/llsc.h | 4 arch/mips/lib/bitops.c | 31 +-- 3 files changed, 25 insertions(+), 34 dele

[PATCH v2 34/36] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler

2019-10-01 Thread Paul Burton
In ejtag_debug_handler we use LL & SC instructions to acquire & release an open-coded spinlock. For Loongson3 systems affected by LL/SC errata this requires that we insert a sync instruction prior to the LL in order to ensure correct behavior of the LL/SC loop. Signed-off-by: Pau

[PATCH v2 22/36] MIPS: bitops: Use the BIT() macro

2019-10-01 Thread Paul Burton
Use the BIT() macro in asm/bitops.h rather than open-coding its equivalent. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b

[PATCH v2 24/36] MIPS: bitops: Abstract LL/SC loops

2019-10-01 Thread Paul Burton
Introduce __bit_op() & __test_bit_op() macros which abstract away the implementation of LL/SC loops. This cuts down on a lot of duplicate boilerplate code, and also allows R1_LLSC_WAR to be handled outside of the individual bitop functions. Signed-off-by: Paul Burton --- Changes in v2:

[PATCH v2 29/36] MIPS: cmpxchg: Omit redundant barriers for Loongson3

2019-10-01 Thread Paul Burton
Add compile-time constant checks causing us to omit the redundant memory barriers. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/cmpxchg.h | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/cmpxchg.h b/

[PATCH v2 28/36] MIPS: cmpxchg: Emit Loongson3 sync workarounds within asm

2019-10-01 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/cmpxchg.h | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h i

[PATCH v2 20/36] MIPS: bitops: Implement test_and_set_bit() in terms of _lock variant

2019-10-01 Thread Paul Burton
tion of the extra memory barrier. Do this in order to avoid duplicating logic. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 66 +++--- arch/mips/lib/bitops.c | 26 -- 2 files changed, 13 insertions(+)

[PATCH v2 35/36] MIPS: genex: Don't reload address unnecessarily

2019-10-01 Thread Paul Burton
mory accesses & therefore isn't affected by Loongson3 LL/SC errata. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/kernel/genex.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index ac4f2b835165..60ed

[PATCH v2 12/36] MIPS: atomic: Emit Loongson3 sync workarounds within asm

2019-10-01 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/atomic.h | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h i

[PATCH v2 13/36] MIPS: atomic: Use _atomic barriers in atomic_sub_if_positive()

2019-10-01 Thread Paul Burton
Use smp_mb__before_atomic() & smp_mb__after_atomic() in atomic_sub_if_positive() rather than the equivalent smp_mb__before_llsc() & smp_llsc_mb(). The former are more standard & this preps us for avoiding redundant duplicate barriers on Loongson3 in a later patch. Signed-off-by:

[PATCH v2 19/36] MIPS: bitops: ins start position is always an immediate

2019-10-01 Thread Paul Burton
for sanity. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/bitops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 0f5329e32e87..03532ae9f528 100644 --- a/arch/mips/include/as

[PATCH v2 08/36] MIPS: barrier: Clean up sync_ginv()

2019-10-01 Thread Paul Burton
Use the new __SYNC() infrastructure to implement sync_ginv(), for consistency with much of the rest of the asm/barrier.h. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/barrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include

[PATCH v2 14/36] MIPS: atomic: Unify 32b & 64b sub_if_positive

2019-10-01 Thread Paul Burton
iers in the atomic64_sub_if_positive() case which were previously missing. The code is rearranged a little to handle the !kernel_uses_llsc case first in order to de-indent the LL/SC case & allow us not to go over 80 characters per line. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/

[PATCH v2 04/36] MIPS: barrier: Clean up rmb() & wmb() definitions

2019-10-01 Thread Paul Burton
y is removed, since the "syncw" instruction previously used is merely an alias for "sync 4" which __SYNC() will emit for the wmb sync type when the kernel is configured for an Octeon CPU. Similarly __SYNC() will emit nothing for the rmb sync type in Octeon configurati

[PATCH v2 11/36] MIPS: atomic: Use one macro to generate 32b & 64b functions

2019-10-01 Thread Paul Burton
Cut down on duplication by generalizing the ATOMIC_OP(), ATOMIC_OP_RETURN() & ATOMIC_FETCH_OP() macros to work for both 32b & 64b atomics, and removing the ATOMIC64_ variants. This ensures consistency between our atomic_* & atomic64_* functions. Signed-off-by: Paul Burton --- C

[PATCH v2 01/36] MIPS: Unify sc beqz definition

2019-10-01 Thread Paul Burton
include whitespace of their own after the instruction mnemonic. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/atomic.h | 28 +--- arch/mips/include/asm/cmpxchg.h | 20 arch/mips/include/asm/llsc.h| 11 +++

[PATCH v2 00/36] MIPS: barriers & atomics cleanups

2019-10-01 Thread Paul Burton
ed to go implement those then using the generic fls/ffs doesn't seem like such a win. - De-string __WEAK_LLSC_MB to allow use with __SYNC_ELSE(). - Only try to build the loongson3-llsc-check tool from arch/mips/Makefile when CONFIG_CPU_LOONGSON3_WORKAROUNDS is enabled. Paul Burton (36): MIPS: Unify

[PATCH v2 06/36] MIPS: barrier: Remove fast_mb() Octeon #ifdef'ery

2019-10-01 Thread Paul Burton
The definition of fast_mb() is the same in both the Octeon & non-Octeon cases, so remove the duplication & define it only once. Signed-off-by: Paul Burton --- Changes in v2: None arch/mips/include/asm/barrier.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/a

[PATCH 02/37] MIPS: Use compact branch for LL/SC loops on MIPSr6+

2019-09-30 Thread Paul Burton
When targeting MIPSr6 or higher make use of a compact branch in LL/SC loops, preventing the insertion of a delay slot nop that only serves to waste space. Signed-off-by: Paul Burton --- arch/mips/include/asm/llsc.h | 4 1 file changed, 4 insertions(+) diff --git a/arch/mips/include/asm

[PATCH 03/37] MIPS: barrier: Add __SYNC() infrastructure

2019-09-30 Thread Paul Burton
rimitives."). Using __SYNC() with the wmb or rmb types will abstract away the Octeon specific behavior and allow us to later clean up asm/barrier.h code that currently includes a plethora of #ifdef's. Signed-off-by: Paul Burton --- arch/mips/include/asm/barrier.h | 113 + arch/mi

[PATCH 18/37] MIPS: bitops: Only use ins for bit 16 or higher

2019-09-30 Thread Paul Burton
t1, t1, 0x10 sc t1, 0(t2) The or path already allows immediates to be used, so simply restricting the ins path to bits that don't fit in immediates is sufficient to take advantage of this. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 2 +- 1 file changed, 1 insertion(+

[PATCH 22/37] MIPS: bitops: Allow immediates in test_and_{set,clear,change}_bit

2019-09-30 Thread Paul Burton
The logical operations or & xor used in the test_and_set_bit_lock(), test_and_clear_bit() & test_and_change_bit() functions currently force the value 1< --- arch/mips/include/asm/bitops.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 07/37] MIPS: barrier: Clean up __sync() definition

2019-09-30 Thread Paul Burton
anyway. Signed-off-by: Paul Burton --- arch/mips/include/asm/barrier.h | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/mips/include/asm/barrier.h b/arch/mips/include/asm/barrier.h index 657ec01120a4..a117c6d95038 100644 --- a/arch/mips/include/asm

[PATCH 05/37] MIPS: barrier: Clean up __smp_mb() definition

2019-09-30 Thread Paul Burton
We #ifdef on Cavium Octeon CPUs, but emit the same sync instruction in both cases. Remove the #ifdef & simply expand to the __sync() macro. Whilst here indent the strong ordering case definitions to match the indentation of the weak ordering ones, helping readability. Signed-off-by: Paul Bu

[PATCH 13/37] MIPS: atomic: Use _atomic barriers in atomic_sub_if_positive()

2019-09-30 Thread Paul Burton
Use smp_mb__before_atomic() & smp_mb__after_atomic() in atomic_sub_if_positive() rather than the equivalent smp_mb__before_llsc() & smp_llsc_mb(). The former are more standard & this preps us for avoiding redundant duplicate barriers on Loongson3 in a later patch. Signed-off-by:

[PATCH 12/37] MIPS: atomic: Emit Loongson3 sync workarounds within asm

2019-09-30 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- arch/mips/include/asm/atomic.h | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index b834af5a

[PATCH 33/37] MIPS: barrier: Remove loongson_llsc_mb()

2019-09-30 Thread Paul Burton
The loongson_llsc_mb() macro is no longer used - instead barriers are emitted as part of inline asm using the __SYNC() macro. Remove the now-defunct loongson_llsc_mb() macro. Signed-off-by: Paul Burton --- arch/mips/include/asm/barrier.h | 40 - arch/mips

[PATCH 20/37] MIPS: bitops: ins start position is always an immediate

2019-09-30 Thread Paul Burton
for sanity. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index b8785bdf3507..83fd1f1c3ab4 100644 --- a/arch/mips/include/asm/bitops.h +++ b

[PATCH 36/37] MIPS: genex: Don't reload address unnecessarily

2019-09-30 Thread Paul Burton
mory accesses & therefore isn't affected by Loongson3 LL/SC errata. Signed-off-by: Paul Burton --- arch/mips/kernel/genex.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index ac4f2b835165..60ede6b75a3b 100644 --- a/a

[PATCH 35/37] MIPS: genex: Add Loongson3 LL/SC workaround to ejtag_debug_handler

2019-09-30 Thread Paul Burton
In ejtag_debug_handler we use LL & SC instructions to acquire & release an open-coded spinlock. For Loongson3 systems affected by LL/SC errata this requires that we insert a sync instruction prior to the LL in order to ensure correct behavior of the LL/SC loop. Signed-off-by: Pau

[PATCH 30/37] MIPS: cmpxchg: Omit redundant barriers for Loongson3

2019-09-30 Thread Paul Burton
Add compile-time constant checks causing us to omit the redundant memory barriers. Signed-off-by: Paul Burton --- arch/mips/include/asm/cmpxchg.h | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include

[PATCH 37/37] MIPS: Check Loongson3 LL/SC errata workaround correctness

2019-09-30 Thread Paul Burton
code paths that miss the required workarounds. Signed-off-by: Paul Burton --- arch/mips/Makefile | 2 +- arch/mips/Makefile.postlink| 10 +- arch/mips/tools/.gitignore | 1 + arch/mips/tools/Makefile | 5 + arch/mips/tools/loong

[PATCH 23/37] MIPS: bitops: Use the BIT() macro

2019-09-30 Thread Paul Burton
Use the BIT() macro in asm/bitops.h rather than open-coding its equivalent. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 31 --- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm

[PATCH 28/37] MIPS: bitops: Use smp_mb__before_atomic in test_* ops

2019-09-30 Thread Paul Burton
rier within __test_bit_op(). Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 9e967d6622c8..e6d97238a321 100644 --- a/arch/mips/include

[PATCH 16/37] MIPS: bitops: Use generic builtin ffs/fls; drop cpu_has_clo_clz

2019-09-30 Thread Paul Burton
e is the ability for kernels built to target a pre-r1 ISA to opportunistically make use of clz when running on a CPU that implements it. This seems like a small cost, and well worth paying to simplify the code. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h

[PATCH 27/37] MIPS: bitops: Emit Loongson3 sync workarounds within asm

2019-09-30 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 59fe1d5d4fc9..9e967d6622c8 10

[PATCH 32/37] MIPS: syscall: Emit Loongson3 sync workarounds within asm

2019-09-30 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- arch/mips/kernel/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index b0e25e913bdb..3ea288ca35f1 100644 --- a/arch/

[PATCH 17/37] MIPS: bitops: Handle !kernel_uses_llsc first

2019-09-30 Thread Paul Burton
implementations, we switch to returning from within each if block making each case easier to read in isolation. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 213 - 1 file changed, 105 insertions(+), 108 deletions(-) diff --git a/arch/mips/include

[PATCH 26/37] MIPS: bitops: Use BIT_WORD() & BITS_PER_LONG

2019-09-30 Thread Paul Burton
raw_local_irq_{save,restore}(). Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 24 arch/mips/include/asm/llsc.h | 4 arch/mips/lib/bitops.c | 31 +-- 3 files changed, 25 insertions(+), 34 deletions(-) diff --git

[PATCH 31/37] MIPS: futex: Emit Loongson3 sync workarounds within asm

2019-09-30 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- arch/mips/include/asm/futex.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/mips/include/asm/futex.h b/arch/mips/include/asm/futex.h index b83b0397462d..45c3e3652f48 10

[PATCH 29/37] MIPS: cmpxchg: Emit Loongson3 sync workarounds within asm

2019-09-30 Thread Paul Burton
had, containing sync & ll instructions respectively. Signed-off-by: Paul Burton --- arch/mips/include/asm/cmpxchg.h | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h index 5d3f0e3513b4..fc121d20

[PATCH 34/37] MIPS: barrier: Make __smp_mb__before_atomic() a no-op for Loongson3

2019-09-30 Thread Paul Burton
Loongson3 systems with CONFIG_CPU_LOONGSON3_WORKAROUNDS enabled already emit a full completion barrier as part of the inline assembly containing LL/SC loops for atomic operations. As such the barrier emitted by __smp_mb__before_atomic() is redundant, and we can remove it. Signed-off-by: Paul

[PATCH 08/37] MIPS: barrier: Clean up sync_ginv()

2019-09-30 Thread Paul Burton
Use the new __SYNC() infrastructure to implement sync_ginv(), for consistency with much of the rest of the asm/barrier.h. Signed-off-by: Paul Burton --- arch/mips/include/asm/barrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/barrier.h b/arch

[PATCH 10/37] MIPS: atomic: Handle !kernel_uses_llsc first

2019-09-30 Thread Paul Burton
Handle the !kernel_uses_llsc path first in our ATOMIC_OP(), ATOMIC_OP_RETURN() & ATOMIC_FETCH_OP() macros & return from within the block. This allows us to de-indent the kernel_uses_llsc path by one level which will be useful when making further changes. Signed-off-by: Paul Burton --

[PATCH 24/37] MIPS: bitops: Avoid redundant zero-comparison for non-LLSC

2019-09-30 Thread Paul Burton
The IRQ-disabling non-LLSC fallbacks for bitops on UP systems already return a zero or one, so there's no need to perform another comparison against zero. Move these comparisons into the LLSC paths to avoid the redundant work. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 18

[PATCH 21/37] MIPS: bitops: Implement test_and_set_bit() in terms of _lock variant

2019-09-30 Thread Paul Burton
tion of the extra memory barrier. Do this in order to avoid duplicating logic. Signed-off-by: Paul Burton --- arch/mips/include/asm/bitops.h | 66 +++--- arch/mips/lib/bitops.c | 26 -- 2 files changed, 13 insertions(+), 79 deletions(-) diff -

[PATCH 15/37] MIPS: atomic: Deduplicate 32b & 64b read, set, xchg, cmpxchg

2019-09-30 Thread Paul Burton
all other functions in asm/atomic.h are generated, and ensures consistency between the 32b & 64b functions. Of note is that this results in the above now being static inline functions rather than macros. Signed-off-by: Paul Burton --- arch/mips/include/asm/atomi

[PATCH 00/37] MIPS: barriers & atomics cleanups

2019-09-30 Thread Paul Burton
-asm & that we can automatically verify the resulting kernel binary looks reasonable. Many patches are cleanups found along the way. Applies atop v5.4-rc1. Paul Burton (37): MIPS: Unify sc beqz definition MIPS: Use compact branch for LL/SC loops on MIPSr6+ MIPS: barrier: Ad

[PATCH 25/37] MIPS: bitops: Abstract LL/SC loops

2019-09-30 Thread Paul Burton
Introduce __bit_op() & __test_bit_op() macros which abstract away the implementation of LL/SC loops. This cuts down on a lot of duplicate boilerplate code, and also allows R1_LLSC_WAR to be handled outside of the individual bitop functions. Signed-off-by: Paul Burton --- arch/mips/inc

[PATCH 09/37] MIPS: atomic: Fix whitespace in ATOMIC_OP macros

2019-09-30 Thread Paul Burton
We define macros in asm/atomic.h which end each line with space characters before a backslash to continue on the next line. Remove the space characters leaving tabs as the whitespace used for conformity with coding convention. Signed-off-by: Paul Burton --- arch/mips/include/asm/atomic.h | 184

  1   2   3   4   5   6   7   8   9   10   >