Skip to content

Commit

Permalink
PCI: Ensure we re-enable devices on resume
Browse files Browse the repository at this point in the history
If the firmware puts a device back into D0 state at resume time, we'll
update its state in resume_noirq and thus skip the platform resume code.
Calling that code twice should be safe and we ought to avoid getting to
that point anyway, so remove the check and also allow the platform pci
code to be called for D0.

Fixes USB not being powered after resume on recent Lenovo machines.

Acked-by: Alex Chiang <achiang@canonical.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Matthew Garrett authored and Jesse Barnes committed Apr 22, 2010
1 parent 66528fd commit cc2893b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static void __pci_start_power_transition(struct pci_dev *dev, pci_power_t state)
*/
int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state)
{
return state > PCI_D0 ?
return state >= PCI_D0 ?
pci_platform_power_transition(dev, state) : -EINVAL;
}
EXPORT_SYMBOL_GPL(__pci_complete_power_transition);
Expand Down Expand Up @@ -716,10 +716,6 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
*/
return 0;

/* Check if we're already there */
if (dev->current_state == state)
return 0;

__pci_start_power_transition(dev, state);

/* This device is quirked not to be put into D3, so
Expand Down

0 comments on commit cc2893b

Please sign in to comment.