aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-29 21:41:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-29 21:41:48 -0400
commit58c3f14f86c98e4030b03e6ab929fa3190565d4f (patch)
treeecf034550496f36a040a63dfc87c134019449025
parentff69279a44e9ba876466b7d3ab84d6dbd31cac92 (diff)
parent47d80a68f10d3290204a12f7836a9a8190dfc327 (diff)
Merge tag 'riscv-for-linus-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux
Pull RISC-V fixes from Palmer Dabbelt: "RISC-V Fixes and Cleanups for 4.19-rc2 This contains a handful of patches that filtered their way in during the merge window but just didn't make the deadline. It includes: - Additional documentation in the riscv,cpu-intc device tree binding that resulted from some feedback I missed in the original patch set. - A build fix that provides the definition of tlb_flush() before including tlb.h, which fixes a RISC-V build regression introduced during this merge window. - A cosmetic cleanup to sys_riscv_flush_icache()" * tag 'riscv-for-linus-4.19-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: RISC-V: Use a less ugly workaround for unused variable warnings riscv: tlb: Provide definition of tlb_flush() before including tlb.h dt-bindings: riscv,cpu-intc: Cleanups from a missed review
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt14
-rw-r--r--arch/riscv/include/asm/tlb.h4
-rw-r--r--arch/riscv/kernel/sys_riscv.c15
3 files changed, 16 insertions, 17 deletions
diff --git a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt
index b0a8af51c388..265b223cd978 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/riscv,cpu-intc.txt
@@ -11,7 +11,7 @@ The RISC-V supervisor ISA manual specifies three interrupt sources that are
11attached to every HLIC: software interrupts, the timer interrupt, and external 11attached to every HLIC: software interrupts, the timer interrupt, and external
12interrupts. Software interrupts are used to send IPIs between cores. The 12interrupts. Software interrupts are used to send IPIs between cores. The
13timer interrupt comes from an architecturally mandated real-time timer that is 13timer interrupt comes from an architecturally mandated real-time timer that is
14controller via Supervisor Binary Interface (SBI) calls and CSR reads. External 14controlled via Supervisor Binary Interface (SBI) calls and CSR reads. External
15interrupts connect all other device interrupts to the HLIC, which are routed 15interrupts connect all other device interrupts to the HLIC, which are routed
16via the platform-level interrupt controller (PLIC). 16via the platform-level interrupt controller (PLIC).
17 17
@@ -25,7 +25,15 @@ in the system.
25 25
26Required properties: 26Required properties:
27- compatible : "riscv,cpu-intc" 27- compatible : "riscv,cpu-intc"
28- #interrupt-cells : should be <1> 28- #interrupt-cells : should be <1>. The interrupt sources are defined by the
29 RISC-V supervisor ISA manual, with only the following three interrupts being
30 defined for supervisor mode:
31 - Source 1 is the supervisor software interrupt, which can be sent by an SBI
32 call and is reserved for use by software.
33 - Source 5 is the supervisor timer interrupt, which can be configured by
34 SBI calls and implements a one-shot timer.
35 - Source 9 is the supervisor external interrupt, which chains to all other
36 device interrupts.
29- interrupt-controller : Identifies the node as an interrupt controller 37- interrupt-controller : Identifies the node as an interrupt controller
30 38
31Furthermore, this interrupt-controller MUST be embedded inside the cpu 39Furthermore, this interrupt-controller MUST be embedded inside the cpu
@@ -38,7 +46,7 @@ An example device tree entry for a HLIC is show below.
38 ... 46 ...
39 cpu1-intc: interrupt-controller { 47 cpu1-intc: interrupt-controller {
40 #interrupt-cells = <1>; 48 #interrupt-cells = <1>;
41 compatible = "riscv,cpu-intc", "sifive,fu540-c000-cpu-intc"; 49 compatible = "sifive,fu540-c000-cpu-intc", "riscv,cpu-intc";
42 interrupt-controller; 50 interrupt-controller;
43 }; 51 };
44 }; 52 };
diff --git a/arch/riscv/include/asm/tlb.h b/arch/riscv/include/asm/tlb.h
index c229509288ea..439dc7072e05 100644
--- a/arch/riscv/include/asm/tlb.h
+++ b/arch/riscv/include/asm/tlb.h
@@ -14,6 +14,10 @@
14#ifndef _ASM_RISCV_TLB_H 14#ifndef _ASM_RISCV_TLB_H
15#define _ASM_RISCV_TLB_H 15#define _ASM_RISCV_TLB_H
16 16
17struct mmu_gather;
18
19static void tlb_flush(struct mmu_gather *tlb);
20
17#include <asm-generic/tlb.h> 21#include <asm-generic/tlb.h>
18 22
19static inline void tlb_flush(struct mmu_gather *tlb) 23static inline void tlb_flush(struct mmu_gather *tlb)
diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index 568026ccf6e8..fb03a4482ad6 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -65,24 +65,11 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
65SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end, 65SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end,
66 uintptr_t, flags) 66 uintptr_t, flags)
67{ 67{
68#ifdef CONFIG_SMP
69 struct mm_struct *mm = current->mm;
70 bool local = (flags & SYS_RISCV_FLUSH_ICACHE_LOCAL) != 0;
71#endif
72
73 /* Check the reserved flags. */ 68 /* Check the reserved flags. */
74 if (unlikely(flags & ~SYS_RISCV_FLUSH_ICACHE_ALL)) 69 if (unlikely(flags & ~SYS_RISCV_FLUSH_ICACHE_ALL))
75 return -EINVAL; 70 return -EINVAL;
76 71
77 /* 72 flush_icache_mm(current->mm, flags & SYS_RISCV_FLUSH_ICACHE_LOCAL);
78 * Without CONFIG_SMP flush_icache_mm is a just a flush_icache_all(),
79 * which generates unused variable warnings all over this function.
80 */
81#ifdef CONFIG_SMP
82 flush_icache_mm(mm, local);
83#else
84 flush_icache_all();
85#endif
86 73
87 return 0; 74 return 0;
88} 75}