[PATCH] lib: irqchip/plic: fix typo in plic_warm_irqchip_init

Anup Patel anup at brainfault.org
Tue Jun 21 22:30:33 PDT 2022


On Wed, Jun 22, 2022 at 10:27 AM Anup Patel <anup at brainfault.org> wrote:
>
> On Tue, Jun 21, 2022 at 5:38 PM Jan Remes <jan.remes at codasip.com> wrote:
> >
> > The second invocation of plic_context_init() incorrectly calls the
> > function with m_cntx_id instead of s_cntx_id. This breaks systems which
> > only have 1 external interrupt per hart.
> >
> > Fixes: 8c362e7 ("lib: irqchip/plic: Factor out a context init function")
> > Signed-off-by: Jan Remes <jan.remes at codasip.com>
>
> Looks good to me.
>
> Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

>
> Regards,
> Anup
>
> > ---
> >  lib/utils/irqchip/plic.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/utils/irqchip/plic.c b/lib/utils/irqchip/plic.c
> > index 8c25b9d..73d7788 100644
> > --- a/lib/utils/irqchip/plic.c
> > +++ b/lib/utils/irqchip/plic.c
> > @@ -145,7 +145,7 @@ int plic_warm_irqchip_init(const struct plic_data *plic,
> >
> >         /* By default, disable all IRQs for S-mode of target HART */
> >         if (s_cntx_id > -1) {
> > -               ret = plic_context_init(plic, m_cntx_id, false, 0x7);
> > +               ret = plic_context_init(plic, s_cntx_id, false, 0x7);
> >                 if (ret)
> >                         return ret;
> >         }
> > --
> > 2.36.1
> >
> >
> > --
> > opensbi mailing list
> > opensbi at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list