Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6780622ybl; Mon, 23 Dec 2019 11:47:56 -0800 (PST) X-Google-Smtp-Source: APXvYqw88A82gFw1WlrG5yj38/IryZba6sylPi2MUskAhOq0mA6Q9G46t/rkDgrTGWybcnYOyuCS X-Received: by 2002:a9d:7dc9:: with SMTP id k9mr34251393otn.117.1577130476329; Mon, 23 Dec 2019 11:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577130476; cv=none; d=google.com; s=arc-20160816; b=CuhAjiRfhchWvVLsYwadhUIH5K4tAZTSO69uDsnImbL0dAI/Ldnae78eIOs6QhepzV NSHxYtRmVL/ZybKAwW2rMRNADu8/1P+RI5IoyjZnsq4fk+p3pOD79Q+CBNQwBQJaZT5W d+3l8c9SnMvHHZsupgzSBmkUClqyxfCWwk9V49ZwxOjEwD4Z87O/KJabz98fDKvsbZXg 1k0b/5G0yMv7Fa8yfRBksH+O2yPD9HzL4lEXW/qurb98x5j1u2OM3/LKKSyVNSXcUAja 6fvDc4x57XgKnK+1ThH4wc7L7s2VuGmzBX/sdYUGcT28Jo/0/OMID4oIrSEsQqtMh1zP D5KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zFugXbNXjuTa6MUeYElsmTqLleXZtVtXWa7qU/dvhHs=; b=Gh1bORafTmZSgXRWFkl2KJgBsEVIcAhrMuQkew+9W52iCIbPVXdVownMiq/15RR0eo P8FHIsazBrdtMEo0qABkCOVVSpMUrA7O7j3Piwrd3cJ6RhwpktX4pV1jVXmZ/D/8L0Rw ZAZhzAwGSIe6rwLbJGIB0qCRT6oe8csBDc/wtTn4sM4O/lSqGoPacDsv+uaAgIuqsp/E iwvt2DXvPLfgkundTWDbLGNqj7EMg4JNKIRSRWLGV1nlfoE5LIlAU49ayCAa9PBvBQTs t/wYusPrth+gQwpTFC+ym9yEVTARUCB9aKnrsan49GyBOl8DOUJnoS84Rd0OC7x/DOyx qkbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=SN8HwSqp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si7516706otj.115.2019.12.23.11.47.43; Mon, 23 Dec 2019 11:47:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=SN8HwSqp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbfLWTrF (ORCPT + 99 others); Mon, 23 Dec 2019 14:47:05 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46875 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbfLWTrF (ORCPT ); Mon, 23 Dec 2019 14:47:05 -0500 Received: by mail-ot1-f66.google.com with SMTP id k8so6192051otl.13 for ; Mon, 23 Dec 2019 11:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zFugXbNXjuTa6MUeYElsmTqLleXZtVtXWa7qU/dvhHs=; b=SN8HwSqpq/VHn71r5rosiHbn3JAeoPbdRMlzYznGgDelpBcJ1uXQQzmcNQGLuoDJ/J DjgfzxVK2KrWxwM6Nhh7rwPitEWDF7dj3Q2VmEkNvKkPv58eyB81CCoHm5gHxvdSVaid IfACfR9Yy7bHPA9K1sNnL5ARUsWrgVcBrLGMjvXZHpucgPrCh8yEZOvHXMT/LAcMMLJY p9/6yDTWTNTnKmdfzt/aW0+jrLe5cT/AMPpBErNLjj3QA36jNpu/yn1vIUv5aCGLLqz1 tGnpyDsiEw2aGsyzGL34leDVlBBvSp1A0Rvm9LaKcTEJPaoYXKHi0KETPdbHkzs+i8RJ XE4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zFugXbNXjuTa6MUeYElsmTqLleXZtVtXWa7qU/dvhHs=; b=sr9g6pnV2CAPx8VWLhvoKmYTDENJgJSf9asztCJ+JUO+87i9s8FjQC8H+09zm0vLNV xHpnxAQsdkKvMZuR7QEssrPYT7ZyDGzyNZcTeyrFrBdhJ9KFShDX9rcAADHedBfuv+Ix uvlVreZKr086eEH+TLcFxox/VH7gO2AwPL/fUORaTT5v0m0dLPkPvTiRtoRDtUUc0wVT FjwmZMwqjPaKnLh6ruN5adgouG7Lu0jT89L4B54h7gcRx0bR+mSvNisKbVJaDIxh8jUN MGj3AYhFbAnHckAt0Rd9pU0QhyppHM0FJLsDXS2enVN+0orpENZQVDa2AG+cNO+vwi+w /Seg== X-Gm-Message-State: APjAAAXT8j3+U8GJIQ6ILTvOiiDV7LgMMNGb7A8bYZtqcsJ/IQqwhv9t dTFko0Rh5yiHVpTA12yTfk18kXh0immLNC6c5Ye9nA== X-Received: by 2002:a9d:7852:: with SMTP id c18mr28016742otm.247.1577130424187; Mon, 23 Dec 2019 11:47:04 -0800 (PST) MIME-Version: 1.0 References: <1577122577157232@kroah.com> In-Reply-To: <1577122577157232@kroah.com> From: Dan Williams Date: Mon, 23 Dec 2019 11:46:53 -0800 Message-ID: Subject: Re: Patch "tpm_tis: reserve chip for duration of tpm_tis_core_init" has been added to the 5.4-stable tree To: Greg KH Cc: Christian Bundy , Jarkko Sakkinen , Jason Gunthorpe , Jerry Snitselaar , Peter Huewe , Stefan Berger , stable-commits@vger.kernel.org, linux-integrity@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 know about it. > > > From 21df4a8b6018b842d4db181a8b24166006bad3cd Mon Sep 17 00:00:00 2001 > From: Jerry Snitselaar > Date: Wed, 11 Dec 2019 16:54:55 -0700 > Subject: tpm_tis: reserve chip for duration of tpm_tis_core_init > > From: Jerry Snitselaar > > 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 > Cc: Dan Williams > Cc: Peter Huewe > Cc: Jarkko Sakkinen > Cc: Jason Gunthorpe > Cc: Stefan Berger > 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 > Reviewed-by: Jarkko Sakkinen > Signed-off-by: Jerry Snitselaar > Signed-off-by: Jarkko Sakkinen > Signed-off-by: Greg Kroah-Hartman > > --- > 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