From patchwork Wed May 11 16:00:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 776492 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4BG1vsp014662 for ; Wed, 11 May 2011 16:01:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756719Ab1EKQAj (ORCPT ); Wed, 11 May 2011 12:00:39 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:7932 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756692Ab1EKQAi (ORCPT ); Wed, 11 May 2011 12:00:38 -0400 X-IronPort-AV: E=Sophos;i="4.64,353,1301889600"; d="scan'208";a="147751239" Received: from ftlpmailmx01.citrite.net ([10.13.107.65]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/RC4-MD5; 11 May 2011 12:00:36 -0400 Received: from smtp01.ad.xensource.com (10.219.128.104) by smtprelay.citrix.com (10.13.107.65) with Microsoft SMTP Server id 8.3.137.0; Wed, 11 May 2011 12:00:36 -0400 Received: from cosworth.uk.xensource.com (cosworth.uk.xensource.com [10.80.16.52]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id p4BG0XLN027216; Wed, 11 May 2011 09:00:34 -0700 From: Ian Campbell To: Jesse Barnes CC: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com, Stefano Stabellini , 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> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <20110511084354.49eee757@jbarnes-desktop> References: <20110511084354.49eee757@jbarnes-desktop> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 11 May 2011 16:01:58 +0000 (UTC) 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) {