From: Lukas Wunner <lukas@wunner.de>
To: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
Cc: Lino Sanfilippo <LinoSanfilippo@gmx.de>,
peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca,
jsnitsel@redhat.com, hdegoede@redhat.com, oe-lkp@lists.linux.dev,
lkp@intel.com, peterz@infradead.org, linux@mniewoehner.de,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
l.sanfilippo@kunbus.com, p.rosenberger@kunbus.com
Subject: Re: [PATCH 1/2] tpm, tpm_tis: Handle interrupt storm
Date: Tue, 23 May 2023 17:16:42 +0200 [thread overview]
Message-ID: <20230523151642.GA31298@wunner.de> (raw)
In-Reply-To: <98f7dc1a-6bed-a66f-650e-10caeb7d0bca@linux.intel.com>
On Tue, May 23, 2023 at 12:14:28PM +0300, Péter Ujfalusi wrote:
> On 23/05/2023 10:44, Lukas Wunner wrote:
> > On Tue, May 23, 2023 at 09:48:23AM +0300, Péter Ujfalusi wrote:
> >> On 22/05/2023 17:31, Lino Sanfilippo wrote:
> > [...]
> >> This looked promising, however it looks like the UPX-i11 needs the DMI
> >> quirk.
> >
> > Why is that? Is there a fundamental problem with the patch or is it
> > a specific issue with that device?
>
> The flood is not detected (if there is a flood at all), interrupt stops
> working after about 200 interrupts - in the latest boot at 118th.
You've got a variant of the "never asserted interrupt".
That condition is currently tested only once on probe in tpm_tis_core_init().
The solution would be to disable interrupts whenever they're not (or no
longer asserted).
However, that's a distinct issue from the one addressed by the present
patch, which deals with a "never *de*asserted interrupt".
> >>> + 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.
> >>> rc = tpm_tis_write32(priv, TPM_INT_STATUS(priv->locality), interrupt);
> >>> tpm_tis_relinquish_locality(chip, 0);
> >>> if (rc < 0)
> >>> - return IRQ_NONE;
> >>> + goto unhandled;
> >>
> >> This is more like an error than just unhandled IRQ. Yes, it was ignored,
> >> probably because it is common?
> >
> > The interrupt may be shared and then it's not an error.
>
> but this is tpm_tis_write32() failing, no? If it is shared interrupt and
> we return IRQ_HANDLED unconditionally then I think the core will think
> that the interrupt was for this device and it was handled.
No. The IRQ_HANDLED versus IRQ_NONE return values are merely used
for book-keeping of spurious interrupts. If IRQ_HANDLED is returned,
the other handlers will still be invoked. It is not discernible whether
a shared interrupt was asserted by a single device or by multiple devices,
so all handlers need to be called.
Thanks,
Lukas
next prev parent reply other threads:[~2023-05-23 15:17 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-22 14:31 [PATCH 1/2] tpm, tpm_tis: Handle interrupt storm Lino Sanfilippo
2023-05-22 14:31 ` [PATCH 2/2] tpm, tpm_tis: reuse code in disable_interrupts() Lino Sanfilippo
2023-05-22 22:45 ` Jerry Snitselaar
2023-05-23 7:08 ` Péter Ujfalusi
2023-05-23 19:07 ` Jarkko Sakkinen
2023-05-23 20:52 ` Lino Sanfilippo
2023-05-24 1:29 ` Jarkko Sakkinen
2023-05-22 22:44 ` [PATCH 1/2] tpm, tpm_tis: Handle interrupt storm Jerry Snitselaar
2023-05-23 6:48 ` Péter Ujfalusi
2023-05-23 7:07 ` Péter Ujfalusi
2023-05-23 7:44 ` Lukas Wunner
2023-05-23 9:14 ` Péter Ujfalusi
2023-05-23 9:20 ` Hans de Goede
2023-05-23 9:35 ` Péter Ujfalusi
2023-05-23 10:35 ` Lino Sanfilippo
2023-05-23 15:19 ` Lukas Wunner
2023-05-23 10:41 ` Lino Sanfilippo
2023-05-23 15:16 ` Lukas Wunner [this message]
2023-05-24 9:08 ` Hans de Goede
2023-05-29 10:44 ` Michael Niewöhner
2023-05-23 19:35 ` Jarkko Sakkinen
2023-05-23 18:53 ` Jarkko Sakkinen
2023-05-23 19:00 ` Jarkko Sakkinen
2023-05-23 19:46 ` Lukas Wunner
2023-05-24 1:44 ` Jarkko Sakkinen
2023-05-23 20:50 ` Lino Sanfilippo
2023-05-23 19:12 ` Jarkko Sakkinen
2023-05-23 22:32 ` Jerry Snitselaar
2023-05-24 1:21 ` Jarkko Sakkinen
2023-05-23 19:37 ` Lukas Wunner
2023-05-24 1:46 ` Jarkko Sakkinen
2023-05-23 20:46 ` Lino Sanfilippo
2023-05-29 6:46 ` Péter Ujfalusi
2023-05-29 13:15 ` Lino Sanfilippo
2023-06-06 16:42 ` Jarkko Sakkinen
2023-05-30 17:56 ` Jerry Snitselaar
2023-06-06 16:35 ` Jarkko Sakkinen
2023-06-06 16:45 ` Jarkko Sakkinen
2023-05-24 3:58 ` Jarkko Sakkinen
2023-05-24 3:59 ` Jarkko Sakkinen
2023-05-24 7:29 ` Lukas Wunner
2023-05-24 15:30 ` Jarkko Sakkinen
2023-05-26 0:37 ` Lino Sanfilippo
2023-05-30 10:31 ` Lino Sanfilippo
2023-05-25 23:45 ` Lino Sanfilippo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230523151642.GA31298@wunner.de \
--to=lukas@wunner.de \
--cc=LinoSanfilippo@gmx.de \
--cc=hdegoede@redhat.com \
--cc=jarkko@kernel.org \
--cc=jgg@ziepe.ca \
--cc=jsnitsel@redhat.com \
--cc=l.sanfilippo@kunbus.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@mniewoehner.de \
--cc=lkp@intel.com \
--cc=oe-lkp@lists.linux.dev \
--cc=p.rosenberger@kunbus.com \
--cc=peter.ujfalusi@linux.intel.com \
--cc=peterhuewe@gmx.de \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox