Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2606363ybk; Tue, 12 May 2020 03:44:53 -0700 (PDT) X-Google-Smtp-Source: APiQypIxf89wtgVPJn1SVD+lROnh8lqvbJfBXAIJHCWJ3HIRZapbkWCuVzq4aHHKPin+/vdrNGrX X-Received: by 2002:a17:907:2708:: with SMTP id w8mr11123079ejk.326.1589280293272; Tue, 12 May 2020 03:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589280293; cv=none; d=google.com; s=arc-20160816; b=cxUbKy2d3ZrYmzlNL2PHQRT8I3cSy0y/Q9Nueh86wumcrZMsDRr+1VkgNSLjJxu5aa s9Z2XRrRENn2qpbHiXpG8WepAltV+YCon0PNFET2cOpJjIeW918dy9vfGNRT9K9KZcoN zb27gA4gFeapW1OWj35a4/ZasNSqAp1pjXVHRRLXrYYeZIo0aOFbZrRy3xx1qgzN0tj9 oCoxYpg79IpBMtf3kBbdpOVLJIpvL4fpvFfbZ4txipjD0S/KZzUFSE8cJR5rHFEiLKp7 rVL2ysb0yXpcBk8BminMpgHiDaq78K1tVsCF68akzw/moO9cYKbmUkM6SDTFYIcsrt0R JXbQ== 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=nFmRwTpP+jvuIsKQgH5P0A8+qNnSwcTfZkO1Svkg4t8=; b=IcvJMxySKGeSullQDlEOev4Ma5RlUKWZvDUrVX4+qOc0M9zz+t5dLv91p6jYL1kmqf eFARgUHUBqI9/Sa+S+bFsEGrAIDqnBb9ap/VyouLkFxz/H72bbs043UVIxBusgG5A0q/ 0eLqWMVn8nNMZx/RY+9aJpSZVZU9iYbqQTuZ9/dGZ7kj/5l8Uea0ktW3vkeXIOuEymux IKQnYka6NbmPFP/a32MEBQbq3cKnYasqJZ5FzHhOZKHpCo28o1/8L6znQxWVSWx2rP8P rCuhU3d9td6YKFDR5nvhtD9avWEco45FWSIwAVtk8F0n1Opspz4K/gTwOcoYoJDbvltn T6cQ== 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 h11si8090484ejy.116.2020.05.12.03.44.29; Tue, 12 May 2020 03:44:53 -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 S1729461AbgELKkh (ORCPT + 99 others); Tue, 12 May 2020 06:40:37 -0400 Received: from foss.arm.com ([217.140.110.172]:52048 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729229AbgELKkh (ORCPT ); Tue, 12 May 2020 06:40:37 -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 B58071FB; Tue, 12 May 2020 03:40:36 -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 810FA3F71E; Tue, 12 May 2020 03:40:35 -0700 (PDT) Date: Tue, 12 May 2020 11:40:30 +0100 From: Lorenzo Pieralisi To: Tuan Phan Cc: patches@amperecomputing.com, Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ACPI/IORT: Fix PMCG node always look for a single ID mapping. Message-ID: <20200512104030.GA11555@e121166-lin.cambridge.arm.com> References: <1589228576-18053-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: <1589228576-18053-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 Mon, May 11, 2020 at 01:22:56PM -0700, 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 > --- > drivers/acpi/arm64/iort.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index ed3d2d1..72444e1 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -441,7 +441,9 @@ static int iort_get_id_mapping_index(struct acpi_iort_node *node) > > return smmu->id_mapping_index; > case ACPI_IORT_NODE_PMCG: > - return 0; > + if (node->mapping_count) > + return 0; Check struct acpi_iort_pmcg->overflow_gsiv to be coherent with SMMUv3 code. Lorenzo > + return -EINVAL; > default: > return -EINVAL; > } > -- > 2.7.4 >