From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH] acpiphp: assume device is in state D0 after powering on a slot. Date: Wed, 11 May 2011 17:00:32 +0100 Message-ID: <1305129632-2646-1-git-send-email-ian.campbell@citrix.com> References: <20110511084354.49eee757@jbarnes-desktop> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <20110511084354.49eee757@jbarnes-desktop> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jesse Barnes Cc: linux-pci@vger.kernel.org, Ian Campbell , xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Devices which do not support PCI configuration space based power management may not otherwise be enabled. Signed-off-by: Ian Campbell --- drivers/pci/hotplug/acpiphp_glue.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 2f67e9b..a70fa89 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -827,6 +827,13 @@ static int __ref enable_device(struct acpiphp_slot *slot) acpiphp_set_hpp_values(bus); acpiphp_set_acpi_region(slot); pci_enable_bridges(bus); + + list_for_each_entry(dev, &bus->devices, bus_list) { + /* Assume that newly added devices are powered on already. */ + if (!dev->is_added) + dev->current_state = PCI_D0; + } + pci_bus_add_devices(bus); list_for_each_entry(func, &slot->funcs, sibling) { -- 1.7.2.5