Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp34734pxh; Thu, 7 Apr 2022 13:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV7jNxyZytndXsqdQoPhniw+F4xrBvjLM/h0RNmW75SDv7a1TjdOswDiRm0b1T0Sxa/NPq X-Received: by 2002:a17:90a:e7c8:b0:1c6:c3ac:893b with SMTP id kb8-20020a17090ae7c800b001c6c3ac893bmr17502361pjb.122.1649362200729; Thu, 07 Apr 2022 13:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362200; cv=none; d=google.com; s=arc-20160816; b=al+vXN6qE/RPC95zusabcHyXqbeCy4pyuJ11LTS5jwkghn/W+ZCtk5NjWFiP05NfrI ytmeK+LcvOeFVPLAbQAtNkaekiVgwfel7TwoCEzkO4GywOwNRPiMbD3NZvcweQ+vIq6K 652Sl3d9/fksICHhCPhn0o7Hju0y4e5F1Ix42/fZ78RU11jiL0ya4z9P/UFUQ3d7ulkp qgJZOuwNrlobBunz9DrzlKbGjQHFZ8+36Pqot7zIGsFbm72EP3rqXWtdtQJg0JHFJgFQ qw6igUnYoW3AzJYyrPnk6LeA9RDL++RfXf6b/r3xpEUAEkeN2W0zStjQzzxNU8cd/q6c rYPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=6quNG2htaIFWbU6nqMMYbCIZYbvcaBQ4euKKnuCCm30=; b=We5CphcrgHsC58Y6vKL1tDDZlvl9fgkZ3OhTWFi98/oUfkFYz3RzZEV4r0db0D59w7 E1dHguLvGQrun36FnZp0cRhsYA+0s0fPCHorv7Ynl3vrUmZURk2dkyDBoLdSy8gWOsiq u1X5axKgoOI03bit3Wl9vX6WXD0VZ/HdbGfs3MYWJVVTEWumH1+PKHjZfcj70Z9bhw2n QO5KhX8wkbz7W2qmeKy0MD4op/nwBRXCxiNJOvBhWcVeUaNjBIP8BrfFZGMOBoq0O08u 8xr2GtkdxYApWwpuZIPMgJmrExRoLCK49hynJZAhmsriISbKSUl+wM1EbdWkIJmBCYiu qgdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ib2H7AYJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id lb14-20020a17090b4a4e00b001cab382d4e3si2694260pjb.49.2022.04.07.13.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:10:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ib2H7AYJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E850A2BD6C6; Thu, 7 Apr 2022 12:32:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346638AbiDGRxV (ORCPT + 99 others); Thu, 7 Apr 2022 13:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346630AbiDGRxP (ORCPT ); Thu, 7 Apr 2022 13:53:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29B722EB35; Thu, 7 Apr 2022 10:51:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C510B82901; Thu, 7 Apr 2022 17:51:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05E26C385A0; Thu, 7 Apr 2022 17:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649353869; bh=cmP0BZ3fNUvcP7KxHKtR0yiNgwGpwH3espXWf6j0OxA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Ib2H7AYJZPo72aQsw1/OYImofH7OAeCmw1QztjPZCt5O7vxkDFE3uXOi5E3ORoV/K GHIbKSEdMghvbX/hZBM7JZxdjReU0uda2rUmEpwYxyRgZNtv7daLjG0NvC53UhnWSO lOr+jHVCnKOJR19X1z+r2NAlMzRtN6UzKqfxz+4AHbnWalXuJHl8a3CvsmJf65gXHc TrLgEGJD3Vgwv7EvremvCWzqboi9Tod94Y4FAGtJ+ICkXc7fNGUr0nEfJWkiW+ADSk Nz9CghzPAtZZ0CpoFIfYZEeKMvooc/1zoVfFxKkP64oNi7RFkuEYDDXui6ZlspGzxs K9/WHcmwdmfLQ== Date: Thu, 7 Apr 2022 12:51:07 -0500 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Linux PM , Linux PCI , Mika Westerberg Subject: Re: [PATCH v1 3/3] PCI: ACPI: PM: Power up devices in D3cold before scanning them Message-ID: <20220407175107.GA252647@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5729439.MhkbZ0Pkbq@kreacher> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Mon, Apr 04, 2022 at 05:25:04PM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The initial configuration of ACPI power resources on some systems > implies that some PCI devices on them are initially in D3cold. > > In some cases, especially for PCIe Root Ports, this is a "logical" > D3cold, meaning that the configuration space of the device is > accessible, but some of its functionality may be missing, but it > very well may be real D3cold, in which case the device will not > be accessible at all. However, the PCI bus type driver will need > to access its configuration space in order to enumerate it. > > To prevent possible device enumeration failures that may ensue as > a result of ACPI power resources being initially in the "off" > state, power up all children of the host bridge ACPI device object > that hold valid _ADR objects (which indicates that they will be > enumerated by the PCI bus type driver) and do that to all children > of the ACPI device objects corresponding to PCI bridges (including > PCIe ports). > > Signed-off-by: Rafael J. Wysocki Acked-by: Bjorn Helgaas > --- > drivers/acpi/pci_root.c | 2 ++ > drivers/pci/pci-acpi.c | 3 +++ > 2 files changed, 5 insertions(+) > > Index: linux-pm/drivers/acpi/pci_root.c > =================================================================== > --- linux-pm.orig/drivers/acpi/pci_root.c > +++ linux-pm/drivers/acpi/pci_root.c > @@ -927,6 +927,8 @@ struct pci_bus *acpi_pci_root_create(str > host_bridge->preserve_config = 1; > ACPI_FREE(obj); > > + acpi_dev_power_up_children_with_adr(device); > + > pci_scan_child_bus(bus); > pci_set_host_bridge_release(host_bridge, acpi_pci_root_release_info, > info); > Index: linux-pm/drivers/pci/pci-acpi.c > =================================================================== > --- linux-pm.orig/drivers/pci/pci-acpi.c > +++ linux-pm/drivers/pci/pci-acpi.c > @@ -1374,6 +1374,9 @@ void pci_acpi_setup(struct device *dev, > > acpi_pci_wakeup(pci_dev, false); > acpi_device_power_add_dependent(adev, dev); > + > + if (pci_is_bridge(pci_dev)) > + acpi_dev_power_up_children_with_adr(adev); > } > > void pci_acpi_cleanup(struct device *dev, struct acpi_device *adev) > > >