Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp999613ybc; Tue, 12 Nov 2019 12:32:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzn1mYdIUyR4mIU1FZ1MNTxGPukx2f2UiPQsXvNDP4f0PqEUnwSV9MLVHLWeRRJz0SrmPqn X-Received: by 2002:a50:8969:: with SMTP id f38mr34997616edf.211.1573590740645; Tue, 12 Nov 2019 12:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573590740; cv=none; d=google.com; s=arc-20160816; b=loChm41VC6dc+daGgVYS4HnxrcmqvlM192ms9ipiufCDBuQQC052E4zu+1wwSiRJuZ 3f4Gn3zwEh1KJVeu769erXeNrbpHUn9ZVvhyKwq6EnvpLiRHYPC4uGZAzjP1iaPkV5dT tVzw84gPyduh/KcrXggzVJ2/nABZZBBAJ6QHEQL+OlD0lQZvPQHmzg+FTF1eqGHBTIgZ pp/F3WZ6U8J9zq39qndcQRQEaHArkEmE/y9XpQNHkv4zCPGNZM5bBvRienQSLqEyFyFO SeD8pPUJVhOFx6J/yONK2nB3zMoLcwEdQFmDKxZY7j13xzBs6r9b9JLjdeZ7jfR/mVIa cMBg== 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=WAHHo3eYG/GlHJEoP+Cppnso1TeHYAoN/ZX4SH504bY=; b=tPv4SkpwJDMmLEIyjPh3y8pioUiHDDH6ntc5cd4L6QMTskaLg1HGO/u/NqRqlj8cTt MdaQOqnEcNTdQJi/nVDb3aG4t37TE09sZFpqEBZ74no5I/N/YvKNB8Wu849A2fqH8orP X0Aw4yk4iBD7FVBn/dABo/srfKTzu09RwB/gNxfwseJthNcVAdYraWsgQfrt2Kd44oHm 7XuNNU2klE4xX/oq8918Kb0i8uiztr78DuO8a74JFFTCw643CFOhUZOujh7qY8AyOQKf gYzbS0Lr/Hv/8GnCX7d/UR6obrCAE3AddyQVLBH1VqURfufcUx+2Rmp/g2s4hwoNfBp1 2Dmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=RGusDddQ; 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 w3si13630325edt.196.2019.11.12.12.31.54; Tue, 12 Nov 2019 12:32:20 -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=RGusDddQ; 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 S1727016AbfKLU0Z (ORCPT + 99 others); Tue, 12 Nov 2019 15:26:25 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41312 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbfKLU0Z (ORCPT ); Tue, 12 Nov 2019 15:26:25 -0500 Received: by mail-qt1-f196.google.com with SMTP id o3so21235858qtj.8 for ; Tue, 12 Nov 2019 12:26:24 -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=WAHHo3eYG/GlHJEoP+Cppnso1TeHYAoN/ZX4SH504bY=; b=RGusDddQfS3B9UAv0zCdjipMrsC5BcvYhv4a5HuXnreJeUQV7JYI9AXkF+iTNPfA6O mfNZ3aFbbmzZPc4gLTj0bMpDHKLs7ou7Y4mrJV7KqYg6T/8v3GBxNbJki1pTlQfP1RhP vL6yy2SgOmBCVWqt4oae4acbzVSIH3XhBnVQrj+VLEXD9KeqgJFJsPGCuKujM8zxFyW7 P+VJYNyeVrPPgxfE0ONH61jM12DoFvzwDTndIOKZHKqShdO12L5VsRvEeZjmkW5nv/RM nRifeoYAdtjIps4uQw0DXbQGIs6yK5YO4yrjSh+JELD9gnUemiPpFEo1LPehwJRN3jdL TRyg== 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=WAHHo3eYG/GlHJEoP+Cppnso1TeHYAoN/ZX4SH504bY=; b=YnwoQsGPBBJjzq4pCGVaoui2n2uoA0C+HYtq/BWK3QkRImOm7W8rLEA01NrqkCZ8YJ TD1BpcmTcHF7CvjtPTAcCoeRndAPHZ9OysLvNBINbrpGNysepgonwJ5YJFyqgm6pvMvm wUYXvoUOU24mq0tXAGko4nvkupeCjjI0w2Oy2VTPciqHgIOLVax3OoA5HUeeBPj1alOo ezV45tq+ZLhpBkC7iUR9lKLqS2p3ZtYXFmF/wGgeA/ytdLhvc3G7hdLmJ8pWhxDEA47K Do50EvbvVA06vxbBsatEx0DKXPqnWhQhAUUmpzxyBZ8uZ8vtF4ATShnhfzi8IAOIpVBk 5i3g== X-Gm-Message-State: APjAAAXmBT/dWn4sWgfiNtMWxHaZ0rHCLuMEf4WT9T89yhtabgX3wl58 bapNR/eKBumwbrttKL/HhXp/EA== X-Received: by 2002:ac8:6f3a:: with SMTP id i26mr5541601qtv.344.1573590384226; Tue, 12 Nov 2019 12:26: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 n185sm9341472qkd.32.2019.11.12.12.26.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Nov 2019 12:26:23 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iUck3-0003nR-76; Tue, 12 Nov 2019 16:26:23 -0400 Date: Tue, 12 Nov 2019 16:26: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: <20191112202623.GB5584@ziepe.ca> References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> 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: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. Jason