Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1015898ybc; Tue, 12 Nov 2019 12:50:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxWFbcO3VVRqupq9NU4VDLK0CakJI0xuF0wlJmLz4I3vADgQFeJvREMkcXHyctU3sihLZK1 X-Received: by 2002:a50:cb8a:: with SMTP id k10mr35029046edi.21.1573591830910; Tue, 12 Nov 2019 12:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573591830; cv=none; d=google.com; s=arc-20160816; b=jSHtlOrjNPqSnU7UuKrDN9p9JUu/7H/QSTSdcWm/Hf+JwNJQYMvTlAKP91/sxFncr+ cLZvJh4rTBgqeSdrasp1bHymbikjrrGNc+hTzrMkBWJMgSZWKN9zqjRo9cOFoPTKnuWm q/uwZs1VAEN7qeFxbIcJh0BeQ1/xyr1Na2jVgky1/RHSo0Be7ir+MSwROx54DrorpavO HTtos3XOHQRi51r8I2ewmqmm1WfgxS99CGzazVPO1RhvlQ+seZCYvIcZVSDxMLNnY636 XL9YjzN5GiylmeavoqIr5Wj6ulj1R9Miy7eDPOPXbYQz3UFLpgbx6o9v518Evth/gI5k 9oSA== 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=rzHHOT8VNkB3teikkpEIDHOWIVsD71DDKshVr+6Wg6Y=; b=VfKml3q0gZ060u8gwsMkDOlKvkoskRr5vlUm4eWvfgBJMJLhltDcyI9x6443ftGgH6 8SWXdwkeeDssaFZp1TQdyjsdOu8jNy5Fv7WO72SwJbEoK+ieHJKKKWKXhEvYfIFuulaq Jm9NpSc/ly6x3piapU5+IIH53uQwyl0tTqvJDeJTU4NfGW2M1hVZQgZWd5dF15LqeVw9 6tJKzD3I334momlKDCNeaudtRdm3+BrTH+lvg/mqeCBLJET2+BbJzBEapHANbrZYyKl0 lGiA8WYB6fld/3SM7mPLNttilXJASyfV20dfGnNmxJ8PxrcugLglxTIyZ53C8CyiHVgx eYbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=dafqzq5Z; 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 s28si15782561edc.98.2019.11.12.12.50.06; Tue, 12 Nov 2019 12:50:30 -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=dafqzq5Z; 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 S1727210AbfKLUq0 (ORCPT + 99 others); Tue, 12 Nov 2019 15:46:26 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:41782 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727128AbfKLUqZ (ORCPT ); Tue, 12 Nov 2019 15:46:25 -0500 Received: by mail-qt1-f195.google.com with SMTP id o3so21300758qtj.8 for ; Tue, 12 Nov 2019 12:46:25 -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=rzHHOT8VNkB3teikkpEIDHOWIVsD71DDKshVr+6Wg6Y=; b=dafqzq5ZAhwpdHpgdCsK7uyR2oEr6i+jGOh0QYY/fg3j5I1eKWfvsetqQZmYecttLb SO6xKy1ezGdTWeA2R5G4nbaMICzxMDGXrTL6ivBIU7uygDRNtWYZmyXHDslA4jI0RejP q+ekouZqwL2ldOHsxtzydpyr5iUkbwTFp+dnXHlQ4xrw3oPHJdmyvDNQW/W7xIGs2nhE 3gd0y/fviYykTVNq1u9szcSPiUBVsg9wBai5pJFT1oDUWgm4Vfe2WFZ2V7+TSEW80JxU Pk3v+OR021ZkdvUcMJPCiL71ZI+8t61hl+kjPI2koa/xQZhrsWyOUJ6ihtHVI9dL4dXM G/tg== 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=rzHHOT8VNkB3teikkpEIDHOWIVsD71DDKshVr+6Wg6Y=; b=gi5lWGb9w6qpsBbPuzaAsS+eJ4ZeKYiruf2TdMw7ppEEOlfRu9cCy1d0l5zeVE+dCW 9PYnpYKOjibRQV1eBiiyxnf2gUGLBDWSI9g1QKfntZbaO5/gfsUkYWAfE3ohLg2BrkxN qev0xA6yBy+8A46QljMQkftY44QQfdIokwSFyLTBiPjB92lSpbmyjCb6MmofOpVre8uh w5N22A10b8GR5U+WdjatjDI5kWloJ5OyPPBwAHLiuR9+5xJCRGLe+4pwimTMNjQinm94 Ka38BwUAOR1iGWov18eaMJwu1UDhA/79df4NBl1VmAhFYWbAx3g/qiaHgKfCP+/PBOFD 8Z9A== X-Gm-Message-State: APjAAAXWlQPwGaCgQPYDUFHg6rCy4kmw11oAI9anV4BWgjmwqLkqBduk +EHRjh3fdWnhkxbB3gJCDnxccA== X-Received: by 2002:ac8:f35:: with SMTP id e50mr33743966qtk.39.1573591584583; Tue, 12 Nov 2019 12:46:24 -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 a18sm10271505qkc.2.2019.11.12.12.46.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 12:46:24 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iUd3P-00048C-Md; Tue, 12 Nov 2019 16:46:23 -0400 Date: Tue, 12 Nov 2019 16:46:23 -0400 From: Jason Gunthorpe To: Jerry Snitselaar Cc: Jarkko Sakkinen , 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: <20191112204623.GG5584@ziepe.ca> 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: 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 Tue, Nov 12, 2019 at 01:31:09PM -0700, Jerry Snitselaar wrote: > On Tue, Nov 12, 2019 at 1:28 PM Jerry Snitselaar wrote: > > > > 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/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. > > > > 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 There is no reason to use anything but the correct timeouts, as read from the device. Jason