Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3603320pxb; Mon, 24 Jan 2022 13:17:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUQI2THHJNW5km1RQU9tUgWEEylKWxRaQ+cl/+L3kEWsI43bkTqSvXbFcHu8HiyGWt7MmS X-Received: by 2002:a17:90b:3841:: with SMTP id nl1mr218953pjb.50.1643059048176; Mon, 24 Jan 2022 13:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059048; cv=none; d=google.com; s=arc-20160816; b=0yNmEdjC0f0lNggfZv++dqTh58x+1Ei7wJfvkc+M8JYulnvSCvGyuW6JEAV0re+crI aROdb1g4S4C5wCKpE+wTxysyQJJy/lHQrNbIGG0avm4nE2KWSku8pefilJDDZ7/dkLAT jTGDHms3YxIkpe8HROixCKYWRSfM2zIhHCFx4u1yKNpVamVUPoSKULtGvRXk5TorFGX5 nU3xocY0DauFIhMAT1leKi4JxJlTA61s8A0cnt/wVqX5agE1tev8CMeUoc61uA+SvCUY p3Y0GaW/ETCWK5cOba6qYwi/3nCp+LWfD9TmDNzoF5tYMdM//AVKx7tt7QaLV9ZPZOzY 8HeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ry9pqmhGe3pSnFEv2GVwjPIC+/qaJxtqJOXz/U2FbOI=; b=mmhlrFDVayCoQ66dRK2F25SSIHXdds5WMxBWJDo2JhZ9SH5+3Q+Bi3PPglwqTjS0cs pyGDllrDTavcLnAcLimtKzsB6KnDzfzMgkxmh3GLFfOrjtfHGmrvdRx9KaiHd/jkvR0i oGVfaMHo0lYsbH3Hg+7p6eYzjm/kcjMe1QmO+lc60doCJJEvxvBl9p1HjthqA+stK57k i4aDZU2kI24LGWdbFteES4Lp8cyknLJDkWPtDk3W6tKvpgTv+fzPvVWuZz7uiIxXa34L jwifQUUwaI6z2vkzIYta81Gvyf76I5o/y/904vw7pDvyiuw6iHh3cKwKtef546DkUol9 1jYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HtikcpBj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h22si14682029pgi.833.2022.01.24.13.17.16; Mon, 24 Jan 2022 13:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HtikcpBj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392459AbiAXUvP (ORCPT + 99 others); Mon, 24 Jan 2022 15:51:15 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:34708 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383789AbiAXU1t (ORCPT ); Mon, 24 Jan 2022 15:27:49 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2211EB8122C; Mon, 24 Jan 2022 20:27:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52C91C340E5; Mon, 24 Jan 2022 20:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056066; bh=utsPrtpcWIvwCt9tvxNIxDq0GM9C7hpc0Yc/H/vxqiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtikcpBj34yj2nWAIPW0HTJhwF/GgtXpgLKK4DiSFgvckZuGTQf17yTFQE+Ms926Z 4dWhQOnwARdF9DZfmk/Hf4jFl7Egfemzbh2tuXjpFLeqYWhcuXIxHJS+EjqDo3k7W6 34DkSITV+iMk+gVq9QfIu4SCOMpVUqbKupCzMgP4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen Jun , Jarkko Sakkinen , Sasha Levin Subject: [PATCH 5.15 358/846] tpm: add request_locality before write TPM_INT_ENABLE Date: Mon, 24 Jan 2022 19:37:55 +0100 Message-Id: <20220124184113.281721674@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen Jun [ Upstream commit 0ef333f5ba7f24f5d8478425c163d3097f1c7afd ] Locality is not appropriately requested before writing the int mask. Add the missing boilerplate. Fixes: e6aef069b6e9 ("tpm_tis: convert to using locality callbacks") Signed-off-by: Chen Jun Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin --- drivers/char/tpm/tpm_tis_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index b2659a4c40168..e2df1098a812f 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -994,7 +994,15 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT; intmask &= ~TPM_GLOBAL_INT_ENABLE; + + rc = request_locality(chip, 0); + if (rc < 0) { + rc = -ENODEV; + goto out_err; + } + tpm_tis_write32(priv, TPM_INT_ENABLE(priv->locality), intmask); + release_locality(chip, 0); rc = tpm_chip_start(chip); if (rc) -- 2.34.1