Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp761533iog; Wed, 15 Jun 2022 11:42:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tjw1uM7bSq3q2h0LoqCjKzPO09vImq727nT747BkYayZ7mQiOFdqMqj80VaaQojZpwfJJC X-Received: by 2002:a05:6402:528f:b0:42a:c778:469e with SMTP id en15-20020a056402528f00b0042ac778469emr1408477edb.404.1655318541485; Wed, 15 Jun 2022 11:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655318541; cv=none; d=google.com; s=arc-20160816; b=Z14SDHHCH7f6RqgRUuM4GLaT0sBqmRoK4iDqYwlOSDsYltO1FVSKMEZ+7qul19VElz b564JBeqRrzOMt7SgIsBWN/dorDzkkGg9VT6lJMJLNnXnkN2zRlOXkLFkNenrxEt3M4S VfEV4xurLSN0SRYA8fo7GoNQq6H9nNbL1kzAZT2kg7ZYksB1xUdAgXQDuvskIAclsCYc fS/TBPeJf3aPKSQanTvXtKvJu1M1HP2Zf11GJOdVCVR1W7tyf9i2epBqE9ECFYYdvE1V 0cZ9ZmAJyhIDRLXU96GRelWfxrKZPM5SteloMRknBuoCCn1Umk6kCNSNppjlYy3W/aGH ObXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mSuIgui8tTIuaEsK9lwa1MYyLeGmey0q7YDJElpS5Mw=; b=Mrh0A7uZ4wt+xKBb/9G3BxVRL0QCrxi6pbc3AofUqbQx6ZCTDfGETP/gmGu2wvIgqj cSU7bkh9kyBLmojmgKpFVXDKUDiPE7po0C02GJjCBCf8VO05tmLonpQ23K601V5P+f0b 7NjC7xjiIk/IIunEVvjdvB6YtOEeMOWi/vHKO7h8CxO5CXYD4GLDiK3nzAQTu4UQNuhc dL5CVtCrv80msOl0v2L0kGQqPBDjaNbC7CNZgWfGD0m2Llw/g3mKlm/37CTMDfa2h66s cug3hNbYYTcVvZX+xKLtW8Y3UysLdAG/18CNepUIPNoxi1nnI9crarGj3boMxo7kpzIz ArbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rbhX5VTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd22-20020a1709069b9600b00718dba48d9asi6715864ejc.72.2022.06.15.11.41.54; Wed, 15 Jun 2022 11:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rbhX5VTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356667AbiFOS1l (ORCPT + 99 others); Wed, 15 Jun 2022 14:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242474AbiFOS1j (ORCPT ); Wed, 15 Jun 2022 14:27:39 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F73311C23; Wed, 15 Jun 2022 11:27:37 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id C137ACE1F96; Wed, 15 Jun 2022 18:27:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58A19C34115; Wed, 15 Jun 2022 18:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655317653; bh=Am7c4bFgivyhoxr0ca8K1YRqNfaQDlprc2E2R2wk02E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rbhX5VTydlxca9LUO0mU0uKnGjonLFHNZ+bxFxI0TDOYYaTwlLk43y1lWrPiuWkFA CL+3JL+LI+XDw8q8RKfoDCFIzBWIkYvEsaOPv/Ck/pYiG0ZrGrJWB4NLpY49EMEM4K XWP6pl5H7IbHM/qifSIksopmUyqRthgTk0yfTH+jQGu/NtQe8GGUNRiuZZpWX3gdH4 ElZbK/yrP2QwWLIxxPukQQXwHBl7ImHpdTOWCnDymEXtE/V3Y6KRtti472+P/tjLUG XiKlG6smxzsN+sw0p1qQJLAK1HVQ9wEy/z5b3Tfw/IiJzyLlbe6J2fOIuP/JDM1Xtc IRG3942fpSupQ== Date: Wed, 15 Jun 2022 21:25:24 +0300 From: Jarkko Sakkinen To: LinoSanfilippo@gmx.de Cc: peterhuewe@gmx.de, jgg@ziepe.ca, stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, l.sanfilippo@kunbus.com, lukas@wunner.de, p.rosenberger@kunbus.com Subject: Re: [PATCH v5 09/10] tpm, tpm_tis: Claim locality in interrupt handler Message-ID: References: <20220610110846.8307-1-LinoSanfilippo@gmx.de> <20220610110846.8307-10-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610110846.8307-10-LinoSanfilippo@gmx.de> X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 10, 2022 at 01:08:45PM +0200, LinoSanfilippo@gmx.de wrote: > From: Lino Sanfilippo > > Writing the TPM_INT_STATUS register in the interrupt handler to clear the > interrupts only has effect if a locality is held. Since this is not > guaranteed at the time the interrupt is fired, claim the locality > explicitly in the handler. > > Signed-off-by: Lino Sanfilippo > --- > drivers/char/tpm/tpm_tis_core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c > index 8b5aa4fdbe92..e5edf745fb23 100644 > --- a/drivers/char/tpm/tpm_tis_core.c > +++ b/drivers/char/tpm/tpm_tis_core.c > @@ -753,7 +753,9 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id) > wake_up_interruptible(&priv->int_queue); > > /* Clear interrupts handled with TPM_EOI */ > + request_locality(chip, 0); > rc = tpm_tis_write32(priv, TPM_INT_STATUS(priv->locality), interrupt); > + release_locality(chip, 0); > if (rc < 0) > return IRQ_NONE; > > -- > 2.36.1 > Reviewed-by: Jarkko Sakkinen BR, Jarkko