Test upstream (not merged) patches for riscv
This incl. the following patches/fixes related to IRQ: https://patchwork.kernel.org/project/linux-riscv/patch/20230803012608.3540081-1-samuel.holland@sifive.com/ https://patchwork.kernel.org/project/linux-riscv/patch/20230725070549.89810-1-luxu.kernel@bytedance.com/ https://patchwork.kernel.org/project/linux-riscv/patch/20230716001506.3506041-3-guoren@kernel.org/ https://patchwork.kernel.org/project/linux-riscv/patch/20230716001506.3506041-2-guoren@kernel.org/ Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
parent
c7e670e4ad
commit
d69d90eae2
|
@ -180,7 +180,7 @@ Summary: The Linux kernel
|
||||||
# This is needed to do merge window version magic
|
# This is needed to do merge window version magic
|
||||||
%define patchlevel 5
|
%define patchlevel 5
|
||||||
# This allows pkg_release to have configurable %%{?dist} tag
|
# This allows pkg_release to have configurable %%{?dist} tag
|
||||||
%define specrelease 0.rc4.30%{?buildid}.2.riscv64%{?dist}
|
%define specrelease 0.rc4.30%{?buildid}.3.riscv64%{?dist}
|
||||||
# This defines the kabi tarball version
|
# This defines the kabi tarball version
|
||||||
%define kabiversion 6.5.0
|
%define kabiversion 6.5.0
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c
|
||||||
|
index a2fc952318e9..35b854cf078e 100644
|
||||||
|
--- a/arch/riscv/kernel/cpu.c
|
||||||
|
+++ b/arch/riscv/kernel/cpu.c
|
||||||
|
@@ -17,6 +17,11 @@
|
||||||
|
#include <asm/smp.h>
|
||||||
|
#include <asm/pgtable.h>
|
||||||
|
|
||||||
|
+bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
|
||||||
|
+{
|
||||||
|
+ return phys_id == cpuid_to_hartid_map(cpu);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Returns the hart ID of the given device tree node, or -ENODEV if the node
|
||||||
|
* isn't an enabled and valid RISC-V hart node.
|
||||||
|
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
|
||||||
|
index 85bbce0f758c..40420afbb1a0 100644
|
||||||
|
--- a/arch/riscv/kernel/smp.c
|
||||||
|
+++ b/arch/riscv/kernel/smp.c
|
||||||
|
@@ -61,11 +61,6 @@ int riscv_hartid_to_cpuid(unsigned long hartid)
|
||||||
|
return -ENOENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
-bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
|
||||||
|
-{
|
||||||
|
- return phys_id == cpuid_to_hartid_map(cpu);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
static void ipi_stop(void)
|
||||||
|
{
|
||||||
|
set_cpu_online(smp_processor_id(), false);
|
||||||
|
diff --git a/arch/riscv/include/asm/irqflags.h b/arch/riscv/include/asm/irqflags.h
|
||||||
|
index 08d4d6a5b7e9..7c31fc3c3559 100644
|
||||||
|
--- a/arch/riscv/include/asm/irqflags.h
|
||||||
|
+++ b/arch/riscv/include/asm/irqflags.h
|
||||||
|
@@ -49,7 +49,10 @@ static inline int arch_irqs_disabled(void)
|
||||||
|
/* set interrupt enabled status */
|
||||||
|
static inline void arch_local_irq_restore(unsigned long flags)
|
||||||
|
{
|
||||||
|
- csr_set(CSR_STATUS, flags & SR_IE);
|
||||||
|
+ if (flags & SR_IE)
|
||||||
|
+ csr_set(CSR_STATUS, SR_IE);
|
||||||
|
+ else
|
||||||
|
+ csr_clear(CSR_STATUS, SR_IE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _ASM_RISCV_IRQFLAGS_H */
|
||||||
|
diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
|
||||||
|
index f910dfccbf5d..927347a19847 100644
|
||||||
|
--- a/arch/riscv/kernel/traps.c
|
||||||
|
+++ b/arch/riscv/kernel/traps.c
|
||||||
|
@@ -372,6 +372,9 @@ asmlinkage void noinstr do_irq(struct pt_regs *regs)
|
||||||
|
: [sp] "r" (sp), [regs] "r" (regs)
|
||||||
|
: "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
|
||||||
|
"t0", "t1", "t2", "t3", "t4", "t5", "t6",
|
||||||
|
+#ifndef CONFIG_FRAME_POINTER
|
||||||
|
+ "s0",
|
||||||
|
+#endif
|
||||||
|
"memory");
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
|
||||||
|
index d0577cc6a081..a8efa053c4a5 100644
|
||||||
|
--- a/arch/riscv/kernel/irq.c
|
||||||
|
+++ b/arch/riscv/kernel/irq.c
|
||||||
|
@@ -84,6 +84,9 @@ void do_softirq_own_stack(void)
|
||||||
|
: [sp] "r" (sp)
|
||||||
|
: "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
|
||||||
|
"t0", "t1", "t2", "t3", "t4", "t5", "t6",
|
||||||
|
+#ifndef CONFIG_FRAME_POINTER
|
||||||
|
+ "s0",
|
||||||
|
+#endif
|
||||||
|
"memory");
|
||||||
|
} else
|
||||||
|
#endif
|
Loading…
Reference in New Issue