Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp201225ybk; Tue, 12 May 2020 20:19:16 -0700 (PDT) X-Google-Smtp-Source: APiQypI6j8GctOdH35Yrf+YsNVD7THlmTkBBVYrY+4C2sLmUNApJ8aKYbJZnOfsNhrQCYCOommoo X-Received: by 2002:aa7:c453:: with SMTP id n19mr20263544edr.218.1589339956048; Tue, 12 May 2020 20:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589339956; cv=none; d=google.com; s=arc-20160816; b=bZ1/NYriq8MFlyke+hxL+lHerMFRhKBbfyKMbNLrk9Tb8sYXRGUwXlKQoQiVQRuRM4 oxXYuI8A72ANqBY+BITnQEtWYIYFGhIFxt1wYKauaUCl+TDnETl7dMsFa5sdZNF3/t55 6WHo8JvsuD8TuS5FEzoQjAJOKLt4YCMhDcu/B2SV98rtEEtDQUCoMnpCS3dQMAxZCdQN D+5jOrIlzcAoqqdcba+TF64WJgImL2uCTtdvZALSlBFBYS9MFbyOFYGkq4F4RcGTNFOx aKmtAZVWPpuyEzc2fc0uoozhbGYAPdNhNudIMJuDfRf4BWv5j43ELCufSMvhelgxxrsZ A6NA== 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=AyIPLBjd7hbGxuujl50t7aFmelNJpZV2M+Duby8BQ+E=; b=QVfJnWW72WC+PhuYF6htjSQuap65mTv5MHoPNM+K7cZiiM8/ZO1rfrwg2PZ+6icqGK lpiTA2Ch7uKvmDBwpgqWV3qDzdv2+2mEx7Van3zlqAG71YBbICqV9kKsjTHXxRyXAg/Q Rc5T0qHnsTFDOrM8fEjQ8qTMO4MsJN1Ro5cs0mQ9QRysoJH1VqPPs2Vbn9sgridwccJB 73+gbklh8qGbG8IpJIfILX/Dd72S7zEjZnWAZnJnIbtKUQdCx6UT9fvOwbvQaEBn0AjC bOvdhijjdiFkMh6V6yYREH3II8vPxWAAp2Y4saH38Ue0RkZe3IBVYrw/tSUzbgAvVYZI xOWg== 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 l4si5841688ejr.97.2020.05.12.20.18.47; Tue, 12 May 2020 20:19:16 -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 S1726813AbgEMDQj (ORCPT + 99 others); Tue, 12 May 2020 23:16:39 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4400 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725898AbgEMDQi (ORCPT ); Tue, 12 May 2020 23:16:38 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2437A48CDD2EC4FFADEA; Wed, 13 May 2020 11:16:36 +0800 (CST) Received: from [127.0.0.1] (10.166.213.93) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Wed, 13 May 2020 11:16:34 +0800 Subject: Re: [PATCH v2] ACPI/IORT: Fix PMCG node always look for a single ID mapping. To: Tuan Phan CC: , Lorenzo Pieralisi , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , , , References: <1589327760-5464-1-git-send-email-tuanphan@os.amperecomputing.com> From: Hanjun Guo Message-ID: <6f9996d3-18f1-0432-0e59-adc2cf086c9c@huawei.com> Date: Wed, 13 May 2020 11:16:33 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1589327760-5464-1-git-send-email-tuanphan@os.amperecomputing.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.166.213.93] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) > + return -EINVAL; > + > return 0; > default: > return -EINVAL; With my comments addressed, Reviewed-by: Hanjun Guo