Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp533496ybk; Wed, 20 May 2020 06:01:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfvfGvELp4J7eezdlYv1nTzvoYRqQPxGkauLiK0A2VIB0rGOg2skXY8dqNDRfBRSV+DFGR X-Received: by 2002:a17:906:edd3:: with SMTP id sb19mr3474934ejb.39.1589979688441; Wed, 20 May 2020 06:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589979688; cv=none; d=google.com; s=arc-20160816; b=MsK0j0iIwYdbG+i69tzhWJRgsQdzsbfbkTK0cxAqI0z7pBaIx7DsKbPS8+plXQ295m QodwHRpNM99bgdoE2ybUijW7Z+uLgkYCfl5dDTmoIA7U+MT03B6CDJVvsVVfZ9CHu+5G DFllW+UOxQedXkXykC1GNaASJC0CpD+/fAmfZjTQi6TTL76j4T+U6sGWKsJFrj6NfGTb RcvBlzJoyRhSwh3ni85LL/KuA6gFKCcnPB7lvrxs5p6pni1DxRufUpMLrhhdquI9STUb bF/qNH6OTk7yw2XK7DItQzGMROX3vNWa8AkJq33nWQtL9WOD0aASefqpP41tPpwl94J+ vDnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UiUrVdc5E2Px/aYiqyrjxvHfooOVoMd/8rbnAUeKl20=; b=mUjDbH936W2lDQopE5CGMhoFQZ32pMomClCFwUQzHz5dm0P/YxacDbzfYkrDgCKqZj nlTDqXJsOyQegqdXJiS9ATTznj1px9trUivtwxCO4pPjNAonph0B8OXm5phDIRAN1fWE YG8HDzeJlaCZfGcQum6ln5nDZksx7etjwUFJ0asd4P7t8Z0ifEt5V0YZd0jjqXzvHFQI Z0opzkxrwzPtxzlcrOFx2KnS6G2l66bbbRhbZsNqlzt8FjpElMHOaxUSnAeA2fmRYn+O yx7ORSPVCyu2AzlrY/V3Q3KZDgPfoWTfTVF2Sye1xG9oW9nnnB6JDUDQw/elp6EHno+b 2Ynw== 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 r28si1568914edc.610.2020.05.20.06.01.04; Wed, 20 May 2020 06:01:28 -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 S1726916AbgETM6g (ORCPT + 99 others); Wed, 20 May 2020 08:58:36 -0400 Received: from foss.arm.com ([217.140.110.172]:55752 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbgETM6f (ORCPT ); Wed, 20 May 2020 08:58:35 -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 A917130E; Wed, 20 May 2020 05:58:34 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 246EE3F52E; Wed, 20 May 2020 05:58:33 -0700 (PDT) Date: Wed, 20 May 2020 13:58:23 +0100 From: Lorenzo Pieralisi To: Tuan Phan Cc: patches@amperecomputing.com, Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , Robin Murphy , Neil Leeder , Shameer Kolothum , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] ACPI/IORT: Fix PMCG node single ID mapping handling. Message-ID: <20200520125813.GA6906@e121166-lin.cambridge.arm.com> References: <1589570686-5780-1-git-send-email-tuanphan@os.amperecomputing.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1589570686-5780-1-git-send-email-tuanphan@os.amperecomputing.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 12:24:46PM -0700, Tuan Phan wrote: > An IORT PMCG node can have no ID mapping if its overflow interrupt is > wire based therefore the code that parses the PMCG node can not assume > the node will always have a single mapping present at index 0. > > Fix iort_get_id_mapping_index() by checking for an overflow interrupt > and mapping count. > > Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG"). Remove these periods in the $SUBJECT and commit references, I don't know why you keep adding them. Anyway - I don't know if it is too late for v5.8 but this patch is ready to be merged (minus the nits I have just mentioned). Lorenzo > Acked-by: Lorenzo Pieralisi > Reviewed-by: Hanjun Guo > Signed-off-by: Tuan Phan > --- > v1 -> v2: > - Use pmcg node to detect wired base overflow interrupt. > > v2 -> v3: > - Address Hanjun and Robin's comments. > > v3 -> v4: > - Update the title and description as mentioned by Lorenzo. > > 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..12bb70e 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 || node->mapping_count == 0) > + return -EINVAL; > + > return 0; > default: > return -EINVAL; > -- > 2.7.4 >