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.5 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=unavailable 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 3E487C433E0 for ; Mon, 29 Jun 2020 09:07:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 09FAF2339E for ; Mon, 29 Jun 2020 09:07:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RJgwmegw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09FAF2339E 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+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=merlin.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=YaEJdQIVD/hORmbdhibBcjpvaU3eGwhTwKlfMw+rRO4=; b=RJgwmegwqXa5OC2QeYDeTrREs 4tZQ2bH5j06Vezrnw8p47ozs37DdS3Oog71f9gJ835RWdNvVSDQe3aHaEG/f5Jvl/ljEFOztcQUw+ HQmSPav2i07IR5afLmxS3WJOFhqSu0GE/1IVKL/m1S6DW2HT90YyQv/RY0W0T0XbZ4ec4TdbLzULI o5pi/Blq7zpFSxG4ct8ONRt8zfGTAfN0uXv3FIdcg6jaf1bl9qg/DE6yUouvZK5k3o0pmDyIJx0q8 QuhhQlbHLzaSKNd+0I3J6ii0TDOuNia5G9PQuINDk9DKDhSeVHeWCTh8mY4IKgv4vnMwSTEDeNcyO Of5oHo3hg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jppjo-00041w-Q8; Mon, 29 Jun 2020 09:06:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jppjm-00041c-5k for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 09:06:03 +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 73384113E; Mon, 29 Jun 2020 02:06:00 -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 0412D3F71E; Mon, 29 Jun 2020 02:05:57 -0700 (PDT) Date: Mon, 29 Jun 2020 10:05:51 +0100 From: Lorenzo Pieralisi To: Hanjun Guo Subject: Re: [PATCH v2 01/12] ACPI/IORT: Make iort_match_node_callback walk the ACPI namespace for NC Message-ID: <20200629090551.GA28873@e121166-lin.cambridge.arm.com> References: <20200521130008.8266-1-lorenzo.pieralisi@arm.com> <20200619082013.13661-1-lorenzo.pieralisi@arm.com> <20200619082013.13661-2-lorenzo.pieralisi@arm.com> <718cae1f-2f33-f6d9-f278-157300b73116@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <718cae1f-2f33-f6d9-f278-157300b73116@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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: devicetree@vger.kernel.org, Marc Zyngier , Makarand Pawagi , linux-pci@vger.kernel.org, Catalin Marinas , Joerg Roedel , Diana Craciun , "Rafael J. Wysocki" , Robin Murphy , linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, Rob Herring , Sudeep Holla , Bjorn Helgaas , Will Deacon , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 29, 2020 at 12:24:43PM +0800, Hanjun Guo wrote: > Hi Lorenzo, > > On 2020/6/19 16:20, Lorenzo Pieralisi wrote: > > When the iort_match_node_callback is invoked for a named component > > the match should be executed upon a device with an ACPI companion. > > > > For devices with no ACPI companion set-up the ACPI device tree must be > > walked in order to find the first parent node with a companion set and > > check the parent node against the named component entry to check whether > > there is a match and therefore an IORT node describing the in/out ID > > translation for the device has been found. > > > > Signed-off-by: Lorenzo Pieralisi > > Cc: Will Deacon > > Cc: Hanjun Guo > > Cc: Sudeep Holla > > Cc: Catalin Marinas > > Cc: Robin Murphy > > Cc: "Rafael J. Wysocki" > > --- > > drivers/acpi/arm64/iort.c | 20 ++++++++++++++++++-- > > 1 file changed, 18 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > > index 28a6b387e80e..5eee81758184 100644 > > --- a/drivers/acpi/arm64/iort.c > > +++ b/drivers/acpi/arm64/iort.c > > @@ -264,15 +264,31 @@ static acpi_status iort_match_node_callback(struct acpi_iort_node *node, > > if (node->type == ACPI_IORT_NODE_NAMED_COMPONENT) { > > struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; > > - struct acpi_device *adev = to_acpi_device_node(dev->fwnode); > > + struct acpi_device *adev; > > struct acpi_iort_named_component *ncomp; > > + struct device *nc_dev = dev; > > + > > + /* > > + * Walk the device tree to find a device with an > > + * ACPI companion; there is no point in scanning > > + * IORT for a device matching a named component if > > + * the device does not have an ACPI companion to > > + * start with. > > + */ > > + do { > > + adev = ACPI_COMPANION(nc_dev); > > + if (adev) > > + break; > > + > > + nc_dev = nc_dev->parent; > > + } while (nc_dev); > > I'm lost here, we need the ACPI_COMPANION (the same as > to_acpi_device_node()) of the device, but why do we need to go > up to find the parent node? For devices that aren't described in the DSDT - IORT translations are determined by their ACPI parent device. Do you see/Have you found any issue with this approach ? > For a platform device, if I use its parent's full path name for > its named component entry, then it will match, but this will violate > the IORT spec. Can you elaborate on this please I don't get the point you are making. Thanks, Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel