Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1002637ybc; Tue, 12 Nov 2019 12:35:20 -0800 (PST) X-Google-Smtp-Source: APXvYqx1nVdRLh704SzZ70g0f/KbLuVFB5hUtBhSg5ENuf1JmCQpC/Ajyh51OXsRgRqccodDQWtV X-Received: by 2002:a05:6402:1609:: with SMTP id f9mr35815529edv.37.1573590919980; Tue, 12 Nov 2019 12:35:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573590919; cv=none; d=google.com; s=arc-20160816; b=fZygy82yqnlUOi2fpomB96C7Ch+oWfAeTLvXVxLi6UXnD12gFGwCBcPlAjjJjYyxqB 1+RWoZdyyPvOpZlTqQ5diG3ayNsq7mD5hQfgZwOUxnPEuukqQOECqlZezZB8dLNlmsfG TCmUUINZwQmrqgk4n3UGZdF0QhlQlu4B2S1IbGXB/WVbRaQVd5K1TafGzwkGDztAv1dm C1A6pP4ebTaD54MAQ4bsPn51g5az+RPwPwE1j4UbEf0P9wpcK+xbYXB7ubGHSKGBq09i GGMcem/eBOXpWAPgo4g29rmpZVc95wDHX+pXP2gmxcN9cNsDru1ZJkHKFoxxlkyCNStY ghvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=IByCdOcsK7z2wqcglE3nDgjbdw+hHaKusrjX1MWd/k0=; b=SkSP8GYLCrIKqoKiGqxIoaBvQFehwZ4NwzSd6qB52JkIi+NqLxYptqBM0qbkaKTYqz vKCM5OCWB9v0iq2UiqUYBv8jazP2LUBhdwWjLS5MMnh2siJaLh7BypuGyL43uK+yGBk5 rRYqFvGwTDJsPvl4XsTq/ypS4aMEsh6smavyX5bxQsfJt0wf/ZaoSt07Tu7XbOTyEhqr NHfbyNOoGUXWr1BoR0MoY2CX+48rDsF3UMU0kOwIKJv+fvPpVx4slX5XQ03aEJuhcvyK T85eKrWL3JfrmEXb4554UEOLgroPD8EcS+LQfK1ZRua929Eg6ki0FYGmFy/TXBUPTbcV P06g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GI4WrEWE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i26si13381883edy.197.2019.11.12.12.34.54; Tue, 12 Nov 2019 12:35:19 -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=@redhat.com header.s=mimecast20190719 header.b=GI4WrEWE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727171AbfKLUb0 (ORCPT + 99 others); Tue, 12 Nov 2019 15:31:26 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:54131 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726388AbfKLUb0 (ORCPT ); Tue, 12 Nov 2019 15:31:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573590685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IByCdOcsK7z2wqcglE3nDgjbdw+hHaKusrjX1MWd/k0=; b=GI4WrEWESI045e4WUffdSxKlM2QqkRYzcwhkogFCJWqmcHHbSQzuOFlkFMBSJ/5CgTbGvQ hY6baX5Vqi0nNY3C9m1ZXpx3IJ/6xzEezM0FpOjqx1Ls1Y2qBx84Yo6DO9YR/zJ2ARsSKB aNFrlmk9TzClZE7Vc45DUm+hBJlkDuw= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-11-esboA5dMPd2F-Yy7M9ChXA-1; Tue, 12 Nov 2019 15:31:24 -0500 Received: by mail-lf1-f72.google.com with SMTP id o140so4265929lff.18 for ; Tue, 12 Nov 2019 12:31:24 -0800 (PST) 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=aIQasmDACRm3A9ZstJoEy2oYlDFM8WAP33PBbVt6iPM=; b=YcUDP2mC5KzSwMxs3DM5cb+JJwezWesm7p36/cnB/tEa+wFjaxQabgIkRwT8FTwIrg FXYl1lwo1XVd8vBCn/9bp16a7PX9SZhCo5SESVegkAizZKojN1Zqo3QvtRTFRnGbB2eY cwPDPUtTxFriQiFU2DlOMbZTSg4pi4mrursP4JA42we3l6EhQIjVD8i/YjwcqLz1EcC4 fueniygxLnZ7AO8IWpbErLOqUgae8NGyrEHQAa72Aa86azuWssum+OdyKVK+LAQxbTJE HyC6ekFqmXY6fmJ0nzkTXTXtOZQHODpsFxsXuRSDFsJIFiSrn5U0pOkFOXS0o20I+oqP B21Q== X-Gm-Message-State: APjAAAVTGWKqvK3pMAJ6F6xexbTJ5T0FrABSs7PDqneQMVgTZrHOtXzk Xg4jDSRBiS7ehSFEhy48RkiQxh1eHbO7VNeDJ/+SJQgEN2qLG6CyZRm1CC/Yg2aTlINWNtjRZUi v1ZoTgyuZGx/AfbEPhqfnV4QWerZY26VYf6IwAvyy X-Received: by 2002:ac2:46c9:: with SMTP id p9mr19116998lfo.166.1573590680207; Tue, 12 Nov 2019 12:31:20 -0800 (PST) X-Received: by 2002:ac2:46c9:: with SMTP id p9mr19116984lfo.166.1573590680032; Tue, 12 Nov 2019 12:31:20 -0800 (PST) MIME-Version: 1.0 References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> <20191112202623.GB5584@ziepe.ca> In-Reply-To: From: Jerry Snitselaar Date: Tue, 12 Nov 2019 13:31:09 -0700 Message-ID: Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts To: Jason Gunthorpe Cc: Jarkko Sakkinen , linux-integrity , Peter Huewe , Linux List Kernel Mailing , linux-stable@vger.kernel.org, Christian Bundy X-MC-Unique: esboA5dMPd2F-Yy7M9ChXA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 1:28 PM Jerry Snitselaar wrot= e: > > On Tue, Nov 12, 2019 at 1:26 PM 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/t= pm_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, s= truct tpm_tis_data *priv, int irq, > > > > > * to make sure it works. May as well use that comm= and 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 an= d durations\n"); > > > > > rc =3D -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. > > > > Jason > > > > Would it function with the timeout values set at the beginning of > tpm_tis_core_init (max values)? I guess that doesn't set the duration values though