Skip to content

Commit 991f173

Browse files
committed
Merge tag 'riscv-for-linus-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - A fix to add the missing PWM LEDs into the SiFive HiFive Unleashed device tree. - A fix to fully clear a task's registers on creation, as they end up in userspace and thus leak kernel memory. - A pair of VDSO-related build fixes that manifest on recent LLVM-based toolchains. - A fix to our early init to ensure the DT is adequately processed before reserved memory nodes are processed. * tag 'riscv-for-linus-6.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: vdso: Do not add missing symbols to version section in linker script riscv: fix reserved memory setup riscv: vdso: fix build with llvm riscv: process: fix kernel info leakage riscv: dts: sifive unleashed: Add PWM controlled LEDs
2 parents 74bd160 + fcae44f commit 991f173

6 files changed

Lines changed: 47 additions & 2 deletions

File tree

arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "fu540-c000.dtsi"
55
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/leds/common.h>
7+
#include <dt-bindings/pwm/pwm.h>
68

79
/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
810
#define RTCCLK_FREQ 1000000
@@ -42,6 +44,42 @@
4244
compatible = "gpio-restart";
4345
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
4446
};
47+
48+
led-controller {
49+
compatible = "pwm-leds";
50+
51+
led-d1 {
52+
pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
53+
active-low;
54+
color = <LED_COLOR_ID_GREEN>;
55+
max-brightness = <255>;
56+
label = "d1";
57+
};
58+
59+
led-d2 {
60+
pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
61+
active-low;
62+
color = <LED_COLOR_ID_GREEN>;
63+
max-brightness = <255>;
64+
label = "d2";
65+
};
66+
67+
led-d3 {
68+
pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
69+
active-low;
70+
color = <LED_COLOR_ID_GREEN>;
71+
max-brightness = <255>;
72+
label = "d3";
73+
};
74+
75+
led-d4 {
76+
pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
77+
active-low;
78+
color = <LED_COLOR_ID_GREEN>;
79+
max-brightness = <255>;
80+
label = "d4";
81+
};
82+
};
4583
};
4684

4785
&uart0 {

arch/riscv/kernel/process.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
164164
unsigned long tls = args->tls;
165165
struct pt_regs *childregs = task_pt_regs(p);
166166

167+
memset(&p->thread.s, 0, sizeof(p->thread.s));
168+
167169
/* p->thread holds context to be restored by __switch_to() */
168170
if (unlikely(args->fn)) {
169171
/* Kernel thread */

arch/riscv/kernel/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ void __init setup_arch(char **cmdline_p)
283283
else
284284
pr_err("No DTB found in kernel mappings\n");
285285
#endif
286+
early_init_fdt_scan_reserved_mem();
286287
misc_mem_init();
287288

288289
init_resources();

arch/riscv/kernel/vdso/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
2828

2929
obj-y += vdso.o
3030
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
31+
ifneq ($(filter vgettimeofday, $(vdso-syms)),)
32+
CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY
33+
endif
3134

3235
# Disable -pg to prevent insert call site
33-
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
36+
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
3437

3538
# Disable profiling and instrumentation for VDSO code
3639
GCOV_PROFILE := n

arch/riscv/kernel/vdso/vdso.lds.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ VERSION
6868
LINUX_4.15 {
6969
global:
7070
__vdso_rt_sigreturn;
71+
#ifdef HAS_VGETTIMEOFDAY
7172
__vdso_gettimeofday;
7273
__vdso_clock_gettime;
7374
__vdso_clock_getres;
75+
#endif
7476
__vdso_getcpu;
7577
__vdso_flush_icache;
7678
local: *;

arch/riscv/mm/init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ static void __init setup_bootmem(void)
262262
memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va));
263263
}
264264

265-
early_init_fdt_scan_reserved_mem();
266265
dma_contiguous_reserve(dma32_phys_limit);
267266
if (IS_ENABLED(CONFIG_64BIT))
268267
hugetlb_cma_reserve(PUD_SHIFT - PAGE_SHIFT);

0 commit comments

Comments
 (0)