Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5466238rwp; Mon, 17 Jul 2023 04:51:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGO5bNoc+mEVgtBGpWfc3DULtYQMJhrkxd6NRyMb8eAQ6NHXsxoLUnoaiuGYWYZeW6J8rHB X-Received: by 2002:a17:90b:1c11:b0:263:5333:56a8 with SMTP id oc17-20020a17090b1c1100b00263533356a8mr9739573pjb.21.1689594696509; Mon, 17 Jul 2023 04:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689594696; cv=none; d=google.com; s=arc-20160816; b=w51vQ42px4fNCSQ8Er+rrzTCyZO/TrMqlmQrHGsLuV4pAYtzQy6hLsDPVpOXCgWFSk UxHtM37fOBYXu/GJK1FiPerr0T0s8gPCc+BSRg0FrfBrHkZESS7VAA6JS/TKSnSLDRQs ab1BVeMa8Rm2IdPoSFztdXF+A5ybdL7VCm+JUFF6rxQXuvGDiHcLU4JNncazZ7M4r1uX wYRBpRb3pmql6Uos6t6Cs8qn8SGxivJG+IZExAoLJGnu0ZNU9Kd47I1GDlI+7akSqbCm 0Cz1CspDdkKPE12qZqlxRU92gP/rj+jBXj03Vd1ugsGSRVz5RhaQHW2OnT4mi/uZc5bN Waig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=7liYLbnLkIsZonwl8DINWaXoj+RHk5uUigMN1iS1rgw=; fh=sxbu35vTAgHRaKZLaMgALOjJtCKAHNtx39KGvoGwNMM=; b=b6dey9cgwwWtp5Sp6q8vuwroyzgOVL9daQYXn/+QFN2yxVWmrRPwTsgc4CZWdS6geH 4jbt50NFQ/Dzbs6maltYMl7Z3ZjDRymWFkxW3fJjZedq5MxD9lxM8DxncZA/h6HnSXrk RGn+mA3bXtecmc2LyCJCQB4zU5DLC+lLVgMmq0bjGMa2L0C3t9Mal01NLn3WltLvR4V7 7F7poQvfiIn7WgOLedhdw9Ijs39LeY55IaQPeZUKuT53ZessDxtsdJILgwLa75LulItU sGkzN7+IiqfG3wWwxtykARTWRCrJxgc/LTskvO5rDEINHunLU71EQ0OIQcFQ5/x5iPNk 9RTA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx24-20020a17090af49800b0026315d77374si5501046pjb.151.2023.07.17.04.51.24; Mon, 17 Jul 2023 04:51:36 -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; 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbjGQLeK (ORCPT + 99 others); Mon, 17 Jul 2023 07:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjGQLeJ (ORCPT ); Mon, 17 Jul 2023 07:34:09 -0400 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AE10E4F; Mon, 17 Jul 2023 04:34:07 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R721e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=guanghuifeng@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0VnblUxn_1689593625; Received: from VM20190228-102.tbsite.net(mailfrom:guanghuifeng@linux.alibaba.com fp:SMTPD_---0VnblUxn_1689593625) by smtp.aliyun-inc.com; Mon, 17 Jul 2023 19:34:03 +0800 From: Guanghui Feng To: lpieralisi@kernel.org, guohanjun@huawei.com, sudeep.holla@arm.com, rafael@kernel.org Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, baolin.wang@linux.alibaba.com, alikernel-developer@linux.alibaba.com Subject: [PATCH v3] ACPI/IORT: Remove erroneous id_count check in iort_node_get_rmr_info() Date: Mon, 17 Jul 2023 19:33:45 +0800 Message-Id: <1689593625-45213-1-git-send-email-guanghuifeng@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 According to the ARM IORT specifications DEN 0049 issue E, the "Number of IDs" field in the ID mapping format reports the number of IDs in the mapping range minus one. In iort_node_get_rmr_info(), we erroneously skip ID mappings whose "Number of IDs" equal to 0, resulting in valid mapping nodes with a single ID to map being skipped, which is wrong. Fix iort_node_get_rmr_info() by removing the bogus id_count check. Fixes: 491cf4a6735a ("ACPI/IORT: Add support to retrieve IORT RMR reserved regions") Signed-off-by: Guanghui Feng --- drivers/acpi/arm64/iort.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 3631230..56d8873 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -1007,9 +1007,6 @@ static void iort_node_get_rmr_info(struct acpi_iort_node *node, for (i = 0; i < node->mapping_count; i++, map++) { struct acpi_iort_node *parent; - if (!map->id_count) - continue; - parent = ACPI_ADD_PTR(struct acpi_iort_node, iort_table, map->output_reference); if (parent != iommu) -- 1.8.3.1