Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp999798ybc; Tue, 12 Nov 2019 12:32:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx+dRujZq0uzZkjczTOPtGQlD4fN/3OMrsDQr+Gv8WFy74m9rTaw+L6+hZ/0gwrSaA5Dp0g X-Received: by 2002:a17:906:53c7:: with SMTP id p7mr29654444ejo.88.1573590750712; Tue, 12 Nov 2019 12:32:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573590750; cv=none; d=google.com; s=arc-20160816; b=Him/mkKrjTEl5YgyKKSk9rn/ZPbuhf8OcdrigdRmJuDEbdi6GEpyErhemf6OWzROAS FJTuw8JQcXVELFUlDY6FkgmFWZiLi26Y8IH4HfIcKsbC++hLOtppDY9oultlgRb+aV/F vsfMAPfXjbL8GxQKGbZ0ef9Y7IRAK1zSfrMY7JXBVCSVcHTCcy80eMCHDK0X/GNeuekB amk0nIflrm5Y/SiwsI2Z3UB7z44BB7trxbsjyTM1Zp6nUkukjXrVnKxyBC06JPRUh2Dz 9IDf23JW7QbaIZ1bU2RvQMGmq9o0P7FAoT62NU821Avzp5cviZzkqQkSOREMyp6DXMYW USwg== 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=gFJkukgipNbKWN+ICsYni15SDtbEI/aVJQySVn2TvCo=; b=kzmwkx5bSyG54HWEqSgx8G6EXWv186GtwMUDBu2idQRGlvzZVEqPVjPJglSwc1v3FZ +pksKxuWkzA5xM5H9HezCd16DRxBsokhCYhQ3xaYmzH7We7fdioZvlYKLBAG6eykX9Ou VujpzXzfAeNSGyLSk0HQ2FIvCOu8T79wNj9b77aH+q3pTCer8EaftLSnsYcLA2rc1REJ YLwpAZj3LVWrjTHdFkjPGIQ5GqRHQiuW/poKZ0FKzRHvd8WBBY49vpaI/UtEaVGItdg+ GvoyX+dMniseA8TlXRGf7zklq8T946MopBCsT3lkWYP1C845NtyHhYZ+Dg0KE8BhBeCw /DeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dVUe26Z0; 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 os28si791710ejb.53.2019.11.12.12.32.05; Tue, 12 Nov 2019 12:32: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=@redhat.com header.s=mimecast20190719 header.b=dVUe26Z0; 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 S1726980AbfKLU3E (ORCPT + 99 others); Tue, 12 Nov 2019 15:29:04 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:20475 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726388AbfKLU3E (ORCPT ); Tue, 12 Nov 2019 15:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573590542; 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=gFJkukgipNbKWN+ICsYni15SDtbEI/aVJQySVn2TvCo=; b=dVUe26Z0y5fFsgjXw6qr2XIfCun4xJbSQ2OAH2/q2/TObWj92CGwodofBK30jriz95a27D fyOS0uBwu2BdpGE/vV6jMF11+9ecVFI6K7g/rejf1FND0st/lI72FHfhcltqg3Q1sJTxsT pRlocFAbeqZ6OHJg4vB9BEy8ow5BG6Q= 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-338-C909gJKVP_yx8nUfnGdVxg-1; Tue, 12 Nov 2019 15:29:01 -0500 Received: by mail-lf1-f72.google.com with SMTP id i25so2754103lfo.4 for ; Tue, 12 Nov 2019 12:29:01 -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=QhteZ3MuQobJDpOEwpP4Wab9K3xVn23HLOglEOIOc04=; b=JpjUXfAN9CPNmqSmWpilgeUKHspOiUFaUrAFkcf3iORd9EJyhIeXOUBRxTs9wZSGyu d9odlrWcJ+MRnmkFhs/C5k6ub6uow6t9D2vNc5iPWqgVD2ZSjA/14mqL6U7Yr3GJphm6 UQI28AfM43H3KPqR13Tl6te3+QoGgSIkq/QARPhUeXD6/Ol5GUb6uSr+exqV4YxOTO2t qYcEM1uo3yeOAbJNBIU7eo2WnwUzfRzfZPn4ZyrAF+ebI5iPzQu5/Nf4LJdQOcIcR3Qc vHCs0rzk2i//y3tOF+ObHQ4PjtOmk4hpW4gxtzoDxUPgJrptKSi/FrFC7z44RA40/j00 p+NQ== X-Gm-Message-State: APjAAAXyChyjv7radAAIBY3rW+X9VrKm7IspFAWRYxDbxQ2EGCEF5V0q f8hduNAoq08R+Ko03SuOvTAWJr3UQSOfm4wYZqb+uvppMvqhS8QIgDYD0EnR2PSQEoESuI+crBl NOXHOCoKf2bwn4HpABTfSPMnTv7nDxBx88M1q8yY1 X-Received: by 2002:a2e:9a55:: with SMTP id k21mr19244262ljj.85.1573590540215; Tue, 12 Nov 2019 12:29:00 -0800 (PST) X-Received: by 2002:a2e:9a55:: with SMTP id k21mr19244251ljj.85.1573590540042; Tue, 12 Nov 2019 12:29:00 -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: <20191112202623.GB5584@ziepe.ca> From: Jerry Snitselaar Date: Tue, 12 Nov 2019 13:28:49 -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: C909gJKVP_yx8nUfnGdVxg-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: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_tr= ansmit()") > > > > 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, str= uct tpm_tis_data *priv, int irq, > > > > * to make sure it works. May as well use that comman= d 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 =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)?