riscv: Enable some feature for RISCV
cover riscv: Enable some feature for RISCV
Enable IRQ_FORCED_THREADING, GENERIC_IDLE_POLL_SETUP, GENERIC_IRQ_SHOW_LEVEL for RISCV.
Kefeng Wang (3):
riscv: Allow forced irq threading
riscv: Enable idle generic idle loop
riscv: Enable GENERIC_IRQ_SHOW_LEVEL
arch/riscv/Kconfig | 3 +++ 1 file changed, 3 insertions(+)
Signature · 7 lines
2.26.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
PATCH 1/3 riscv: Allow forced irq threading
The timer interrupt and the perf interrupt on riscv are with IRQF_PERCPU, so it's safe to allow forced interrupt threading.
--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
@@ -91,6 +91,7 @@ config RISCV select HAVE_STACKPROTECTOR select HAVE_SYSCALL_TRACEPOINTS select IRQ_DOMAIN + select IRQ_FORCED_THREADING select MODULES_USE_ELF_RELA if MODULES select MODULE_SECTIONS if MODULES select OF
Signature · 7 lines
2.26.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH 1/3] riscv: Allow forced irq threading
Quoted 2 lines · Kefeng Wang
The timer interrupt and the perf interrupt on riscv are with
IRQF_PERCPU, so it's safe to allow forced interrupt threading.
"Architecture code needs to select CONFIG_IRQ_FORCED_THREADING after
marking the interrupts which cant be threaded IRQF_NO_THREAD. All interrupts which have IRQF_TIMER set are implict marked IRQF_NO_THREAD. Also all PER_CPU interrupts are excluded."
Did you do that audit?
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH 1/3] riscv: Allow forced irq threading
Quoted 9 lines · Christoph Hellwig
Quoted 2 lines · Kefeng Wang
The timer interrupt and the perf interrupt on riscv are with
IRQF_PERCPU, so it's safe to allow forced interrupt threading."Architecture code needs to select
CONFIG_IRQ_FORCED_THREADINGafter
marking the interrupts which cant be threadedIRQF_NO_THREAD. All interrupts which haveIRQF_TIMERset are implict markedIRQF_NO_THREAD. Also allPER_CPUinterrupts are excluded."Did you do that audit?
Yes, I check the perf and timer on RISCV,
arch/riscv/kernel/perf_event.c
static int reserve_pmc_hardware(void)
{
err = request_irq(riscv_pmu->irq, riscv_pmu->handle_irq, IRQF_PERCPU, "riscv-base-perf", NULL);
}
drivers/clocksource/timer-riscv.c
static int __init riscv_timer_init_dt(struct device_node *n)
{
error = request_percpu_irq(riscv_clock_event_irq, riscv_timer_interrupt,
"riscv-timer", &riscv_clock_event);
}
Is this enough?
Quoted 2 lines
.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Palmer Dabbelt
maintainerRe: [PATCH 1/3] riscv: Allow forced irq threading
Quoted 31 lines · On Wed, 07 Jul 2021 23:42:45 PDT (-0700), [email protected] wrote:
Quoted 9 lines · Christoph Hellwig
Quoted 2 lines · Kefeng Wang
The timer interrupt and the perf interrupt on riscv are with
IRQF_PERCPU, so it's safe to allow forced interrupt threading."Architecture code needs to select
CONFIG_IRQ_FORCED_THREADINGafter
marking the interrupts which cant be threadedIRQF_NO_THREAD. All interrupts which haveIRQF_TIMERset are implict markedIRQF_NO_THREAD. Also allPER_CPUinterrupts are excluded."Did you do that audit?
Yes, I check the perf and timer on RISCV,
arch/riscv/kernel/perf_event.cstatic int
reserve_pmc_hardware(void){
err =
request_irq(riscv_pmu->irq, riscv_pmu->handle_irq, IRQF_PERCPU, "riscv-base-perf", NULL);}
drivers/clocksource/timer-riscv.cstatic int
__initriscv_timer_init_dt(struct device_node *n){
Quoted 7 lines
error = request_percpu_irq(riscv_clock_event_irq,
riscv_timer_interrupt,
"riscv-timer",&riscv_clock_event);}
Is this enough?
We also have the direct CLINT driver, but that's percpu as well. IIUC this means we're OK, I've put this (and the rest of the patch set) on for-next.
Thanks!
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
PATCH 2/3 riscv: Enable idle generic idle loop
In reply to Kefeng WangEnable generic idle loop to support for hlt/nohlt command line options to override default idle loop behavior.
--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
@@ -48,6 +48,7 @@ config RISCV select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GENERIC_EARLY_IOREMAP select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO + select GENERIC_IDLE_POLL_SETUP select GENERIC_IOREMAP select GENERIC_IRQ_MULTI_HANDLER select GENERIC_IRQ_SHOW
Signature · 7 lines
2.26.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
PATCH 3/3 riscv: Enable GENERIC_IRQ_SHOW_LEVEL
In reply to Kefeng WangThe interrupt controllers on riscv support both edge and level triggered interrupts, it's useful to provide that information in /proc/interrupts.
--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
@@ -52,6 +52,7 @@ config RISCV select GENERIC_IOREMAP select GENERIC_IRQ_MULTI_HANDLER select GENERIC_IRQ_SHOW + select GENERIC_IRQ_SHOW_LEVEL select GENERIC_LIB_DEVMEM_IS_ALLOWED select GENERIC_PCI_IOMAP select GENERIC_PTDUMP if MMU
Signature · 7 lines
2.26.2 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv