WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] acpiphp: assume device is in state D0 after powering

To: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] acpiphp: assume device is in state D0 after powering on a slot.
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Wed, 11 May 2011 17:00:32 +0100
Cc: linux-pci@xxxxxxxxxxxxxxx, Ian Campbell <ian.campbell@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>
Delivery-date: Wed, 11 May 2011 09:01:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110511084354.49eee757@jbarnes-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110511084354.49eee757@jbarnes-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Devices which do not support PCI configuration space based power
management may not otherwise be enabled.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel