Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3703407pxb; Mon, 24 Jan 2022 15:50:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUwKhhUN0dD4g2Epx+5T/eFiq8uXlul+HWg7Gu6WkJoLg9S/mm5vqMB9Y2dw48OGHyJIMp X-Received: by 2002:a63:541a:: with SMTP id i26mr3806376pgb.322.1643068115343; Mon, 24 Jan 2022 15:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068115; cv=none; d=google.com; s=arc-20160816; b=R7S/NsdfOGxIuwGSyLtgAU9NR3z7VjzyZ4BYLQGV2z2MJa9HcOVaJSjSLjoeGbQYhJ 6awsdW1ucosQ1JVXGQC7Z4lLHxbirON74r/IjLOe0GLcwk2YqF8sES2y0UyMdoK/GB8G KINVBkwDpfZVHQGcLG4vtYQfZsbqaVA5fD0cm6fYyDTWk5bSUHPH4AXYlcio/EKkFe+p J71SAPlRz2lh3dPnuLISHBSvbTKi+l38QxP3p4vHAX5GDz2NtubCrHjkUiqr811Y9jIg kr7qnngdau/QFY6Ec/SP7ix3oymIInQLXKGnHW7X8QP8PEJlB5wyEKbibUnsI37wyG6K DjFQ== 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=IazjgfbUfdt6QZJGLoC2Neavp3KqygaTnCF8PUa80DBrgpajgbU1uUH5fpPAfYD4CI zPzNtGOAkiHyys9sENwgWREuILKkZmJfKBoh7TkOajARjrRDb7EbUN1sw6f9ojgzzFSf 7Z3X18bo89xC5up25DxJhrEm+xg4rZ+z9MKJmyUDEC4qBsoakXVM5KoTvX2siSNKvMgK l4a/6QPRLuZXETZW4Z1Ec23ndjUQLOC/mRI1LRpTiJ9j4EbwItyOS+5N66CSp9U6zPWv I7rlUFXHLqzlQrG/Gj9XeO6Tqq9eeOYVIxNR7w2oK2T3VC0rQKAYGqDNJ0UkLvSLL+hz Haaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MWduGN4D; 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 j190si7142474pge.659.2022.01.24.15.48.22; Mon, 24 Jan 2022 15:48:35 -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=MWduGN4D; 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 S2362458AbiAXXmY (ORCPT + 99 others); Mon, 24 Jan 2022 18:42:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1843433AbiAXXD7 (ORCPT ); Mon, 24 Jan 2022 18:03:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 769C6C06C5A4; Mon, 24 Jan 2022 13:14:40 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3CF78B8121C; Mon, 24 Jan 2022 21:14:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6518CC340E5; Mon, 24 Jan 2022 21:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058878; bh=utsPrtpcWIvwCt9tvxNIxDq0GM9C7hpc0Yc/H/vxqiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWduGN4Dc050MjBTzh77M8ffK9Ce4Ed9BnlVamcHRkPV6QKJH32/Rfuo1rSEo3mpH y3nYGq/m7TxxXc3E1F2xD9SjZkLu6TbAgolx4x84JIRXjiyinrhWKsYn2hzGwgum2B el1d2BQGRUNZr8a6Hqk9vyrKTd1Td9LxTR2GA9Wc= 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.16 0431/1039] tpm: add request_locality before write TPM_INT_ENABLE Date: Mon, 24 Jan 2022 19:37:00 +0100 Message-Id: <20220124184139.779125359@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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