Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3563726pxb; Mon, 24 Jan 2022 12:18:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6ni8ABHKiZFI+91Ro+z59r6zEt3xnTpnpM9RNsMNwqeb7iWToljCU147yXmB++8pmKH+I X-Received: by 2002:a17:902:b688:b0:149:a1d6:c731 with SMTP id c8-20020a170902b68800b00149a1d6c731mr15636186pls.145.1643055506309; Mon, 24 Jan 2022 12:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055506; cv=none; d=google.com; s=arc-20160816; b=Lfzb6kpZHPOqx7rmjQK506kmnjeoy+kDgtMLzusJaBGqOMGYIipkJXsUMzosVt/VQa mfm+e2hhk96kyiMm2yf8P5qKv1wUieWDm77Qi1bQoLvy8tZqdtcMvcdSaeV32IfIB9BV 3+XB7nXypK823HABR+GEIYzVaJgEsvLeuYxf5bWXoN+46VzwbuRq6T6+F7yUawouYork ZjWBwi2gMBLWLAm1ikt9enBgzLQEpkQsY/KXGtg2XG01o/Du0gb+GiOIq9tePOdSFW3W xWsnfa+8TTDKusxUz4jAMh1IaybpIo9GcYs/9EIMIXqIFHvMYf3ffDU6ScKpT1Zcqjix x6lQ== 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=yBUTU4oGOoxaBlk6dfJc3ZUNXdw/qAYWEJb8K+5H+50=; b=jeLQh6YRzCcxTVet5JEYPUf9x0wrY311Zr0voVYEFRFHOtlAj+1gWsjZvdS5B5sHt8 a/naxbhZypVRICnNo446YuGDh08xPl3/6VBnVsogypVyyP8Db7vNhYzyyUKMsuadMtBV pjL/ydl7RVBFIcA1nchOfKdQZIloYnJwn5qExGgHajMOX+mORJ2npBbAlPu/DW2tvsmB X6j/dITZZXmqoSj8d22m6qyHOz9rAjeoE7ze8/f3/sOud55KAS8SgAqmUZuqMDpXmr0X VKHfyQFeE4mF4h1CFnyCQ1i/PO88jFj2iZ0lAJHwwgdYsTV8attw3TKeHjnTuXztPnD2 aLiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ONyABkGr; 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 x10si2466656plg.314.2022.01.24.12.18.13; Mon, 24 Jan 2022 12:18:26 -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=ONyABkGr; 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 S234153AbiAXTXS (ORCPT + 99 others); Mon, 24 Jan 2022 14:23:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241887AbiAXTNU (ORCPT ); Mon, 24 Jan 2022 14:13:20 -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 E58E5C061751; Mon, 24 Jan 2022 11:05:30 -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 A2F40B81233; Mon, 24 Jan 2022 19:05:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3A04C340E5; Mon, 24 Jan 2022 19:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051128; bh=5/w/TnqMOOVU69Cwul8larGgy3UEIvr70dTh3O8P4TU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ONyABkGrUpRUoZs8XyUGclPFVvBQjHlJ1jvGM5rersa0Scu1H8GQahQh0dIKHJHaL WB0mWNJCAyih9zEPT3fiiCLsTbxMp9b4UoP63uzmR9yaq/ypDHArdu0Eq51DukI0MW BrFkf7tCyRFoVfZmuy0TDo3FLdqkgisNZTTjIfUU= 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.14 063/186] tpm: add request_locality before write TPM_INT_ENABLE Date: Mon, 24 Jan 2022 19:42:18 +0100 Message-Id: <20220124183939.149952646@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 1ac9abcdad52a..9e42943f6a599 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -809,7 +809,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