linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Jerry Snitselaar <jsnitsel@redhat.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Stefan Berger <stefanb@linux.ibm.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-integrity@vger.kernel.org,
	Mark Pearson <mpearson@lenovo.com>
Subject: Re: [PATCH] tpm_tis_core: Disable broken IRQ handling code
Date: Thu, 14 May 2020 00:31:24 +0300	[thread overview]
Message-ID: <20200513213114.GA31974@linux.intel.com> (raw)
In-Reply-To: <CAPcyv4j4-GRkwdSHNVUGLzehBVC6hUR4pNeez_=E6FKjS_DmNQ@mail.gmail.com>

On Thu, May 07, 2020 at 02:51:43PM -0700, Dan Williams wrote:
> On Thu, May 7, 2020 at 7:17 AM Jerry Snitselaar <jsnitsel@redhat.com> wrote:
> >
> > On Thu May 07 20, Hans de Goede wrote:
> > >Hi All,
> > >
> > >On 4/10/20 11:06 PM, Jarkko Sakkinen wrote:
> > >>On Thu, Apr 09, 2020 at 11:10:44PM +0200, Hans de Goede wrote:
> > >>>Since commit dda8b2af395b ("tpm: Revert "tpm_tis_core: Set
> > >>>TPM_CHIP_FLAG_IRQ before probing for interrupts"") we no longer set
> > >>>the TPM_CHIP_FLAG_IRQ ever.
> > >>>
> > >>>So the whole IRQ probing code is not useful, worse we rely on the
> > >>>IRQ-test path of tpm_tis_send() to call disable_interrupts() if
> > >>>interrupts do not work, but that path never gets entered because we
> > >>>never set the TPM_CHIP_FLAG_IRQ.
> > >>>
> > >>>So the remaining IRQ probe code calls request_irq() and never calls
> > >>>free_irq() even when the interrupt is not working.
> > >>>
> > >>>On some systems, e.g. the Lenovo X1 8th gen,  the interrupt we try
> > >>>to use and never free creates an interrupt storm followed by
> > >>>an "irq XX: nobody cared" oops.
> > >>>
> > >>>Since it is non-functional at the moment anyways, lets just completely
> > >>>disable the IRQ code in tpm_tis_core for now.
> > >>>
> > >>>Fixes: dda8b2af395b ("tpm: Revert "tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts"")
> > >>>Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> > >>>---
> > >>>Note I'm working with Lenovo to try and get to the bottom of this.
> > >>>---
> > >>
> > >>OK if I recall correctly the reason for reverting was that the fixes
> > >>Stefan was sending were broken and no access to hardware were the
> > >>issues would be visible. The reason for not doing anything til this
> > >>day is that we don't have T490 available.
> > >
> > >So as promised I have been in contact with Lenovo about this.
> > >
> > >Specifically I have been in contact with Lenovo about seeing an
> > >IRQ storm when the tpm_tis code tries to use the IRQ on a X1 carbon
> > >8th gen (X1C8), because of the now public plan that Lenovo will
> > >offer ordering this model with Fedora pre-installed:
> > >https://lwn.net/Articles/818595/
> > >
> > >On the X1C8 the problem has been diagnosed to be a misconfigured
> > >GPIO pin on the CPU (the SoC). The X1C8 uses an SPI connected
> > >TPM chip with its IRQ connected to a GPIO on the SoC which is
> > >configured in Direct IRQ mode, so that it directly asserts
> > >IRQs on one of the APIC IRQs.  The problem is that due to the
> > >misconfiguration as soon as the IRQ is enabled it fires
> > >continuously.
> > >
> > >For the X1C8 this should be fixed in the BIOS of the first
> > >batch which gets shipped out to customers so there we should
> > >not have to worry about this.
> > >
> > >It is likely (but not yet confirmed) that the issue on the T490
> > >is the same, although on my test X1C8 device I got an IRQ storm,
> > >followed by the kernel disabling the IRQ, not a non booting system.
> > >I guess this might be due to kernel configuration differences.
> > >
> > >Assuming that the issue on the T490 is the same, we might see a
> > >BIOS update fixing this, but given that non-booting is
> > >'not good ("tm")' even if there will be a BIOS fix we should
> > >still do something at the kernel level to also work with the
> > >older unfixed BIOS which is already out there.
> > >
> > >I've been thinking about this and I'm afraid that the only thing
> > >what we can do is add a DMI product-name (product-version for Lenovo)
> > >string based blacklist for IRQ usage to drivers/char/tpm/tpm_tis.c
> > >and set tpm_info.irq = -1 for devices on that list.
> > >
> > >My plan is to prepare a RFC patch of such a blacklist, while we
> > >wait for confirmation that the root cause on the T490 is the same
> > >as on the X1C8, but before I work on that I'm wondering if
> > >people agree that that is the best approach, or if there are
> > >other suggestions for dealing with this ?
> > >
> > >Regards,
> > >
> > >Hans
> > >
> >
> > Dan,
> >
> > Could this be the cause of the problem on the system you were
> > seeing the issue with, or was that using PTT?
> 
> It sounds similar, I'm just not immediately aware of where I can find
> out how the GPIOs are routed on that development board. I'll poke
> around.
> 
> What's PTT?

Intel fTPM.

/Jarkko

  parent reply	other threads:[~2020-05-13 21:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 21:10 [PATCH] tpm_tis_core: Disable broken IRQ handling code Hans de Goede
2020-04-10 16:38 ` Jason Gunthorpe
2020-04-10 21:08   ` Jarkko Sakkinen
2020-04-10 21:12   ` Jarkko Sakkinen
2020-04-14 17:44   ` Jerry Snitselaar
2020-04-15  8:57     ` Jan Lübbe
2020-04-16 17:03     ` Jarkko Sakkinen
2020-04-10 21:06 ` Jarkko Sakkinen
2020-04-10 21:09   ` Jarkko Sakkinen
2020-04-12 14:55     ` Jarkko Sakkinen
2020-05-07 14:02   ` Hans de Goede
2020-05-07 14:02   ` Hans de Goede
2020-05-07 14:17     ` Jerry Snitselaar
2020-05-07 17:38       ` Hans de Goede
2020-05-07 21:51       ` Dan Williams
2020-05-07 23:13         ` Jerry Snitselaar
2020-05-08  7:45         ` Hans de Goede
2020-05-13 21:31         ` Jarkko Sakkinen [this message]
2020-06-04  9:17     ` Jerry Snitselaar
2020-06-15 22:06       ` Jarkko Sakkinen
2020-06-16  8:24       ` Hans de Goede
2020-06-17 22:56         ` Jarkko Sakkinen

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=20200513213114.GA31974@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=mpearson@lenovo.com \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).