Messages in this thread | | | From | Atish Patra <> | Date | Thu, 13 Feb 2020 11:01:35 -0800 | Subject | Re: [PATCH v8 10/11] irqchip/sifive-plic: Initialize the plic handler when cpu comes online |
| |
On Thu, Feb 13, 2020 at 3:02 AM Thomas Gleixner <tglx@linutronix.de> wrote: > > 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. >
Sure. Will do that.
> > + struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu); > > this_cpu_ptr*&...) > > The callback is guaranteed to run on the plugged in CPU. >
Ah yes. I will change it to this_cpu_ptr. Thanks.
> > - threshold = 0xffffffff; > > + plic_handler_init(handler, PLIC_DISABLE_THRESHOLD); > > Thanks, > > tglx >
-- Regards, Atish
| |