Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp328893rwe; Wed, 31 Aug 2022 03:40:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kntibVdUSVf4j0W1g/4V7gCDt5nLNOZmR/l0YajOia/2H9Mm1Jkk9VnyPqrJlO6cE4ADM X-Received: by 2002:a17:90b:4d12:b0:1f5:59e1:994f with SMTP id mw18-20020a17090b4d1200b001f559e1994fmr2600487pjb.217.1661942446289; Wed, 31 Aug 2022 03:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661942446; cv=none; d=google.com; s=arc-20160816; b=mS8sd4Gx37govEiykU3+YzwKbIZ0Qsv4Q+4/qpRzEEVUTUAe2jQQWSyK/noxkVoI3u If/vYNfz7Ne14xhGYoaFNfkJrrPHYC7xSN2VzO/KAh3WnIyJgUyjOfYvMgMJmFoxcUkS hcfIEpfaWmnFXkq3jhIKoU66OXIv094PKFR6gB/9+g+was4OtUIAyCs/gKXNgZX8coq/ 6A6gd3HVf7eB/WEi+yXhsGT5WbihHPFWon7NzABittcxdqd2duUrO1aO1H8nf70ojwg1 H2dvwN6ysGwzYsRF4BJYwoYwlFF3UFOLhTgeu2TLqw26IeLPlzd4MOxw9q5eh5fSnWAa k1/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=CLpopt9AavgI4HDWtgGbiN3CxW9uCYEKgXjW7KSK344=; b=kl2Z/7hA9KbBL5pNR+VpyrxzXlxe256Ul+NgGeF3MC6RIedclo1C11BxlQOiDEUEES Wgvz0hn22IBJxX94yMtm0epgJCv0MGY+jBk+IzRw5sBG5MegU5Tn8sKak1byl/GbNEcD gHJuQJIQmUcCsVIJzLv05S6HuvshW772g3ktP/BFjFZxT9bWSpEt0TLFvkhbUgWR5GCg 6nE71UDvyNZzpcKcfRMIX9lXKvRarjnJdZgP/3jOipEwJUXyVnIXaCcq8+iRjZcqdHRw NAsKxSK7A/EKuAdUbrOOdpvOAGdsyEu4/ZY9C6nh23qKXHmcqmHdujI46xDaU+ziYltq nD6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a655cc7000000b0041ce096d7b6si4477164pgt.393.2022.08.31.03.40.35; Wed, 31 Aug 2022 03:40:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbiHaKLy (ORCPT + 99 others); Wed, 31 Aug 2022 06:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbiHaKLs (ORCPT ); Wed, 31 Aug 2022 06:11:48 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 986DDB943B; Wed, 31 Aug 2022 03:11:43 -0700 (PDT) Received: from fraeml739-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MHg1R4Vbhz67yJP; Wed, 31 Aug 2022 18:11:07 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml739-chm.china.huawei.com (10.206.15.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 31 Aug 2022 12:11:41 +0200 Received: from localhost (10.202.226.42) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 31 Aug 2022 11:11:40 +0100 Date: Wed, 31 Aug 2022 11:11:39 +0100 From: Jonathan Cameron To: Robert Richter CC: Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams , "Bjorn Helgaas" , "Rafael J. Wysocki" , , , Len Brown , , Subject: Re: [PATCH 06/15] PCI/ACPI: Link host bridge to its ACPI fw node Message-ID: <20220831111139.0000560f@huawei.com> In-Reply-To: <20220831081603.3415-7-rrichter@amd.com> References: <20220831081603.3415-1-rrichter@amd.com> <20220831081603.3415-7-rrichter@amd.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.42] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 31 Aug 2022 10:15:54 +0200 Robert Richter wrote: > A lookup of a host bridge's corresponding acpi device (struct > acpi_device) is not possible, for example: > > adev = ACPI_COMPANION(&host_bridge->dev); > > This could be useful to find a host bridge's fwnode handle and to > determine and call additional host bridge ACPI parameters and methods > such as HID/CID or _UID. > > Make this work by linking the host bridge to its ACPI fw node. > > Signed-off-by: Robert Richter Seems sensible to me, though I'm not an expert in this are of the code. Reviewed-by: Jonathan Cameron > --- > drivers/acpi/pci_root.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c > index d57cf8454b93..846c979e4c29 100644 > --- a/drivers/acpi/pci_root.c > +++ b/drivers/acpi/pci_root.c > @@ -1083,6 +1083,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, > goto out_release_info; > > host_bridge = to_pci_host_bridge(bus->bridge); > + host_bridge->dev.fwnode = acpi_fwnode_handle(device); > if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)) > host_bridge->native_pcie_hotplug = 0; > if (!(root->osc_control_set & OSC_PCI_SHPC_NATIVE_HP_CONTROL))