Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6849290ybx; Mon, 11 Nov 2019 16:05:26 -0800 (PST) X-Google-Smtp-Source: APXvYqyVJqLWwrHkNmCC1CVNACmwZay07mf0YPfou38x3GqtcdFxzeHfl4uwJcEbk2XhJgel+97X X-Received: by 2002:a05:6402:7cd:: with SMTP id u13mr29187936edy.246.1573517126641; Mon, 11 Nov 2019 16:05:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573517126; cv=none; d=google.com; s=arc-20160816; b=OpkZ1nnJRZq0oXqheKfI0208GSrpG/2cq75mY02pgelLWHx4QptK2GRiUVU6HDs0Bw 6/m++eFIuCvxqbsA0hnkSPmmpj6LwsaLKM/8SJTl4z2+f5szR3qp3+F0LNF2UNiU6WAX ULUZXBZg0t+DBRH9G2LW1wIlBvp+TuWkktQJrLIxyO3xIPHU8PqYe2ly8+vZK+eSvMuq D166VxwAhU4ZQIz2PJVoQ2zsHM+BU+b1N9FkO3CXZgNJakDK045vs4ftTTvcfODgQzC6 RsZLGw4bghUc/7n7DgfWsMORZ5wHM2CE+wMaugzJn15V4KtxZwES4j2toBLyYrtjXZw7 Z68g== 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=Bsoa/zduDjdjsB3b7JEy0vJUwhAm1R/rZnjwwyCHBSg=; b=KyqzIZPc9jxUgKacmkrn4vlY837ZDDysJmzpsCQUoc2TVgt07CEqWdqJO7mBEYgLJs Zus5RP+pTwlDOfRyiMzhLdr9Iv8O2FlLRgZUBF26JYUtfL65aD3Y3dvMN2icP8CehaBw b/h/AADLHzYIXMCH1nDtQMKjaAHGiVWt3Absmk1dQ11fxQF2X1i/yikBdKxrdkE4TZSh k03+f+2blObMAKGhMqmyLRV+B/mYGqZoA8rzF+jatebWNDWgVcVmBcxnR02rjDGKKpvx Iv06gw50WaNgFzSmNh5c8+m5JSdmg4EJnRSnkb6iLec8ZvVIFsNciY9iLW7qo1tWfhtU q4YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eqlemseb; 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 b3si12940182edn.202.2019.11.11.16.05.02; Mon, 11 Nov 2019 16:05:26 -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=eqlemseb; 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 S1727021AbfKLADo (ORCPT + 99 others); Mon, 11 Nov 2019 19:03:44 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:51879 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726932AbfKLADo (ORCPT ); Mon, 11 Nov 2019 19:03:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573517023; 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=Bsoa/zduDjdjsB3b7JEy0vJUwhAm1R/rZnjwwyCHBSg=; b=eqlemsebaEDOTyT9rJy/zvl0872dwmqpWi8/ZEiYbRwfmgCOAxE1nbWmyincGWc68KD6jk kyZYhRb+X2QjP33JTPTzYEbwmwbRk/d6vrQIyfoVKXYNG7Znmdd9LwKBgSgzDW5UQA23aa CKqWirpQybQebGnjdZaJgAHQhcO1UIc= 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-409-DZiGzyTcM0mQ0OcBOivYAg-1; Mon, 11 Nov 2019 19:03:40 -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 F2832800D49; Tue, 12 Nov 2019 00:03:38 +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 86A8E60852; Tue, 12 Nov 2019 00:03:38 +0000 (UTC) From: Jerry Snitselaar To: linux-integrity@vger.kernel.org Cc: Jarkko Sakkinen , Peter Huewe , Jason Gunthorpe , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Christian Bundy Subject: [PATCH v2] tpm_tis: turn on TPM before calling tpm_get_timeouts Date: Mon, 11 Nov 2019 17:03:37 -0700 Message-Id: <20191112000337.18898-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: DZiGzyTcM0mQ0OcBOivYAg-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 --- 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..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