Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3419924ybc; Thu, 14 Nov 2019 08:52:09 -0800 (PST) X-Google-Smtp-Source: APXvYqwJDZ75F/Mdza30O4zetnJlqfbtAIBV/sQyduJRU+KIQ2xb+LH4eevJuo+INAwR/z68sB3Z X-Received: by 2002:a17:907:2061:: with SMTP id qp1mr9678396ejb.43.1573750327699; Thu, 14 Nov 2019 08:52:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573750327; cv=none; d=google.com; s=arc-20160816; b=j5dKsW5UnCa5ZZdTFtgb7NvIbu3pSaEK4MnV/y+N4qUwxej6obTJVTj/mCg+Xs1CDs ouvWiVgi2ce3Olw/fZXgd0hyUUls4WCtLYOFF3PAIzfkmZTbWF/mAfz1MG9ayvWvH8K3 gjrARM9PR51QhTofoNHdAvSuwGb3WgCH8DndG633zuKON4MP2buxjz73NIamjH/b+79l 3QIyVI1do4lVxDpAzKTXmBKyDzgJQo6n6KaEayPYZEBvYFWc6PnnM4SYOLeQmB1QRBCj ATZ2mGLDyZu2VghaE9SOveO77HSZ5MaIzIT7g5xb/kvlSxws06Kr/t4cYnxYsRrX+GIW T/9A== 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=RiG5R+XF68mSjfOArXZOGA11YbZ++/OSZzMOjDqAxMI=; b=E9TpUGVhtXV8pAjindnb3PwarZ+tDk712m/GX2IKhiGFvHpie4kpg+3Yn2UXQIE1+f D1znaPhc2FZbZKvfhlglojnp5C8NXVx25ET39XigWvp9pmtcJjZJg9xiTzV6fjyv5X4c 0bpWRtYZQiKlqP47/L3DVMaiXSJxUoy3HRFd1pOEaiipb9mFBXtYSSsaKYrBz5D/Nc0c NdYvs7tEpz31EVePomEa8XZqO0x36XwEm3/9axwyfRIRtFLfZ2blwfTfEM5vaiagRgp1 GerneI0Q6OTAzY9ClXfqFM0vzRY55HpjexprTeqxF/NOj2PzqOF/b2bZIhT4wy7Hq1p7 yz5A== 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 m4si3755915ejr.90.2019.11.14.08.51.41; Thu, 14 Nov 2019 08:52:07 -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 S1727032AbfKNQt4 (ORCPT + 99 others); Thu, 14 Nov 2019 11:49:56 -0500 Received: from mga04.intel.com ([192.55.52.120]:49138 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbfKNQtz (ORCPT ); Thu, 14 Nov 2019 11:49:55 -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; 14 Nov 2019 08:49:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,304,1569308400"; d="scan'208";a="195095968" Received: from pkamlakx-mobl1.gar.corp.intel.com (HELO localhost) ([10.252.10.73]) by orsmga007.jf.intel.com with ESMTP; 14 Nov 2019 08:49:51 -0800 Date: Thu, 14 Nov 2019 18:49:49 +0200 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Jerry Snitselaar , linux-integrity , Peter Huewe , Linux List Kernel Mailing , linux-stable@vger.kernel.org, Christian Bundy Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts Message-ID: <20191114164949.GE9528@linux.intel.com> References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> <20191112202623.GB5584@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191112202623.GB5584@ziepe.ca> 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 04:26:23PM -0400, Jason Gunthorpe wrote: > On Tue, Nov 12, 2019 at 01:23:33PM -0700, Jerry Snitselaar wrote: > > On Tue, Nov 12, 2019 at 1:03 PM Jarkko Sakkinen > > wrote: > > > > > > 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 > > > > +++ 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 > > > > > > > Probably. It will eventually get called when tpm_chip_register > > happens. I don't know what the reason was for trying it prior to the > > irq probe. > > At least tis once needed the timeouts before registration because it > was issuing TPM commands to complete its setup. > > If timeouts have not been set then no TPM command should be executed. Not true since you need a TPM command to set them. That is why they have been set initially to maximum possible values. /Jarkko