Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp974781ybc; Tue, 12 Nov 2019 12:07:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwJbBhXo6Nj1LUguDUKuamizE5kMHFiDn7dGKc2bYMk74YTT4HJ9BUXcOqroXBK+25JBOF5 X-Received: by 2002:a17:906:1604:: with SMTP id m4mr30549045ejd.124.1573589271629; Tue, 12 Nov 2019 12:07:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573589271; cv=none; d=google.com; s=arc-20160816; b=Z+1nrjHlKtPN2WzQRJQSNcH4aT3OwXv8Fd2bn+Sa+WvGYgKybORwLHYraUjWwGya6C O8t0T/ZdYBHKzbCPInX/HxK0RLVlyjg1Edi63pQxIm8L0EeAFtbOpjrk0NAQNyznRzHd czlW71knoYfnWO/DfpX+k+WhC6R1Op6atNk7M4UUbuz63T/Gp23AOs7wjYVVIqORmoG6 v1caSv0OV83TD8eStSLSrcIpGUdUOFAbQycDeA6A5yS/+glm12POBdFXChVfjTjFnq3k nLIDjkig74tBFGq3pXKqTVxvXbs0mSxG/UUoZ1uuT0A979Usc5BXanQxeMsd5FgK+JMv QloA== 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=LYg4arILEqXQnq3Zo70mo0euTSlFDls6R+Cxx6eXtvI=; b=vMOL4rp53AiQwVfwtoPVZLwnw1lM01T+5a8kniDFQbIBPmtMXwsrMhUKzUcmIH6hXV 9RwmO/HXbhrbuNAHgc+3oEr9FK7LzR48oFbYef8xf8hnEY5vyZ2nqWe0TFlTGOVaE5IN sypmazT/vbmnjo2F30SGOJKe89MlN7Lt+E5Lf8FqkVq9mKV+Z93r4RCHEy0dtndk1Egf eSG+bbaA9FdaB4xQ+kpz/2Qo2EXubxyUZopHMLE9Z7Lj+M0x75v7Zqrsfq1ODPsegBEq 2OnbYrocAkAoQkruCdz+K8R6VaGR6sJTgei5efh1/OketnnUYC/CoZvSvJvki10Jyzt1 tWnw== 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 q17si15164852edc.6.2019.11.12.12.07.26; Tue, 12 Nov 2019 12:07:51 -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 S1727145AbfKLUDr (ORCPT + 99 others); Tue, 12 Nov 2019 15:03:47 -0500 Received: from mga04.intel.com ([192.55.52.120]:12524 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbfKLUDq (ORCPT ); Tue, 12 Nov 2019 15:03:46 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2019 12:03:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,297,1569308400"; d="scan'208";a="194436912" Received: from joshbuck-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.20.68]) by orsmga007.jf.intel.com with ESMTP; 12 Nov 2019 12:03:41 -0800 Date: Tue, 12 Nov 2019 22:03:40 +0200 From: Jarkko Sakkinen To: Jerry Snitselaar Cc: linux-integrity@vger.kernel.org, Peter Huewe , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-stable@vger.kernel.org, Christian Bundy Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts Message-ID: <20191112200328.GA11213@linux.intel.com> References: <20191111233418.17676-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191111233418.17676-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 Mon, Nov 11, 2019 at 04:34:18PM -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: linux-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 > --- > 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..cb101cec8f8b 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_stop_chip(chip); > goto out_err; > } Couldn't this call just be removed? /Jarkko