Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2857719rwe; Mon, 29 Aug 2022 01:10:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR7G4NmcdchcC/lCrzIqNkJfrtVupZvh9qPCrpOW8StnUVUVnvX+hJvHCOVguCFWv2+6Fptb X-Received: by 2002:a17:907:284a:b0:731:5a2f:655a with SMTP id el10-20020a170907284a00b007315a2f655amr12876500ejc.403.1661760643501; Mon, 29 Aug 2022 01:10:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661760643; cv=pass; d=google.com; s=arc-20160816; b=OSapfOshTmyehAhzRMwndTFDJP2SIjAZ6Lu1/EpgohhnPSBDAnFf6xb4rGyDHubxl2 XylREvAKmwNmPBArBSKQHRNn62wMbt800XvC6QjjBgy/OY/C3KDGne7DYKdG0EGI1D0Z brYNNAwDRyppX6r95ACs7sd4qF54MR/8v0Kgq9PksYQxK5zdExnzdHxkpaZ9YWsUgTGf KhzQCNEduRNLTqgpKa7T9vG+Nzb6di8DP9bf6Hj6yRm90RZnuOJk7d7EeaxEvWFwwTVo FSUHzizWNvk+k3qMr6MNZDhzCPoD+ZEHKvoykx7PNgwGN/9WwV3YK3sqsdmp/glx4eOm OlvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=7DxuRSZd/TWS9kqIW8wL8qKJf3qezIaM46pfKUuJ6bY=; b=OjAPT5wB4MeIiZgtCNxm9298dFOP8wRVXSmYPEZm3/yNHYi0Topjt1BivM/KdIC81X 4SBq6XPqHUHcQ4DzIgaq+9xmQQyaSs+CKXs8NUCV03bVy5a9bY4Ps94so0aOF2pAxJHP hHPPogaMQrM8IQ+2tS7AYQ8MHNSY4s4A2he4xBEY663oQEu0d3UJS/sPbhGWyCND2zuT E8BFwsck7KPlhjg++b9mmxzGXK2ztvRachtDQb5jNe95HoEaW01foQ/prYLRYiWhPNln AeHr5uEr452WRS3T2k9UoVnJ6rnndVnx7gBoCoMG7mI3YyYvt2FumQ7Ixb5lyZ6h/yZQ meoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=GqxXiuoj; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a05640226cc00b0043c2e89d0acsi7401883edd.3.2022.08.29.01.10.17; Mon, 29 Aug 2022 01:10:43 -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=@kunbus.com header.s=selector1 header.b=GqxXiuoj; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229767AbiH2ID0 (ORCPT + 99 others); Mon, 29 Aug 2022 04:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiH2IDY (ORCPT ); Mon, 29 Aug 2022 04:03:24 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150058.outbound.protection.outlook.com [40.107.15.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873C845992; Mon, 29 Aug 2022 01:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F5v1WxGZY4pYxRlOVWVCZPtTD6ULjutWAuYzQ27XfRILGGeoAkWb1Oc8ZaBsHmX3VrKQa+5HrL2zcD8GD4jX/9+G/22Xs1f68El4c9RYpZFNtZLgKXPiToVPGARtyicxe1/msXTRQPwpfN4EudrZSt9P26fsi+JhqEwycILiYfGYfn9wh5/kunibRL7NRUaT+GjIYUrPptQ5pLmbV3A3ylZzh1zGgw5pzcCsZzCcUMrHVNGIeWwnkJjYy4tdJZjl293/NYw17KIdZQhFvfHGoS16UuMHXdxtoJ1TrjNgZ0xiyDTH3crgVm9dlIQsIG4M4wlWAIM6XNfv1/6KP4ksfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7DxuRSZd/TWS9kqIW8wL8qKJf3qezIaM46pfKUuJ6bY=; b=PDDdYPT/gex+UjhaGGeAYi4g9x3U+emq3BTHk0lgcLUMYm8wpTXTHY7Iu4aREyQXQPWCMJZyGx5JxJIFh5pxF4qbtAPQK1AlvUEXFMNNZchC2azVN33vB4GUJPzbDJmHYhQMuhvTKHLavXStbrOYA8UDdOx5a1Wq9iWlHrpg5e+w1B7qOWckqCoJXQmQbzeGfVjqXPuSpx+txVrlrDPF9ziTMyJ2gG/feAQCN5lztqpkthmZXK3bA6lEGxY5Xras+uXh0yxNBj+Ym6baiXL5bl0FTqsYZu8b3pFHgyF38hQl67zBWnj/mKKVFXyVkRx8C6TF80tcb7Xfbv2Dumm7xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kunbus.com; dmarc=pass action=none header.from=kunbus.com; dkim=pass header.d=kunbus.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kunbus.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7DxuRSZd/TWS9kqIW8wL8qKJf3qezIaM46pfKUuJ6bY=; b=GqxXiuojOaYjzEFLZwxTHjGl5t4XT47nu/4zjAA/kbWWbYbgvkGLwDD0/YbskwHPlhUPkroTlkKyJSIOuH8ipkFovlQREvKqYP7rVq2a5QNphDmtKzbzf2QEwvCVt1YlJRk19ZXBAyx5G6YNHrM23dRRbtMIBUf81cPzDr8mVwk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kunbus.com; Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) by PR3P193MB0912.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:97::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Mon, 29 Aug 2022 08:03:16 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::c59f:e594:1134:eb56]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::c59f:e594:1134:eb56%7]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 08:03:16 +0000 Message-ID: Date: Mon, 29 Aug 2022 10:03:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v7 05/10] tpm, tpm_tis: Only handle supported interrupts Content-Language: en-US To: Jason Andryuk Cc: Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe , Stefan Berger , linux@mniewoehner.de, linux-integrity@vger.kernel.org, open list , lukas@wunner.de, p.rosenberger@kunbus.com References: <20220629232653.1306735-1-LinoSanfilippo@gmx.de> <20220629232653.1306735-6-LinoSanfilippo@gmx.de> From: Lino Sanfilippo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AS9PR06CA0468.eurprd06.prod.outlook.com (2603:10a6:20b:49a::23) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7fac2d1d-a385-4643-d914-08da8994ed43 X-MS-TrafficTypeDiagnostic: PR3P193MB0912:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wQhHSaTDnlT5x5geYhSEmCn5N/MQOFG5cAtGU+SRLyuwy6w88KgMNmULAqFTHoXMejq32w4sSvY6fbOnsiGtlUp7AmWUvoNgwh3hfA+1wGWnRIbm3miG628tK9iWu+uKqeKJEmqwAbe3OsXGMZv7NWGtJZ14aigKwxtyg4z6aoCY1iKlRWtvxZmBbKFfgQqaRMwTVXeNzbjRjMu7aRXM1EUEtgd2SJe3vEEyfYpIR69buhYAxVFHbwXgcEnu/Ly98igq9yVIfY2FUBlx8A3NnQz9+CSIyaBtqdIluyDxG03G3hdPIEgSawfa8p9aEOrfdfI8vE3hX3ogdfzO1hSyJzy1LOErkQXIll7ViNVw5VZ+8wtNA3+fR/cEsM+BgfTg0o57cTXDdMA79ezatKvPDg8Rr0IphT3NYcRsEftXGs3AgbUb5AZZmuhRYLzwBc0x0nBdxr9VHH/I4TGp+HAEEBwgTKUwTLBNhpbH1xklUyjHf2YA0uDowOr3YBFWLTFHpX7yTCBzYW9YS2udRO7Yw3RsNDG1T0FBF+BmyBbKQlatFSDLF8FkkjTscyu7fROOrcd+1HNdiPGP7Brlip+CM58Lza20kA/Bd3ncUJoaQlHXXUtCCwCLujymq4WDMNAIPBsKCRhzaLmUXKZSd9CDcwrSUBncm1ilAGElcoUJVwmSgnsuv8gFf3uHRML9WVkAgiYuNlxX+elRBR83U6P5wii4uStvF49MpMrpKEmL/KV8HagaxpJ9jsnoqRlf8XeRCfywu+jlNMh9NxF1s6ePnTqJXvPynt6y0Wfwvr2DhoA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P193MB0413.EURP193.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(346002)(39830400003)(396003)(376002)(366004)(53546011)(6666004)(6506007)(107886003)(6512007)(2616005)(6486002)(41300700001)(83380400001)(478600001)(2906002)(5660300002)(8936002)(7416002)(186003)(52116002)(6916009)(316002)(54906003)(4326008)(8676002)(66476007)(66556008)(66946007)(31686004)(38100700002)(36756003)(31696002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UXhKYURGNnhnZzdFWjBIQzlIaGJtRTdrdHhJQ0RPaWhSVTYwaXZ5V2ZjNXRD?= =?utf-8?B?b1VJSjJueW1PSHNGYW5IN3M1c0NzSWNuL25Qa3dtcEs2TWtoL052Myt3Y0c2?= =?utf-8?B?TFRMZUZPUUQwQzg3blhUeGVnUTVLaHErNk5FN2hid1pqZFpUY1pwdDhNQzVN?= =?utf-8?B?NkU4cnNZQXBhUFhrSmxsR05ZSU0rcHUyYTZmaWFKZDlWUXRpNEtMbE8yTVF1?= =?utf-8?B?TSswYTVMb3hJN1hvb0xXMXNSaHlHaU40T2N6Uk11ejRkVkRMRUNtWTRPOVgx?= =?utf-8?B?MUgrOVA3alVlZXlNaDJUeGJpMnRYNGdIVWYvTVdYMWpzVFJMaXQ4NVRhSkdN?= =?utf-8?B?azltc25lMm92bnBHL2FUTnQ0WE5BU0hFVUtMM0JoT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U0zUVJCVXordVhLdU5QUjZCcDk0?= =?utf-8?B?bDN4OXFnNHovQktabnA0ZlNsUGZBPT0=?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fac2d1d-a385-4643-d914-08da8994ed43 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 08:03:15.9845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: aaa4d814-e659-4b0a-9698-1c671f11520b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n0bXnEpmqGHoZHxPagaTI3c7IzJSeUDdy6nJRB3usHA4Q+zlCJ5OgvciuYNSnUvjk7PUNG3xMvMgd5Dt2DTf9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P193MB0912 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 Hi Jason, On 26.08.22 19:43, Jason Andryuk wrote: > On Wed, Jun 29, 2022 at 7:28 PM Lino Sanfilippo wrote: > >> @@ -1007,8 +1029,39 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, >> if (rc < 0) >> goto out_err; >> >> - intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | >> - TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT; >> + /* Figure out the capabilities */ >> + rc = tpm_tis_read32(priv, TPM_INTF_CAPS(priv->locality), &intfcaps); >> + 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 |= 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 ‘if’ clause does not guard... [-Werror=misleading-indentation] > 1144 | if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT) > | ^~ > >> + intmask |= TPM_INTF_LOCALITY_CHANGE_INT; >> + dev_dbg(dev, "\tLocality Change Int Support\n"); > > You need { } for the block. > thanks for pointing at this, I will fix it in the next version of this series. Regards, Lino > Regards, > Jason