Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp730264ybk; Wed, 20 May 2020 10:29:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSiuCD/3LTdmjV1JYzQ4M4cAnkCVvsFRiomxIt6U08UuRRtFkwYRWaZ2chumQGnWQwXByf X-Received: by 2002:a17:907:39b:: with SMTP id ss27mr116061ejb.209.1589995772186; Wed, 20 May 2020 10:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589995772; cv=none; d=google.com; s=arc-20160816; b=zsfvlrUdF+VM7sslD0X82PpThPYZCoGg7WwN/GUplzZOxmFyiobYWP1aWt+n41CgbX nEEWe/ip3tJvXUm+3WxPvjdkJftqgaYRpCWLwTj1KlCevheQWPg/yrIMBiu+alu5bFBs sGk4p9zgSEE9aSFd9FAswQ61g2IOltMolkYC37GiAe8aTw0NM6lqXqr9aQAPV6ZSJAsN FIw4XHBHhoLTEka0r5uc4/NSIwOAVlgCmAz8vvhcqA5pOkc/8k/JJUFz4O03WEVGguFw G5DGf/MP38iDrWeZg4P0S/W9okHge64/UpY9okTsEklCFaN0DyeVmOwLFHKphoW8Mm6c +8Uw== 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=gyUyaC58TOpdK0I2YpFEf3BLc2Kmf6L9Q/19ThxvDtA=; b=jH7wAvWoq3V7bFWPGOrO3yXOxG50HAx009/61L2qpJNhcP6MjVfapMyUACJt7Sgiz9 EukiDzeMkdeKW0O6npRpFNcrTSqEYtLDkwTlGpbfFMwxIaTWlDKKvl92Jg3+HWqzPyBi yO6FShIW9DUgnSrC+O8+NwBlzAKQwP3+PevxkPPPMscVgng8kvzen1SGERFlbbWVEz2b I9rZk+RWwwHrDC7QQG2tTrs3dArqOlTI5SJ/MDmlV4OVthpApZWscd9J54G0enzXNw/u IzXQX12dB/Zo0FFueyXNfeyLjg8f5Wg/klNouRIhslJHuyi6BhWWI4kDppyTYBTrvcjK TNag== 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 x25si1909741edl.429.2020.05.20.10.29.09; Wed, 20 May 2020 10:29:32 -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 S1727833AbgETR1p (ORCPT + 99 others); Wed, 20 May 2020 13:27:45 -0400 Received: from foss.arm.com ([217.140.110.172]:60600 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbgETR1p (ORCPT ); Wed, 20 May 2020 13:27:45 -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 BE19730E; Wed, 20 May 2020 10:27:44 -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 D77FB3F305; Wed, 20 May 2020 10:27:42 -0700 (PDT) Date: Wed, 20 May 2020 18:27:36 +0100 From: Lorenzo Pieralisi To: Tuan Phan , will@kernel.org Cc: patches@amperecomputing.com, Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , Robin Murphy , Shameer Kolothum , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5] ACPI/IORT: Fix PMCG node single ID mapping handling Message-ID: <20200520172736.GA10693@e121166-lin.cambridge.arm.com> References: <1589994787-28637-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: <1589994787-28637-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 Wed, May 20, 2020 at 10:13:07AM -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") > > 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. > > v4 -> v5: > - Remove period in the title and commit references. > > drivers/acpi/arm64/iort.c | 5 +++++ Hi Will, is there a chance we can get this patch into v5.8 ? I understand we are very late in the cycle but I wanted to ask (it applies cleanly to for-next/acpi). Thanks ! Lorenzo > 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 >