lkml.org 
[lkml]   [2020]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v8 10/11] irqchip/sifive-plic: Initialize the plic handler when cpu comes online
Date
Atish Patra <atish.patra@wdc.com> writes:

> +static void plic_handler_init(struct plic_handler *handler, u32 threshold)
> +{
> + irq_hw_number_t hwirq;
> +
> + /* priority must be > threshold to trigger an interrupt */
> + writel(threshold, handler->hart_base + CONTEXT_THRESHOLD);
> + for (hwirq = 1; hwirq < plic_irqdomain->hwirq_max; hwirq++)
> + plic_toggle(handler, hwirq, 0);
> +}

> +
> +static int plic_starting_cpu(unsigned int cpu)
> +{
> + u32 threshold = 0;

Pointless variable. Also you use PLIC_DISABLE_THRESHOLD down below, so
please add a proper define for enable as well.

> + struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu);

this_cpu_ptr*&...)

The callback is guaranteed to run on the plugged in CPU.

> - threshold = 0xffffffff;
> + plic_handler_init(handler, PLIC_DISABLE_THRESHOLD);

Thanks,

tglx

\
 
 \ /
  Last update: 2020-02-13 12:02    [W:0.100 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site