Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp906930iog; Wed, 15 Jun 2022 15:20:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1veVOfn3yT4Zj6AWM+LZcLoLipGT/v5SBh6sbJH1RyPX++cvQL7lQfZJf26BltSjb0smDk4 X-Received: by 2002:a17:906:9d01:b0:711:dc5d:c8a5 with SMTP id fn1-20020a1709069d0100b00711dc5dc8a5mr1779859ejc.432.1655331600239; Wed, 15 Jun 2022 15:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655331600; cv=none; d=google.com; s=arc-20160816; b=DXodCxv7JCt2qmjEipgJhJggDf3AhRsC5xnIMsxW6eCr+jNGZDIUwxi7uxnj3DtE47 xU29f549Q7MfsAhVZEFgZJMSHmyeuiVjD9H1LqE03dhTHYr9FIpNSY0PwJJ2YWCvBWwF PK3R0UtoPeoehklc55hQ7Q0wwYYfhbGxeO7MLCu7Nsrbh0j3xb3WSnalaozjcg5KJsPz 8mJBbVF98qz2C3tvlQbUMt1bbeD7aFGtPRyXa4j0cH1uBNvN0Z/0M5O0HEpE9YUchZ0a pq3eIyEvn+0uMv5CxtNgzXq+FgGtgn2ibqcH0PHIBMKr1wHygCnb5ljVB3derjoZBBnd 7lBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=mwiJNOo2x7xhgxTJqJR3FIkVjBHW6H8d8oCXpJCBM/w=; b=fhg5I1ykzwtYcua/AaopOb0VKVB6pnIoOq3me9QQUz9vJy7k1/8wy2cAFm7+IbkEuD ZAsazcTrsdZTYNBzi0Qsv7eMebYRUTIX/TLY6l4h2ADYu+pkmakesGvZtZj1X5YK0rTL I8oE/pBe2Y+bU6ObGHBHbR+K1WDVc6lJnAFe3fMNicQK+9NkqDJ6KJtGPKdL0nkxiHkH 4UtE4vFy2r7NMFABVOkqCVJQUpUw5QcZTS2Et367TLXH/eFm6kekRJU5P1r+6OEl6ThJ iz9Yfi3HlMg9txkG548N0d/WZycBPdJRlFpMIgOYF/AtUQPFDaAyr0zpcV1qTuyaxOmo 4rhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=M+R8dVlc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 28-20020a170906101c00b00711ca931feasi15793229ejm.998.2022.06.15.15.19.35; Wed, 15 Jun 2022 15:20:00 -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=@gmx.net header.s=badeba3b8450 header.b=M+R8dVlc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350415AbiFOWIx (ORCPT + 99 others); Wed, 15 Jun 2022 18:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350414AbiFOWIe (ORCPT ); Wed, 15 Jun 2022 18:08:34 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD24A42A05; Wed, 15 Jun 2022 15:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1655330901; bh=YTzmET/tH2HD8vOlvz/aarT5wNU4Ip1N3B72KZ7IcGk=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=M+R8dVlcrWrxDoEJaFd+2B2arPG4kRQ5o/Pl5ml8s6+JVeg0LtR8tLsWo1NiERQf+ c9vEbJBQOooek12I1zWL5F6etOx15X4sC1vWWPDHqj9VEINmLPIPm2sG3slvmxn3i4 Wk+Y6oaySoEqHaYUcLXD53PjocQW5gW2giI2ytKQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.33] ([46.223.2.17]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3siG-1nbIuL2VpQ-00zoYT; Thu, 16 Jun 2022 00:08:21 +0200 Subject: Re: [PATCH v5 06/10] tpm, tpm_tis: Only handle supported interrupts in wait_for_tpm_stat() To: Jarkko Sakkinen 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 References: <20220610110846.8307-1-LinoSanfilippo@gmx.de> <20220610110846.8307-7-LinoSanfilippo@gmx.de> From: Lino Sanfilippo Message-ID: Date: Thu, 16 Jun 2022 00:08:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ar6jD7PFDwwoQrLs5YTXC8YDLE4YHM7JD6SlZk+JA+1urt37hif xYp1fE1XpWkUVCjwSg9Q9jpYtPvHLJRFfunu33pmok024ISn4M2fUw64JE4TEVVIOg6ZfDz GWDlw3yynrw42c7PcdLgPUinItNCEMGMIq/Z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vQF05Eb9LOtOMg9WZ6TFBnvvNMGLmerFNKjUgqjOvelGqkINT98zHJd8YMBD/ApGzcyFt5OMB bZgvJqIx8j+CWqcZx4tM5bp1Uphbny6WWNlB/qsUmH3bX95v1/FZ/2eS23ESNdK4rR/TMccnu VwMN/Z6E53ObIVaBFTTgtteXhXza0tAg4GQwlBKCowMCPEBWSxEDkFDYg== X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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 15.06.22 at 20:21, Jarkko Sakkinen wrote: > On Fri, Jun 10, 2022 at 01:08:42PM +0200, LinoSanfilippo@gmx.de wrote: >> From: Lino Sanfilippo >> >> According to the TPM Interface Specification (TIS) interrupts for >> "stsValid" and "commandReady" might not be supported. >> >> Take this into account and only wait for interrupts which are actually = in >> use in wait_for_tpm_stat(). After that process all the remaining status >> changes by polling the status register. >> >> Signed-off-by: Lino Sanfilippo >> --- >> drivers/char/tpm/tpm_tis_core.c | 46 ++++++++++++++++++++++++--------- >> 1 file changed, 34 insertions(+), 12 deletions(-) >> >> diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis= _core.c >> index 2f03fefa1706..028bec44362d 100644 >> --- a/drivers/char/tpm/tpm_tis_core.c >> +++ b/drivers/char/tpm/tpm_tis_core.c >> @@ -53,41 +53,63 @@ static int wait_for_tpm_stat(struct tpm_chip *chip,= u8 mask, >> long rc; >> u8 status; >> bool canceled =3D false; >> + u8 active_irqs =3D 0; > > Something like sts_mask would be a better name. Calling it > 'active_irqs' is a bit confusing. Ok. Regards, Lino