Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp632228rwe; Fri, 26 Aug 2022 11:10:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5dzZ3yaOGZydFIB+fPtjRyMlcDFinNrQO8Lb3koCWQZRbuGM/v8c56pyacWDi6tNdoCl3N X-Received: by 2002:a05:6402:530d:b0:446:e22:cca2 with SMTP id eo13-20020a056402530d00b004460e22cca2mr7604585edb.237.1661537423702; Fri, 26 Aug 2022 11:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661537423; cv=none; d=google.com; s=arc-20160816; b=uXFCzBW+T06eQFNGAxqy82WqRijXTVcNXgt52hYbmugPFbLKyJX6HnCMD7eiclUiiq eaQxWx1ZEyaWctkNmPTJdzCFbg6p+NhuYX963JZYnnoCTI5lmMKFt+0EFO4+BPp6oN8q hdsIrJEkjxMwhKctYWMbqTISQlpk0dmbSN046jAvp15SypqDtC5g/+ENb9/mfv6TTvNd c21hB7/FovZOr59PzpYof0yABHWe3Gk1KPCp8s62rHhswuB5V/QqFsLv6haVGXIPPIVu T1MUL0IRRgWAB/0ER8CU93ABItQeJfsJlWjF49N7QyaXKwf0TWOXO5OPrxCdLEAAOndX 9UOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=NCMaVbRVmfzCQC//soO0cPljODJ/kKcr4ft4UHsvOWE=; b=ATzgcJRcQ+HeyviuOXrHPfngGUmXNVm63uxCyDpX3rALpJ1W+vyAdtgA1tAzBw5CGB 0c51nnt1eJYMfmeNo10EltIqSccj5t20CvAsoPo+cbQx5V+ES3GF01M3U8AljwJkCc/6 QLRCovKaFhIWA0k2MGD73MBl4LAq+8reqqWTb/skO7R38QoMQ+FNIfq0t+wUp9tmRm/X r0/Lq5iHDszjzpfWWT8FbKlq61dstsDR/8WOuJ05mLs+AZOaa7UCRiI1uoTQY0efqIHJ ZPoJwimtJszbhZxUKEJHYvI/qEFlZb7OH53UFGTlhieHnrOVs8tRuSVi6Ytlk+aSsrbn jVpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=D+cVRFCi; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a170906700b00b00730c028231esi1279405ejj.120.2022.08.26.11.09.57; Fri, 26 Aug 2022 11:10:23 -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=@gmail.com header.s=20210112 header.b=D+cVRFCi; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbiHZRnX (ORCPT + 99 others); Fri, 26 Aug 2022 13:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237625AbiHZRnU (ORCPT ); Fri, 26 Aug 2022 13:43:20 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9D6CC3F42; Fri, 26 Aug 2022 10:43:19 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id cu2so4545650ejb.0; Fri, 26 Aug 2022 10:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=NCMaVbRVmfzCQC//soO0cPljODJ/kKcr4ft4UHsvOWE=; b=D+cVRFCihGfyTm7tL9oaZiCCLpiQIndFkS1M1FgD8jGc4ETdJT4uBi13nLsMg+0mtf t7VQWPmHl0lg28LNdO/hp9hpfAEZr811oIiGkGtZ2FDGwn9gHoS0XbmIYQD4uCrLjplC 2S04x1OTUcASEd6rOC6E99bfMvZ17psP8tM6OUEJCD80PJRNc/pXHHDWSu87nnS/5YuP 70S0j8Qg4NQeeCoAdF1h/PaB3MgKjrygTthllbUqxekQCVtpWH+mUjxFEqTkdT6WvuKE EiK/ATHFS55nfSSBqlThOurRGU+3A4XlL4tzOXohJSrHYAMwV6Nm02MiciwiZt6EdYqp FwdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=NCMaVbRVmfzCQC//soO0cPljODJ/kKcr4ft4UHsvOWE=; b=eJZGuCfC55rsz0nPS3FPt1Un5uZpv1KZPMPUi252nm88K/xY41l7T9qp5ORBHgMvZm 7sIy2KVWj4PPm244OXSJlnV01oYofT7DmuEzrECP0DDb5Tx/am1crpm7otyUv2miZE5l 1bym2yt9geaXj69hzA+h0SJHqZq5vFIViGf482g9iOu2OMtEe64rgUxLQEtaByPXKt9M Xt+NcZIhZeqgoBlzFKlHrtLZD9GMgrC0/ppYmtPwxRunOn3dotueFhOZngeyzCT2psSM o6bA42o4HwBPYxVpnRx/YmTiA66OXqzDwF++rlcv5FlTytJPS+zTyXiJgTRtzUuQxE35 u6Aw== X-Gm-Message-State: ACgBeo0FLkA2/scSs0GGQMN7LeQzFHlB9QtEPn50QZ+Fq8qXJ8fTjNsq h1UAXdZUnKm3LyW78807XcngQMeof5zFIL04NXU= X-Received: by 2002:a17:907:970e:b0:731:4fb4:5f7b with SMTP id jg14-20020a170907970e00b007314fb45f7bmr6045348ejc.556.1661535798494; Fri, 26 Aug 2022 10:43:18 -0700 (PDT) MIME-Version: 1.0 References: <20220629232653.1306735-1-LinoSanfilippo@gmx.de> <20220629232653.1306735-6-LinoSanfilippo@gmx.de> In-Reply-To: <20220629232653.1306735-6-LinoSanfilippo@gmx.de> From: Jason Andryuk Date: Fri, 26 Aug 2022 13:43:07 -0400 Message-ID: Subject: Re: [PATCH v7 05/10] tpm, tpm_tis: Only handle supported interrupts To: Lino Sanfilippo Cc: Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Stefan Berger , linux@mniewoehner.de, linux-integrity@vger.kernel.org, open list , l.sanfilippo@kunbus.com, lukas@wunner.de, p.rosenberger@kunbus.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Wed, Jun 29, 2022 at 7:28 PM Lino Sanfilippo wro= te: > @@ -1007,8 +1029,39 @@ int tpm_tis_core_init(struct device *dev, struct t= pm_tis_data *priv, int irq, > if (rc < 0) > goto out_err; > > - intmask |=3D TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_IN= T | > - TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT; > + /* Figure out the capabilities */ > + rc =3D tpm_tis_read32(priv, TPM_INTF_CAPS(priv->locality), &intfc= aps); > + if (rc < 0) > + goto out_err; > + > + dev_dbg(dev, "TPM interface capabilities (0x%x):\n", > + intfcaps); > + if (intfcaps & TPM_INTF_BURST_COUNT_STATIC) > + dev_dbg(dev, "\tBurst Count Static\n"); > + if (intfcaps & TPM_INTF_CMD_READY_INT) { > + intmask |=3D TPM_INTF_CMD_READY_INT; > + dev_dbg(dev, "\tCommand Ready Int Support\n"); > + } > + if (intfcaps & TPM_INTF_INT_EDGE_FALLING) > + dev_dbg(dev, "\tInterrupt Edge Falling\n"); > + if (intfcaps & TPM_INTF_INT_EDGE_RISING) > + dev_dbg(dev, "\tInterrupt Edge Rising\n"); > + if (intfcaps & TPM_INTF_INT_LEVEL_LOW) > + dev_dbg(dev, "\tInterrupt Level Low\n"); > + if (intfcaps & TPM_INTF_INT_LEVEL_HIGH) > + dev_dbg(dev, "\tInterrupt Level High\n"); > + if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT) Hi, you may already have fixed this, but I just saw: error: this =E2=80=98if=E2=80=99 clause does not guard... [-Werror=3Dmislea= ding-indentation] 1144 | if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT) | ^~ > + intmask |=3D TPM_INTF_LOCALITY_CHANGE_INT; > + dev_dbg(dev, "\tLocality Change Int Support\n"); You need { } for the block. Regards, Jason