Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp412817ybk; Wed, 13 May 2020 03:33:00 -0700 (PDT) X-Google-Smtp-Source: APiQypLae7t5XGKHak2Kz0P9NXoG7a/PUb1yRISbtTKbpPOrxM+ZGF/lLLuL+0vgO2eHrMks19cl X-Received: by 2002:a17:906:7f0c:: with SMTP id d12mr21082593ejr.40.1589365980660; Wed, 13 May 2020 03:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589365980; cv=none; d=google.com; s=arc-20160816; b=Azy2CmUxFTOdqfyBMNivduCl8NpzYerPCKkgoA1bXSRvoNz0Dn4gUwAD3QoDEgKkwk t3s86ShbJxLEPt11DbUwhGX3x9WIb5lYPtW9TEE1iw9yg2Bu5wBoX9aqUWbnApjTntJb s7PXSitffnQDeyQJ0ABGxok1T/LSxQTQZbg90PAUDA+wt7FcjnbTJXKdBpgNHlSLzWNV 7ImYzDn2mRbar+NT7XKxh7sKiFcRuUmdabdX2BcnJiiyTStYvW8shHtdQk7UlrGeGWtT ISZ+aG/NOg09UeK6e9VbJ3bEaJ4Cgm4Qu+Ir+XYlBBMhSN9vE2adFVamM++++Kt8JemA vGNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/XWAyRK9sVd+5EzFnZFzRH2MVaHkPQffmEzZsuoIFdg=; b=iQChxAYkTlc1c61wxq3vTq0M5YzIvlQMR7xLl5tDinOel/o9YSw7UuLsq4yd2dMJEJ JeYI/O92mGTfn88I33sRHSdm1sO+18UHkjQXLn6TudTnYrYA5TIVp91aEvvxHDUtS8dZ 1oKh0MpfR9RNMEK4rYC+45wLtBXAYRQV9FLYrShUKlBEqDm65v1N6zD2EkqhZ3SG2YPJ In2wPlGI6+nYjWqC0xdvsq74oGyWkhnmtqh/X4pZLyvgsNQmww96oxi8wC2Fi3ROgCTV dgbjGLydPvz67Muibv2Ty0YC/HeeInFlIFE5zdGKlOIBVs9J1ezl208v+4u1UsMpV2tW rOjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si4127159ejx.69.2020.05.13.03.32.36; Wed, 13 May 2020 03:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732204AbgEMK3D (ORCPT + 99 others); Wed, 13 May 2020 06:29:03 -0400 Received: from foss.arm.com ([217.140.110.172]:42530 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727932AbgEMK3C (ORCPT ); Wed, 13 May 2020 06:29:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E4691FB; Wed, 13 May 2020 03:29:01 -0700 (PDT) Received: from [10.57.36.85] (unknown [10.57.36.85]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F355B3F305; Wed, 13 May 2020 03:28:59 -0700 (PDT) Subject: Re: [PATCH v2] ACPI/IORT: Fix PMCG node always look for a single ID mapping. To: Hanjun Guo , Tuan Phan Cc: Lorenzo Pieralisi , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Sudeep Holla , patches@amperecomputing.com, linux-arm-kernel@lists.infradead.org, Len Brown References: <1589327760-5464-1-git-send-email-tuanphan@os.amperecomputing.com> <6f9996d3-18f1-0432-0e59-adc2cf086c9c@huawei.com> From: Robin Murphy Message-ID: <2c2795ed-c2cb-a166-cd6d-0e920bd05ea3@arm.com> Date: Wed, 13 May 2020 11:28:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <6f9996d3-18f1-0432-0e59-adc2cf086c9c@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-13 4:16 am, Hanjun Guo wrote: > On 2020/5/13 7:56, Tuan Phan wrote: >> PMCG node can have zero ID mapping if its overflow interrupt >> is wire based. The code to parse PMCG node can not assume it will >> have a single ID mapping. >> >> Signed-off-by: Tuan Phan > > It's better to add > > Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG") > >> --- >> Changes in v2: >> - Used pmcg node to detect wired base overflow interrupt. >>   drivers/acpi/arm64/iort.c | 5 +++++ >>   1 file changed, 5 insertions(+) >> >> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c >> index ed3d2d1..11a4e8e 100644 >> --- a/drivers/acpi/arm64/iort.c >> +++ b/drivers/acpi/arm64/iort.c >> @@ -414,6 +414,7 @@ static struct acpi_iort_node >> *iort_node_get_id(struct acpi_iort_node *node, >>   static int iort_get_id_mapping_index(struct acpi_iort_node *node) >>   { >>       struct acpi_iort_smmu_v3 *smmu; >> +    struct acpi_iort_pmcg *pmcg; >>       switch (node->type) { >>       case ACPI_IORT_NODE_SMMU_V3: >> @@ -441,6 +442,10 @@ static int iort_get_id_mapping_index(struct >> acpi_iort_node *node) >>           return smmu->id_mapping_index; >>       case ACPI_IORT_NODE_PMCG: >> +        pmcg = (struct acpi_iort_pmcg *)node->node_data; >> +        if (pmcg->overflow_gsiv) if (pmcg->overflow_gsiv || node->mapping_count == 0) ...if there is no GSIV, we should still *also* check that index 0 is valid before we return it. Robin. >> +            return -EINVAL; >> + >>           return 0; >>       default: >>           return -EINVAL; > > With my comments addressed, > > Reviewed-by: Hanjun Guo > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel