Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1185175ybc; Tue, 12 Nov 2019 16:04:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzAaKX2dMm81Zlzfg3fbbxnILCU02g+3T7+V3znruEq5daCk9nnApG4l3Hxn00lpZEc/57V X-Received: by 2002:a05:6402:12ca:: with SMTP id k10mr441738edx.255.1573603478239; Tue, 12 Nov 2019 16:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573603478; cv=none; d=google.com; s=arc-20160816; b=xQzRhHvoUSxFIHnE7tCnp4A213Js1jJlq/K6iDW/mNDZiVDXdWmQXep3xZ29XH+Ffh zDFlvUOwGky+y76Yc+USnHXPYXIRD0K+Qq/d9ADDNrCojz+lV0Dnm+nUojELBGaKjf2c wjpEimLL91akLx/L0F8ROnoYqihN98FglHz/qWsxaT4xxoPyBr5hD5euuql3vZ3Ww5Ab tNeNuexF1RdXfq+xzywgHYWCFRuoS21ouHJ/9sEBnLU923KVlXnMAI2JSFLlB/DJevs5 Sv/Tp9t7qqcFfOpQyc74ss2P9BNpidca4uEqzdxnKszVQ1hGaW0pI7YOl51gmmjmO6Ml 2fvA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mFZNYzU4aq8T7KuOOh7683mZkvSGsdedXb2PwJoCtQ4=; b=CSyDvHNk/PGEcFEBK4A3fSvKUpRSjBM9tBrCgfqU+833s0BS9I39r/ESt1qAus26wt pDhIkV1FF6iTlRA7h+eNos2e7SlrFROF7ndwOupqtPcfMzIJDjc2CU9RGPr/gn34c5HF SVlOSt0tKZ1+mntZmFEFkSmkPbMjoUNANzr9KhmtQd/NPTFRgrLQTubYdpRA1MD28BiL 4SZtDXM0s3iZmULrS7GeneVeTwoGgQxkk2uVE64lSSMrO61Xildg1HS9FhdsQfe4w2gF W4waWwVgmU22FieXN33XIPm365frnVkCLbMg+nFtqPQCK2/pl4OZ9HwoBM/Rc6CrTGsq dkJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LwD23Nvn; 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 a30si126475eda.259.2019.11.12.16.04.13; Tue, 12 Nov 2019 16:04:38 -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=LwD23Nvn; 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 S1727097AbfKMACt (ORCPT + 99 others); Tue, 12 Nov 2019 19:02:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54288 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726923AbfKMACt (ORCPT ); Tue, 12 Nov 2019 19:02:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573603368; 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=mFZNYzU4aq8T7KuOOh7683mZkvSGsdedXb2PwJoCtQ4=; b=LwD23NvnG+Lmyq1AXSYQe28KMn5vIDePVlz6QJaw1vl2gNZaHB/tlPZ3ZTu05knWns8GL6 veuzD0CmPDGizWIUbCU5y8Nd4mXysdbI8VD2rOK4H67bNHW+202LTJt9JxBESVaNGWq+w7 gT8JdYqTl23YKbsPeVQ6DtL16Pe9Iok= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-5EKU7PrLP_mDMrmo4DPU2w-1; Tue, 12 Nov 2019 19:02:47 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C42CA800EB3; Wed, 13 Nov 2019 00:02:45 +0000 (UTC) Received: from cantor.redhat.com (ovpn-116-198.phx2.redhat.com [10.3.116.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 401CE64020; Wed, 13 Nov 2019 00:02:45 +0000 (UTC) From: Jerry Snitselaar To: linux-integrity@vger.kernel.org Cc: Jerry Snitselaar , Jarkko Sakkinen , Peter Huewe , Jason Gunthorpe , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Christian Bundy Subject: [PATCH v3] tpm_tis: turn on TPM before calling tpm_get_timeouts Date: Tue, 12 Nov 2019 17:02:43 -0700 Message-Id: <20191113000243.16611-1-jsnitsel@redhat.com> In-Reply-To: <20191111233418.17676-1-jsnitsel@redhat.com> References: <20191111233418.17676-1-jsnitsel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 5EKU7PrLP_mDMrmo4DPU2w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 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 --- v3: call tpm_chip_stop in error path v2: fix stable cc to correct address 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_cor= e.c index 270f43acbb77..806acc666696 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, =09=09 * to make sure it works. May as well use that command to set the =09=09 * proper timeouts for the driver. =09=09 */ +=09=09tpm_chip_start(chip); =09=09if (tpm_get_timeouts(chip)) { =09=09=09dev_err(dev, "Could not get TPM timeouts and durations\n"); =09=09=09rc =3D -ENODEV; +=09=09=09tpm_chip_stop(chip); =09=09=09goto out_err; =09=09} =20 -=09=09tpm_chip_start(chip); =09=09chip->flags |=3D TPM_CHIP_FLAG_IRQ; =09=09if (irq) { =09=09=09tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED, --=20 2.24.0