[Skiboot] [PATCH v2 2/5] hw/psi-p9: Make interrupt name array global

Oliver O'Halloran oohall at gmail.com
Thu Sep 5 17:46:33 AEST 2019


On Thu, Sep 5, 2019 at 5:02 PM Cédric Le Goater <clg at kaod.org> wrote:
>
> > +static char *psi_p9_irq_name(struct irq_source *is, uint32_t isn)
> > +{
> > +     struct psi *psi = is->data;
> > +     uint32_t idx = isn - psi->interrupt;
> > +
> > +     if (idx >= ARRAY_SIZE(p9_psi_int_names))
> > +             return NULL;
> > +     return strdup(p9_psi_int_names[idx]);
>
> I haven't seen any of the interrupt sources allocating the name returned.
>
> I think we could remove the strdup from all name() handlers and the free()
> from add_opal_interrupts() one day.

Yeah looks like they don't currently. I think the idea was to return a
malloc()ed string so the source could label the interrupts them based
on the source name. It's not needed for the PSI since there's only one
and you can use the HWIRQ number to work out what chip it's from, but
for the PHBs it's good to be able to differentiate since otherwise you
have a sea of interrupts labelled "PHB Error". Granted we don't have
the PHB error interrupts wired up at the moment, but it's something
I'll get around to eventually.

I suppose we could just generate them before registering the source.

Oliver


More information about the Skiboot mailing list