Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3432820ybc; Thu, 14 Nov 2019 09:03:28 -0800 (PST) X-Google-Smtp-Source: APXvYqypBPuW/pfKCxCAPsUPRGcrPkc0KkXsQIAp04z7bcyv+ON3OqpOq5SsC7Mfs6Zvk7R0nG5/ X-Received: by 2002:a17:906:9417:: with SMTP id q23mr9609367ejx.37.1573751008445; Thu, 14 Nov 2019 09:03:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573751008; cv=none; d=google.com; s=arc-20160816; b=z2YMfJGR7HaaEA1uOPSBaLl504e1tqrDe8Gp8cYpNSuI3ifTrAyLnoeOCs8wUgONif zMiADQPftkLNbx786uOpjz4Q5w0VYDpSxLSDfKpKYSWGDLjOICq+NgUHtTfYk03Nj0Jt cvSbDbifH0233sld7qz6fbRI2+EiACcUpioPAdPwDznBE5Sx9PzQUiu94nCu6HWbG2I1 BXqvYjsJxhp7CBVjjMCejcHU4A6sUzEv59bkz/xlxb/+y5bntw+xrpEa0DJEM1IWHBjf ct9t58oLa852Et4LxXJyeyZIYjqc4a0JzqslJTYNpIN5ERvJnz4icOM1V6Zoq1v+gdkt 60gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=uaS842W5rVEWAa+pWl+yxnQIU7TA3Iucc3Bh6ixl3nA=; b=QI7PXspG1YZQSOV4tf+TYNNPLoPX7V1Xq2K3QhR3/GyvIWeA9QbwpKXfH0Pmb9arcq VZQay3bqU5Ei2KXNqfVdSlLAhhh3yELeCJaih7PGgtMu2vH/qHCHvZXMTKQhU5xxdMGC VtWIwIsNUbD3+ihJOPIylqXYBcGqp30EcwMOCDdeD0wCNlRGDfQ7xHHQiHTXhT3ob1UC Rjk/+fpkqAP2bw+xRPaYhLcwTizBVtgXbaqRb1R7aZKecVQJJts31GqCLzY3UkjkVScD Q85X1kmjeuazOolf2WFwVgja4RXbV4OX+hRWlPj+DLYvYR4gUoWLdbwEbNICt+s+mXg9 NbLA== ARC-Authentication-Results: i=1; mx.google.com; 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 l20si3925272ejx.389.2019.11.14.09.03.00; Thu, 14 Nov 2019 09:03:28 -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; 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 S1726755AbfKNQ7d (ORCPT + 99 others); Thu, 14 Nov 2019 11:59:33 -0500 Received: from mga02.intel.com ([134.134.136.20]:8587 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726516AbfKNQ7d (ORCPT ); Thu, 14 Nov 2019 11:59:33 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2019 08:59:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,304,1569308400"; d="scan'208";a="235745047" Received: from pkamlakx-mobl1.gar.corp.intel.com (HELO localhost) ([10.252.10.73]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2019 08:59:28 -0800 Date: Thu, 14 Nov 2019 18:59:27 +0200 From: Jarkko Sakkinen To: Jerry Snitselaar Cc: linux-integrity@vger.kernel.org, Peter Huewe , Jason Gunthorpe , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Christian Bundy Subject: Re: [PATCH v3] tpm_tis: turn on TPM before calling tpm_get_timeouts Message-ID: <20191114165927.GB11107@linux.intel.com> References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191113000243.16611-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113000243.16611-1-jsnitsel@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 12, 2019 at 05:02:43PM -0700, Jerry Snitselaar wrote: > With power gating moved out of the tpm_transmit code we need > to power on the TPM prior to calling tpm_get_timeouts. > > Cc: Jarkko Sakkinen > Cc: Peter Huewe > Cc: Jason Gunthorpe > Cc: linux-kernel@vger.kernel.org > Cc: stable@vger.kernel.org > Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()") > Reported-by: Christian Bundy > Signed-off-by: Jerry Snitselaar > --- > v3: call tpm_chip_stop in error path > v2: fix stable cc to correct address > > drivers/char/tpm/tpm_tis_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c > index 270f43acbb77..806acc666696 100644 > --- a/drivers/char/tpm/tpm_tis_core.c > +++ b/drivers/char/tpm/tpm_tis_core.c > @@ -974,13 +974,14 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, > * to make sure it works. May as well use that command to set the > * proper timeouts for the driver. > */ > + tpm_chip_start(chip); > if (tpm_get_timeouts(chip)) { > dev_err(dev, "Could not get TPM timeouts and durations\n"); > rc = -ENODEV; > + tpm_chip_stop(chip); > goto out_err; > } > > - tpm_chip_start(chip); As the commit describes the call is not there for any other reason than pinging the TPM. /Jarkko