Re: [PATCH 1/2] tpm, tpm_tis: Handle interrupt storm

From: Michael Niewöhner
Date: Mon May 29 2023 - 06:47:12 EST


On Tue, 2023-05-23 at 17:16 +0200, Lukas Wunner wrote:
> > > > > +       dev_err(&chip->dev, HW_ERR
> > > > > +               "TPM interrupt storm detected, polling instead\n");
> > > >
> > > > Should this be dev_warn or even dev_info level?
> > >
> > > The corresponding message emitted in tpm_tis_core_init() for
> > > an interrupt that's *never* asserted uses dev_err(), so using
> > > dev_err() here as well serves consistency:
> > >
> > >         dev_err(&chip->dev, FW_BUG
> > >                 "TPM interrupt not working, polling instead\n");
> > >
> > > That way the same severity is used both for the never asserted and
> > > the never deasserted interrupt case.
> >
> > Oh, OK.
> > Is there anything the user can do to have a ERROR less boot?
>
> You're right that the user can't do anything about it and that
> toning the message down to KERN_WARN or even KERN_NOTICE severity
> may be appropriate.
>
> However the above-quoted message for the never asserted interrupt
> in tpm_tis_core_init() should then likewise be toned down to the
> same severity.
>
> I'm wondering why that message uses FW_BUG.  That doesn't make any
> sense to me.  It's typically not a firmware bug, but a hardware issue,
> e.g. an interrupt pin may erroneously not be connected or may be
> connected to ground.  Lino used HW_ERR, which seems more appropriate
> to me.

Firmware is responsible for configuring gpios and interrupts correctly,
independently of it being a design decision or a mistake. AIUI any interrupt
storm could be prevented by firmware in any case by simply disabling that
interrupt. Thus, FW_BUG is the right thing to use here IMO.