[lkml]   [2011]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[13/35] PCI hotplug: acpiphp: set current_state to D0 in register_slot
    2.6.33-longterm review patch.  If anyone has any objections, please let us know.


    From: Stefano Stabellini <>

    commit 47e9037ac16637cd7f12b8790ea7ce6680e42168 upstream.

    If a device doesn't support power management (pm_cap == 0) but it is
    acpi_pci_power_manageable() because there is a _PS0 method declared for
    it and _EJ0 is also declared for the slot then nobody is going to set
    current_state = PCI_D0 for this device. This is what I think it is

    /* here we do not set current_state because !pm_cap */
    /* platform_pci_power_manageable() calls acpi_pci_power_manageable that
    * returns true */
    /* acpi_pci_set_power_state gets called and does nothing because the
    * acpi device has _EJ0, see the comment "If the ACPI device has _EJ0,
    * ignore the device" */

    at this point if we refer to the commit message that introduced the
    comment above (10b3dcae0f275e2546e55303d64ddbb58cec7599), it is up to
    the hotplug driver to set the state to D0.
    However AFAICT the pci hotplug driver never does, in fact
    drivers/pci/hotplug/acpiphp_glue.c:register_slot sets the slot flags to
    (SLOT_ENABLED | SLOT_POWEREDON) but it does not set the pci device
    current state to PCI_D0.

    So my proposed fix is also to set current_state = PCI_D0 in
    Comments are very welcome.

    Signed-off-by: Stefano Stabellini <>
    Signed-off-by: Jesse Barnes <>
    Signed-off-by: Greg Kroah-Hartman <>

    drivers/pci/hotplug/acpiphp_glue.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/drivers/pci/hotplug/acpiphp_glue.c
    +++ b/drivers/pci/hotplug/acpiphp_glue.c
    @@ -211,6 +211,7 @@ register_slot(acpi_handle handle, u32 lv

    pdev = pci_get_slot(pbus, PCI_DEVFN(device, function));
    if (pdev) {
    + pdev->current_state = PCI_D0;
    slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);

     \ /
      Last update: 2011-03-26 01:13    [W:0.021 / U:25.204 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site