From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Dan Williams <dan.j.williams@intel.com>,
Greg KH <gregkh@linuxfoundation.org>
Cc: Christian Bundy <christianbundy@fraction.io>,
Jason Gunthorpe <jgg@ziepe.ca>,
Jerry Snitselaar <jsnitsel@redhat.com>,
Peter Huewe <peterhuewe@gmx.de>,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
stable-commits@vger.kernel.org, linux-integrity@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Patch "tpm_tis: reserve chip for duration of tpm_tis_core_init" has been added to the 5.4-stable tree
Date: Fri, 27 Dec 2019 08:11:50 +0200 [thread overview]
Message-ID: <50217a688ffa56cf5f150ffd358daba2a88cad48.camel@linux.intel.com> (raw)
In-Reply-To: <c6ce34b130210d2d1330fc4079d6d82bd74dcef1.camel@linux.intel.com>
Dan, please also test the branch and tell if other patches are needed.
I'm a bit blind with this as I don't have direct access to the faulting
hardware. Thanks. [*]
[*] https://lkml.org/lkml/2019/12/27/12
/Jarkko
On Fri, 2019-12-27 at 08:05 +0200, Jarkko Sakkinen wrote:
> Hi,
>
> It is getting done on the PR. Hold on for testing and I'll send the
> PR later today.
>
> /Jarkko
>
> On Mon, 2019-12-23 at 11:46 -0800, Dan Williams wrote:
> > Hi Greg,
> >
> > Please drop the:
> >
> > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> >
> > ...tag. I had asked Jarkko to do that here:
> >
> > https://lore.kernel.org/r/CAPcyv4h60z889bfbiwvVhsj6MxmOPiPY8ZuPB_skxkZx-N+OGw@mail.gmail.com/
> >
> > ...but it didn't get picked up.
> >
> > On Mon, Dec 23, 2019 at 9:37 AM <gregkh@linuxfoundation.org> wrote:
> > > This is a note to let you know that I've just added the patch titled
> > >
> > > tpm_tis: reserve chip for duration of tpm_tis_core_init
> > >
> > > to the 5.4-stable tree which can be found at:
> > > http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > >
> > > The filename of the patch is:
> > > tpm_tis-reserve-chip-for-duration-of-tpm_tis_core_init.patch
> > > and it can be found in the queue-5.4 subdirectory.
> > >
> > > If you, or anyone else, feels it should not be added to the stable tree,
> > > please let <stable@vger.kernel.org> know about it.
> > >
> > >
> > > From 21df4a8b6018b842d4db181a8b24166006bad3cd Mon Sep 17 00:00:00 2001
> > > From: Jerry Snitselaar <jsnitsel@redhat.com>
> > > Date: Wed, 11 Dec 2019 16:54:55 -0700
> > > Subject: tpm_tis: reserve chip for duration of tpm_tis_core_init
> > >
> > > From: Jerry Snitselaar <jsnitsel@redhat.com>
> > >
> > > commit 21df4a8b6018b842d4db181a8b24166006bad3cd upstream.
> > >
> > > Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
> > > issuing commands to the tpm during initialization, just reserve the
> > > chip after wait_startup, and release it when we are ready to call
> > > tpm_chip_register.
> > >
> > > Cc: Christian Bundy <christianbundy@fraction.io>
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Cc: Peter Huewe <peterhuewe@gmx.de>
> > > Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > Cc: Jason Gunthorpe <jgg@ziepe.ca>
> > > Cc: Stefan Berger <stefanb@linux.vnet.ibm.com>
> > > Cc: stable@vger.kernel.org
> > > Cc: linux-integrity@vger.kernel.org
> > > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> > > Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
> > > Suggested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> > > Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > >
> > > ---
> > > drivers/char/tpm/tpm_tis_core.c | 35 ++++++++++++++++++-----------------
> > > 1 file changed, 18 insertions(+), 17 deletions(-)
> > >
> > > --- a/drivers/char/tpm/tpm_tis_core.c
> > > +++ b/drivers/char/tpm/tpm_tis_core.c
> > > @@ -899,13 +899,13 @@ int tpm_tis_core_init(struct device *dev
> > >
> > > if (wait_startup(chip, 0) != 0) {
> > > rc = -ENODEV;
> > > - goto out_err;
> > > + goto err_start;
> > > }
> > >
> > > /* Take control of the TPM's interrupt hardware and shut it off */
> > > rc = tpm_tis_read32(priv, TPM_INT_ENABLE(priv->locality), &intmask);
> > > if (rc < 0)
> > > - goto out_err;
> > > + goto err_start;
> > >
> > > intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
> > > TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
> > > @@ -914,21 +914,21 @@ int tpm_tis_core_init(struct device *dev
> > >
> > > rc = tpm_chip_start(chip);
> > > if (rc)
> > > - goto out_err;
> > > + goto err_start;
> > > +
> > > rc = tpm2_probe(chip);
> > > - tpm_chip_stop(chip);
> > > if (rc)
> > > - goto out_err;
> > > + goto err_probe;
> > >
> > > rc = tpm_tis_read32(priv, TPM_DID_VID(0), &vendor);
> > > if (rc < 0)
> > > - goto out_err;
> > > + goto err_probe;
> > >
> > > priv->manufacturer_id = vendor;
> > >
> > > rc = tpm_tis_read8(priv, TPM_RID(0), &rid);
> > > if (rc < 0)
> > > - goto out_err;
> > > + goto err_probe;
> > >
> > > dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
> > > (chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",
> > > @@ -937,13 +937,13 @@ int tpm_tis_core_init(struct device *dev
> > > probe = probe_itpm(chip);
> > > if (probe < 0) {
> > > rc = -ENODEV;
> > > - goto out_err;
> > > + goto err_probe;
> > > }
> > >
> > > /* Figure out the capabilities */
> > > rc = tpm_tis_read32(priv, TPM_INTF_CAPS(priv->locality), &intfcaps);
> > > if (rc < 0)
> > > - goto out_err;
> > > + goto err_probe;
> > >
> > > dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
> > > intfcaps);
> > > @@ -977,10 +977,9 @@ int tpm_tis_core_init(struct device *dev
> > > if (tpm_get_timeouts(chip)) {
> > > dev_err(dev, "Could not get TPM timeouts and durations\n");
> > > rc = -ENODEV;
> > > - goto out_err;
> > > + goto err_probe;
> > > }
> > >
> > > - tpm_chip_start(chip);
> > > chip->flags |= TPM_CHIP_FLAG_IRQ;
> > > if (irq) {
> > > tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
> > > @@ -991,18 +990,20 @@ int tpm_tis_core_init(struct device *dev
> > > } else {
> > > tpm_tis_probe_irq(chip, intmask);
> > > }
> > > - tpm_chip_stop(chip);
> > > }
> > >
> > > + tpm_chip_stop(chip);
> > > +
> > > rc = tpm_chip_register(chip);
> > > if (rc)
> > > - goto out_err;
> > > -
> > > - if (chip->ops->clk_enable != NULL)
> > > - chip->ops->clk_enable(chip, false);
> > > + goto err_start;
> > >
> > > return 0;
> > > -out_err:
> > > +
> > > +err_probe:
> > > + tpm_chip_stop(chip);
> > > +
> > > +err_start:
> > > if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL))
> > > chip->ops->clk_enable(chip, false);
> > >
> > >
> > >
> > > Patches currently in stable-queue which might be from jsnitsel@redhat.com are
> > >
> > > queue-5.4/iommu-fix-kasan-use-after-free-in-iommu_insert_resv_region.patch
> > > queue-5.4/iommu-vt-d-fix-dmar-pte-read-access-not-set-error.patch
> > > queue-5.4/iommu-set-group-default-domain-before-creating-direct-mappings.patch
> > > queue-5.4/tpm_tis-reserve-chip-for-duration-of-tpm_tis_core_init.patch
> > > queue-5.4/iommu-vt-d-allocate-reserved-region-for-isa-with-correct-permission.patch
> > > queue-5.4/iommu-vt-d-set-isa-bridge-reserved-region-as-relaxable.patch
next prev parent reply other threads:[~2019-12-27 6:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1577122577157232@kroah.com>
2019-12-23 19:46 ` Patch "tpm_tis: reserve chip for duration of tpm_tis_core_init" has been added to the 5.4-stable tree Dan Williams
2019-12-27 6:05 ` Jarkko Sakkinen
2019-12-27 6:11 ` Jarkko Sakkinen [this message]
2019-12-28 15:15 ` Jarkko Sakkinen
2019-12-28 17:17 ` Dan Williams
2019-12-30 7:41 ` Dan Williams
2019-12-30 23:28 ` Jarkko Sakkinen
2019-12-31 0:33 ` Jerry Snitselaar
2019-12-31 1:02 ` Jerry Snitselaar
2019-12-31 16:00 ` Jarkko Sakkinen
2019-12-31 19:47 ` Christian Bundy
2020-01-02 17:20 ` Jarkko Sakkinen
2020-01-02 19:20 ` Dan Williams
2020-01-03 5:04 ` Dan Williams
2020-01-03 22:20 ` Jerry Snitselaar
2020-01-03 22:55 ` Jarkko Sakkinen
2020-01-03 21:51 ` Jarkko Sakkinen
2020-01-03 20:24 ` Jerry Snitselaar
2020-01-03 22:56 ` Jarkko Sakkinen
2020-01-03 23:07 ` Jarkko Sakkinen
2020-01-03 23:30 ` Jarkko Sakkinen
2020-01-03 21:47 ` Jerry Snitselaar
2019-12-31 0:30 ` Jerry Snitselaar
2020-01-01 22:55 ` Dan Williams
2019-12-28 23:39 ` Jerry Snitselaar
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=50217a688ffa56cf5f150ffd358daba2a88cad48.camel@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=christianbundy@fraction.io \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgg@ziepe.ca \
--cc=jsnitsel@redhat.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=stable-commits@vger.kernel.org \
--cc=stefanb@linux.vnet.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).