Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp992381ybc; Tue, 12 Nov 2019 12:24:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwp9XuULoiEt/bA4we73aVrQoGz1YAOP75Iys/WBIyqkIergWzbTOnoGcN/k3cp0Ez2GIip X-Received: by 2002:a17:906:69d7:: with SMTP id g23mr3748262ejs.20.1573590298458; Tue, 12 Nov 2019 12:24:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573590298; cv=none; d=google.com; s=arc-20160816; b=MHMS0v0Ji/6DIv4DJE4QaG4tw3seDnedvAAnSRfHsa/bsLOKyUKTKbbxB5bABfRIK8 06e+Nh2r5dZgbjEC03KRJRDSjYuxbVG9qv3OpP/IXZfn6hC4pIBxCi2dTHAOkQIO2mYY AZQe629rDu898DejOAcgt1y+/Oqt+5Es+spYiqbSfT1F5ZDgIZmlcVwt3dT3F3SdTGW+ oJN75xLmenWi+FFDPoHVgpBkTUtlGAHQ7Un01K7/WV2Ak23PXDeDQuXmRYhbNTaS+4Kc GL3fJaquADk0qxUMpXdU9o3LaIJWsjyXW0scLFRQAgkfaWUEXYy96BKbjLq5iYDObOmp cKtw== 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=Sm43xd3IY5NxuGzENfU8epGVEGD0EhdYpwWq9AmG1kA=; b=MtXIvMsWn+dTjEhCEi+JmKtRDoeym8SWcrvsneJeeKg+WHOXiYYBDeasCnh8G0JEan aKWMKwKfpgDzCGg0VGlLREgsAUI0EPfRVp8pXb9Xc7qbcajxDrOZd785ARkEKLy3KPkA VVIArNDXdCSl2l3zQg02PBNO0V/7chzXhodNgHciVW2JfbTQ2HZ4Eyt8XXPeD7MJU4OP w9LT2mjPXoqj41SZoVbDLvtXMTgqeiIoYUdF99p7xMvTeR7lcC0bVZDeuQ/kZ9GdS2gE SQGhx9x87MeSe3UmGVvGIZXwcLrr0zalgwblZyzk1lXKMx+OLy7cAXJq3CzcyxBGTUQo kkyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Fzof296u; 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 c5si13767063edc.246.2019.11.12.12.24.30; Tue, 12 Nov 2019 12:24:58 -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=Fzof296u; 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 S1727068AbfKLUXt (ORCPT + 99 others); Tue, 12 Nov 2019 15:23:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:33333 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726958AbfKLUXt (ORCPT ); Tue, 12 Nov 2019 15:23:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573590227; 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=Sm43xd3IY5NxuGzENfU8epGVEGD0EhdYpwWq9AmG1kA=; b=Fzof296uzmrX4BgVeOli5nlhN57qwHjj2D6J1mVp0BBhAL7xrqzkkgCU/YMrW7d58Jrrgo ubs6/T23aX+nncShtn+wUSt+xuU6hdbTXcgmq1eULNdFK4x7PyRZBgwFl/BULwW8w0J+UJ dFgDU9QZDza6MiPEExzEMHk3EwU6gAg= 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-354-rk25ek6dO-eJ95mIE69tGA-1; Tue, 12 Nov 2019 15:23:46 -0500 Received: by mail-lf1-f72.google.com with SMTP id x16so2595940lfe.19 for ; Tue, 12 Nov 2019 12:23:46 -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=huJzdqzI4XckJ8CuRctDocKEGaMJEuuYIpFJxV00rWg=; b=jypkGjkZgv0agP9o4gObfh5JKxD1bFNp9+aeQ1E8jqV/uf08XVULSx9wSWd4JCJ2zJ 8hBaaBgrByuM1kHSOQsx6ceYoUW/vNvSexjjlKnWHTAqmwV/yayFL5ohjY/KfWxf8q6H d4H5kMo2P3mbeRNtX2LrkmJr5DVkIjRiMcc3G7hypMPBTA2XaT8S8Kz1S5bQUb4fFidk zxrxuLISODUJk7wRYDCivncjdxdyNlD2jbQqv3mfuenx/uHZqfZiuAb4ypbxotoS2XIL 9Iz6ridsujdqEtHLMHntvusRhP8H6oDFdcyGZqbZmVkck1F4TsxDwvM+EFHWAtI5JvTF PJgw== X-Gm-Message-State: APjAAAWY/RqERZhOxDv0eR9IUgYB/WPHHcQyXYYTc2ilBzvkl3BAYxEv eSjIag+Hc8ILRXTlX3aC3qYMm2nKNYDNepU2Q0Gqau9A2H3OdO924WBaiuSX+eqhJc0aX3hM36q Scw7t32VoigXqSpaHrgpu5GhcWteVH8brbIHdV2TE X-Received: by 2002:a2e:5c09:: with SMTP id q9mr20823217ljb.22.1573590225083; Tue, 12 Nov 2019 12:23:45 -0800 (PST) X-Received: by 2002:a2e:5c09:: with SMTP id q9mr20823200ljb.22.1573590224814; Tue, 12 Nov 2019 12:23:44 -0800 (PST) MIME-Version: 1.0 References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> In-Reply-To: <20191112200328.GA11213@linux.intel.com> From: Jerry Snitselaar Date: Tue, 12 Nov 2019 13:23:33 -0700 Message-ID: Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts To: Jarkko Sakkinen Cc: linux-integrity , Peter Huewe , Jason Gunthorpe , Linux List Kernel Mailing , linux-stable@vger.kernel.org, Christian Bundy X-MC-Unique: rk25ek6dO-eJ95mIE69tGA-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: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_transm= it()") > > 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 > > --- a/drivers/char/tpm/tpm_tis_core.c > > +++ 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 dura= tions\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.