Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6824876ybx; Mon, 11 Nov 2019 15:35:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxFCoguONYiUha27nr8/SMlJSECjn0nHW9Lgq5c0xcfYVqVvVaywwvYzKMWDGk1Dk4s+s0o X-Received: by 2002:a17:906:7691:: with SMTP id o17mr25418087ejm.323.1573515339599; Mon, 11 Nov 2019 15:35:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573515339; cv=none; d=google.com; s=arc-20160816; b=B4Dclbm+SYhRPVTFSyJtAW3iCu4t0skPGJOEBBFKe29vURK9cfInje8P6nIFcPKNM+ MScY1sjnkvhaXmS72+h59pWTBLxfmCsbm3nqa1p/9upg1cZYAl6ZKx78ApBq7NYFnccM fSoL8fWD5LQETKKKXqmvMXLEWpNNXI/h+84x5w1vB/d0B47H0pO6gjrmbR1hl8MX/TP2 rapdBRnYrfYyoVDOEmd+a7iIpTWT6o/E5+/Z6aODGNzREj4xfADd3ID7ScpEmTyUTkkI HwPiXg9GGUJoL89oyQmMw8Wox9ikmNWUSTjph/pbKr53387K5kc8BYyTtYe7jdRhEQTQ iuJQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Osmocn6A+32FCq+AZZzVX6c3EKPInFHUzdh8/zOxZjQ=; b=aVhOCPZRmsKRvSdKg6v+UPPbf0BJcF85nyMiYwdhhYAQVsMjiNL61egFlj7KuRiAQS s1JxBqZFMMb+8eKMF0Zct7vOvUTOrF3n+xwoEHMr/gssElmHG5uZT37fgjBqBcWUvbDV b88SOoNrdws892Ej0sAmPNphwHPsld6GygSwg4JZ1W3U84oP0+9SnERqUYhloDCYYlpt Y0CI6ktU1b+ASLmvxRbY0dbQIUBnRoc8bx0beeo6Th2vwrOOMHp9ltu3NUb1056L+xL5 GMTe45jqIfJXNomRotWob0eX3FsamBfSPWsOB6Z8rqp98I1a6+eDxCbsX0N3tretW5lz 5nTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZX614W2c; 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 i12si10923649edr.198.2019.11.11.15.35.15; Mon, 11 Nov 2019 15:35:39 -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=ZX614W2c; 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 S1726939AbfKKXe3 (ORCPT + 99 others); Mon, 11 Nov 2019 18:34:29 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40895 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726845AbfKKXe3 (ORCPT ); Mon, 11 Nov 2019 18:34:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573515267; 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; bh=Osmocn6A+32FCq+AZZzVX6c3EKPInFHUzdh8/zOxZjQ=; b=ZX614W2cc+i2fFPMDkz2jI5qGUq80VRY7lv1Qb1TdfaZG8y9jr46FvZ4hBsxu3hF/mTBzG zEBxJvOPECs1mKr0SUdcn3Q3xsjFgji7oKs4KcopUVJdu8YEjgghnaUgqhMinhdlq16ypF VX+GKAhiHGO04B90oWFbOUqgZ2dZbCo= 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-394-7pYHOyhaMVGIDXctMbS_0Q-1; Mon, 11 Nov 2019 18:34:23 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEA06800D49; Mon, 11 Nov 2019 23:34:21 +0000 (UTC) Received: from cantor.redhat.com (ovpn-116-116.phx2.redhat.com [10.3.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE131100EBBD; Mon, 11 Nov 2019 23:34:20 +0000 (UTC) From: Jerry Snitselaar To: linux-integrity@vger.kernel.org Cc: Jarkko Sakkinen , Peter Huewe , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-stable@vger.kernel.org, Christian Bundy Subject: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts Date: Mon, 11 Nov 2019 16:34:18 -0700 Message-Id: <20191111233418.17676-1-jsnitsel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 7pYHOyhaMVGIDXctMbS_0Q-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: 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_cor= e.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, =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_stop_chip(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