From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D70CC433DF for ; Wed, 20 May 2020 17:27:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF13A208A7 for ; Wed, 20 May 2020 17:27:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W6D94fLo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF13A208A7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DvFYb724dMeMuooApTOX74Kk6FLyZ242rchAcj7wXsM=; b=W6D94fLoFa/CQ3 Mftb/OlRFalbps4TmBVJQQ9LV9zYpc8oinbjiQXYQwpUQ2GWIJo9o1TlJZFY26s+jk4F7wvjU/M4u B2v0ZueaIVpjFax4Eju/O+0E64zyJKy3QnAtZmwGUywHynlq966vLC0n5Pm3v7T6vdaAqX4HqWFwV pEDioFvjKB+/7SKUu/MeqFLfoO50QZuaPI/7VVv1o7rgSF5q9FJuYr+RSEfLa8FwJta8DTNwf4U83 l50k6uVSQ+uSm+gE/XQ3bW9gCYO2WUZlpXlgoQcSIWqFqf9XQruav9BTNvTprEPHgUEwYje1q8xyF LggfYR1AnBMWDCU+JPFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbSVT-00050L-6l; Wed, 20 May 2020 17:27:51 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbSVO-0004va-G7 for linux-arm-kernel@lists.infradead.org; Wed, 20 May 2020 17:27:47 +0000 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 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-Disposition: inline In-Reply-To: <1589994787-28637-1-git-send-email-tuanphan@os.amperecomputing.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200520_102746_592753_3BE7FDBF X-CRM114-Status: GOOD ( 20.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hanjun Guo , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Shameer Kolothum , linux-acpi@vger.kernel.org, Sudeep Holla , patches@amperecomputing.com, Robin Murphy , linux-arm-kernel@lists.infradead.org, Len Brown Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel