Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3576648pxb; Mon, 24 Jan 2022 12:37:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmy+AksGDcc4Np9hwT+51KueDYQGuHgLxNmX27lVzyGiQxY8mabsPkJNZo7ybfDofSotpp X-Received: by 2002:a17:90a:e7ca:: with SMTP id kb10mr40544pjb.234.1643056677001; Mon, 24 Jan 2022 12:37:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056676; cv=none; d=google.com; s=arc-20160816; b=CeDEU6gkcdYcE3i5bxZhlWiUk0zBjLcvvOVlObJlTvi3itq/bBhucDt9Fw8oZSc9il tpZwQ1wEZaeJm7RS6F+TUGSJ50y3t6OHeCnsaHuhKLPLVBfwYS34MH3MYCi2zYkFna3W e+UJLK0KVO/lUV3TbKyj55yVddegA/J0kdsHoBJCJHklw2Pazy6dZzREBOY1eNx5UB2F gAZtdJTApT6ES0doVOD+fC3SPUv3xfzvib7zhwTb+x0m7wGUBcnYEENXYxGeNkxjHPmm RN1Az2X/noQ9ZooZioiLpJCE7C5D1H/6McVj4h5XfR/2x7B53nmy+4Z2Hok7ohOl+8lL tqDw== 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=FCasfPMv2usU157Rl9fXxXb7rCbm6FegLcKtE2M0A0I=; b=rYWiRqUaMLUE2BFc2+wdDMm2ktkkybzEMTh/ch0kHo3EZ2YzOBX8KZpnwqts1LwAFJ V8PV1Bbr+O3d+NLMeu0c06b+uF7U33wTa6kwPjkbMxga3nhWq/p8eLVLRd3f/BqPp5Vh ci1hhiEJjOL4w24EY8twTJLROX2C45D8jLgtL0lsMWShXhAsyrViIvchrSKI4KMoPCMv Ng/b3KExnpu3h8UYAChj54981H65fx3gzvP0n4Q5tayUK/smi/OmDCyxJb9jTMPiWa9/ 6+d89N0jKQSZ4pFfW+4m2TGLpkC2mMPLIJg8cJgv/J1cahfixBhLiMwGIPHTKsxSEyKF 3LdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZqqePjuf; 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 s14si15312175plg.205.2022.01.24.12.37.44; Mon, 24 Jan 2022 12:37:56 -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=ZqqePjuf; 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 S1356047AbiAXTpH (ORCPT + 99 others); Mon, 24 Jan 2022 14:45:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354097AbiAXTf7 (ORCPT ); Mon, 24 Jan 2022 14:35:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8DDEC0617AE; Mon, 24 Jan 2022 11:16:48 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 190066135D; Mon, 24 Jan 2022 19:16:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA468C340E5; Mon, 24 Jan 2022 19:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051807; bh=PP9uLvzWC9cDcqDXuUVuJjBDEv8xT7ubGng62qaT7qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZqqePjufXT6O8AK/Lpg8Kf1nMplipREk1L4j2arAe4kgEZZC99mRKG0rWog2QulJ+ KC8pzhzsMAp6fHykYOuQo/vNKpuUyJ5eHpYbvm+24IK7TivIijipTM6S6FreV3WOwL aZIig1ycwwDrLjYKrVAVFH6i/oUw3v/qgIk2GTHc= 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 4.19 093/239] tpm: add request_locality before write TPM_INT_ENABLE Date: Mon, 24 Jan 2022 19:42:11 +0100 Message-Id: <20220124183946.069737911@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@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 c9a5f34097df5..c95ce9323d77a 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -874,7 +874,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 = tpm2_probe(chip); if (rc) -- 2.34.1