diff mbox

acpiphp: assume device is in state D0 after powering on a slot.

Message ID 1305129632-2646-1-git-send-email-ian.campbell@citrix.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Ian Campbell May 11, 2011, 4 p.m. UTC
Devices which do not support PCI configuration space based power
management may not otherwise be enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Comments

Jesse Barnes May 11, 2011, 4:14 p.m. UTC | #1
On Wed, 11 May 2011 17:00:32 +0100
Ian Campbell <ian.campbell@citrix.com> wrote:

> Devices which do not support PCI configuration space based power
> management may not otherwise be enabled.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
>  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) {

applied to linux-next, thanks.
Ian Campbell May 12, 2011, 9:21 a.m. UTC | #2
On Wed, 2011-05-11 at 09:14 -0700, Jesse Barnes wrote:
> On Wed, 11 May 2011 17:00:32 +0100
> Ian Campbell <ian.campbell@citrix.com> wrote:
> 
> > Devices which do not support PCI configuration space based power
> > management may not otherwise be enabled.
[...]
> applied to linux-next, thanks.

Thanks Jesse.

Ian.
diff mbox

Patch

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) {