Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3421304ybc; Thu, 14 Nov 2019 08:53:39 -0800 (PST) X-Google-Smtp-Source: APXvYqySmqZl34g549u98Ek8V7U1CgVzlxWJAy3RwmZmQYFsoIedTCm6N4vk02xaKI2C/6SXIx6P X-Received: by 2002:a17:906:12d3:: with SMTP id l19mr9041913ejb.165.1573750419088; Thu, 14 Nov 2019 08:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573750419; cv=none; d=google.com; s=arc-20160816; b=JUIxvDFvG2UdBbP2rQTVE9ScQaBI3flOp1Nqc21GHcnN2kMIOJRiugFvHfDe6SVlj1 IDo8EL0yiHYeQmjPMUMnE9qiH3CKv79u8Y61tp0nuszE/OnGKGtE3Jl6eYtdd01ePw7w /5rgzNWHQcrYMWkn4b59XCKd+UQA1EDOuJakrKdk1JfZlf82Ybdsp3JmAL+ZAxMeYGNC nOhs+T6onrsJSJ5o6pSCnF/qpR1kC5WwhTjJOe6RtYlzr2Jo3mh3E7zMP9oNm60ioE8x iZJPeekYpu80YCZheae1yLNse4sTRbPX4trDzpELNlloWbn4+GxjhFdZ98+WpVnZ35Nb g6KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jo8xFnYMTbVFfmOh8S5PDP8bAHN29GV6u4PsLZMontU=; b=zkjCfucdyXmYT00vTdehiP0O9qtPUhAWLiklheGczEeodtAqaMEARJXx2ajv1KGWTB BD4O7GWi/aNmQBUszuV9rxOoyUSsGaT7mjPD6xyba0GSA6CsIkkvPHLpib3fP2FMAZ7S lbMP+hVWr50AWmQKjsMLoKNtf1whVgfn73j/P+DHHYLGSYNhkMNAZ4OgsbIwDN1vwXfU J8GjsPUnU1mNzMfpYCPLenvi4kTZtPyKy6PspyZKXK1FFVyV0hSkd1phL32XCbGp7xhG aj8npPnfa2VyXe06zoUwNYaXGy+wmaQKpwyR/o2R8jUFcagzc8zz9ibs5tEyPeK0w++p FRTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=oULrSVWc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g53si4339508edb.313.2019.11.14.08.53.13; Thu, 14 Nov 2019 08:53:39 -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=@ziepe.ca header.s=google header.b=oULrSVWc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727100AbfKNQvK (ORCPT + 99 others); Thu, 14 Nov 2019 11:51:10 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41353 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727078AbfKNQvK (ORCPT ); Thu, 14 Nov 2019 11:51:10 -0500 Received: by mail-qt1-f196.google.com with SMTP id o3so7488485qtj.8 for ; Thu, 14 Nov 2019 08:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jo8xFnYMTbVFfmOh8S5PDP8bAHN29GV6u4PsLZMontU=; b=oULrSVWcVDMACO0J599asG80XjhRY6y4we6U9wCoT3EqBCNl1W8BDuxXq+GU5gSiQz lbPGqTHymzLwl9rGfb6ec++AUuuDS7OCOyFJEjtBDi6jbubjAV4XUIY0Rl9oWnyief2/ v7exve6cUUvMBQPFruo52MQD1Tk8YxQsiRU9Yr/Jbs6brMrGfsHqlR2CG+Yt7sHiizHO yufuMPm7sNiAR7CYpiR6Cg6nEQTs/8ezGBMj1PMlgpT/eFpy8JZzbKBh6b9SesQqaGJz 9m6MlmMcFvUNwU5MnWjEne+XZp16XWhDH5o83lTMoGpzqTXej5H1kmabO5/viei5k5zA koGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jo8xFnYMTbVFfmOh8S5PDP8bAHN29GV6u4PsLZMontU=; b=W2nl3i4XJ31yMAHm8MEjCmxsXfzjzY3VuiPOAXumsqPYJB3/72xrl/zKssZUTM9GTe lTstyPK/XxWEnF6WcH5sX30+bWM70bwDnrc2rU9bQxsUJaUjOIvqFoNdyuiOIT3svnOq xxgOvVG09h1qHQs5mluNoSfYMa50HvO5kFt0eVhQfIWl4i71xRRnV7fuYSrxsfgY8aGb l7wr0hzdSH6OsM+pZKZjYCOgY5HO5U5UGaYzFKhgz9iFIvWnkS93KwZPg+ods1Pj3Pcv 5SX9mKQFJBwW8D7hB4mnEpEqTwFeW+tzSdnqCwYO8ihrBA2WESFqXRDkdG4iPkLgFn/g HmsA== X-Gm-Message-State: APjAAAVtHv8DXpP3y8TmUMy7SlNKAD+D8We50zKPUSZrb/dQvmUD9O4l 7w6ciVEqBRzNVlOERj/kJ522xmYT7dQ= X-Received: by 2002:ac8:4899:: with SMTP id i25mr9005507qtq.207.1573750268724; Thu, 14 Nov 2019 08:51:08 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-113-180.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.180]) by smtp.gmail.com with ESMTPSA id c195sm2842066qkg.6.2019.11.14.08.51.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2019 08:51:08 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iVIKp-00040W-Sj; Thu, 14 Nov 2019 12:51:07 -0400 Date: Thu, 14 Nov 2019 12:51:07 -0400 From: Jason Gunthorpe To: Jarkko Sakkinen 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: <20191114165107.GB26068@ziepe.ca> References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> <20191112202623.GB5584@ziepe.ca> <20191114164949.GE9528@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191114164949.GE9528@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 14, 2019 at 06:49:49PM +0200, Jarkko Sakkinen wrote: > 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. getting timeouts is the exception Jason