[PATCH 1/3] riscv: Allow forced irq threading

Palmer Dabbelt palmer at dabbelt.com
Wed Aug 4 13:33:18 PDT 2021


On Wed, 07 Jul 2021 23:42:45 PDT (-0700), wangkefeng.wang at huawei.com wrote:
>
> On 2021/7/8 13:28, Christoph Hellwig wrote:
>> On Thu, Jul 08, 2021 at 09:59:47AM +0800, Kefeng Wang wrote:
>>> 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?
>
> 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?

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!



More information about the linux-riscv mailing list