Merge tag 'riscv-for-linus-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:

- A fix for the K210 sdcard defconfig, to avoid using a
fixed delay for the root FS

- A fix to make sure there's a proper call frame for
trace_hardirqs_{on,off}().

* tag 'riscv-for-linus-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: fix oops caused by irqsoff latency tracer
riscv: fix nommu_k210_sdcard_defconfig

+46 -6
+1 -1
arch/riscv/configs/nommu_k210_sdcard_defconfig
··· 23 23 CONFIG_SOC_CANAAN=y 24 24 CONFIG_SMP=y 25 25 CONFIG_NR_CPUS=2 26 - CONFIG_CMDLINE="earlycon console=ttySIF0 rootdelay=2 root=/dev/mmcblk0p1 ro" 26 + CONFIG_CMDLINE="earlycon console=ttySIF0 root=/dev/mmcblk0p1 rootwait ro" 27 27 CONFIG_CMDLINE_FORCE=y 28 28 # CONFIG_SECCOMP is not set 29 29 # CONFIG_STACKPROTECTOR is not set
+2
arch/riscv/kernel/Makefile
··· 51 51 obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o 52 52 obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o 53 53 54 + obj-$(CONFIG_TRACE_IRQFLAGS) += trace_irq.o 55 + 54 56 obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o 55 57 obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o 56 58 obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
+5 -5
arch/riscv/kernel/entry.S
··· 108 108 .option pop 109 109 110 110 #ifdef CONFIG_TRACE_IRQFLAGS 111 - call trace_hardirqs_off 111 + call __trace_hardirqs_off 112 112 #endif 113 113 114 114 #ifdef CONFIG_CONTEXT_TRACKING ··· 143 143 li t0, EXC_BREAKPOINT 144 144 beq s4, t0, 1f 145 145 #ifdef CONFIG_TRACE_IRQFLAGS 146 - call trace_hardirqs_on 146 + call __trace_hardirqs_on 147 147 #endif 148 148 csrs CSR_STATUS, SR_IE 149 149 ··· 234 234 REG_L s0, PT_STATUS(sp) 235 235 csrc CSR_STATUS, SR_IE 236 236 #ifdef CONFIG_TRACE_IRQFLAGS 237 - call trace_hardirqs_off 237 + call __trace_hardirqs_off 238 238 #endif 239 239 #ifdef CONFIG_RISCV_M_MODE 240 240 /* the MPP value is too large to be used as an immediate arg for addi */ ··· 270 270 REG_L s1, PT_STATUS(sp) 271 271 andi t0, s1, SR_PIE 272 272 beqz t0, 1f 273 - call trace_hardirqs_on 273 + call __trace_hardirqs_on 274 274 j 2f 275 275 1: 276 - call trace_hardirqs_off 276 + call __trace_hardirqs_off 277 277 2: 278 278 #endif 279 279 REG_L a0, PT_STATUS(sp)
+27
arch/riscv/kernel/trace_irq.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2022 Changbin Du <changbin.du@gmail.com> 4 + */ 5 + 6 + #include <linux/irqflags.h> 7 + #include <linux/kprobes.h> 8 + #include "trace_irq.h" 9 + 10 + /* 11 + * trace_hardirqs_on/off require the caller to setup frame pointer properly. 12 + * Otherwise, CALLER_ADDR1 might trigger an pagging exception in kernel. 13 + * Here we add one extra level so they can be safely called by low 14 + * level entry code which $fp is used for other purpose. 15 + */ 16 + 17 + void __trace_hardirqs_on(void) 18 + { 19 + trace_hardirqs_on(); 20 + } 21 + NOKPROBE_SYMBOL(__trace_hardirqs_on); 22 + 23 + void __trace_hardirqs_off(void) 24 + { 25 + trace_hardirqs_off(); 26 + } 27 + NOKPROBE_SYMBOL(__trace_hardirqs_off);
+11
arch/riscv/kernel/trace_irq.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2022 Changbin Du <changbin.du@gmail.com> 4 + */ 5 + #ifndef __TRACE_IRQ_H 6 + #define __TRACE_IRQ_H 7 + 8 + void __trace_hardirqs_on(void); 9 + void __trace_hardirqs_off(void); 10 + 11 + #endif /* __TRACE_IRQ_H */