pci: Ensure we re-enable devices on resume
PATCH 1/1 pci: Ensure we re-enable devices on resume
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.
--- drivers/pci/pci.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/pci/pci.c +1 -5
@@ -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);
@@ -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
Signature · 1 line
1.7.0.1
Quoted 7 lines · Matthew Garrett
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
OK ...
Quoted 19 lines
Signed-off-by Matthew Garrett <[email protected]>--- drivers/pci/pci.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)drivers/pci/pci.c +1
-1@@ -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);
drivers/pci/pci.c int pci_set_power_state(struct pci_dev *dev, pci_power_t state) · line 722
Quoted 7 lines
drivers/pci/pci.c +0
-4@@ -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 ; -
If my memory serves me right, this check is actually there for a reason, although I don't remember _what_ exactly the reason is right now. Sigh.
[/me puts a note for himself to _always_ add specific comments into the code
in such cases.]
drivers/pci/pci.c int pci_set_power_state(struct pci_dev *dev, pci_power_t state) · line 721
Quoted 4 lines
drivers/pci/pci.c +0
-0__pci_start_power_transition (dev, state);/* This device is quirked not to be put into D3, so
Well, I'd say let's try that. If it breaks things, we'll know relatively quickly. ;-)
Looks good to me. Thanks for doing this, Matthew.
/ac
* Matthew Garrett <[email protected]>:
Quoted 40 lines
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
Signed-off-by Matthew Garrett <[email protected]>--- drivers/pci/pci.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-)drivers/pci/pci.c +1
-5@@ -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);@@ -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 Signature · 1 line
1.7.0.1
Jesse Barnes
AppliedQuoted 10 lines · On Thu, 22 Apr 2010 09:30:51 -0400 Matthew Garrett <[email protected]> wrote:
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
Signed-off-by Matthew Garrett <[email protected]>---
Applied to for-linus, thanks.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
* Jesse Barnes <[email protected]>:
Quoted 9 lines
Quoted 6 lines · On Thu, 22 Apr 2010 09:30:51 -0400 Matthew Garrett <[email protected]> wrote:
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
Quoted 5 lines
Quoted 3 lines
Fixes USB not being powered after resume on recent Lenovo machines.
Signed-off-by Matthew Garrett <[email protected]>Applied to for-linus, thanks.
Thanks Jesse.
Stable, can you please pick this up too?
The original commit that introduced the thinko was 4a865905.
achiang@aspen:~/kernels/linux-2.6$ git describe --contains 4a865905 v2.6.30-rc1~609^2~4
which looks like it was introduced in 2.6.30, but I'd be happy with just hitting v2.6.32, since this is what just about every distro has settled on these days.
Thanks,
/ac
Quoted 12 lines · Alex Chiang
* Jesse Barnes <[email protected]>:
Quoted 11 lines
Quoted 8 lines · On Thu, 22 Apr 2010 09:30:51 -0400 Matthew Garrett <[email protected]> wrote:
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Matthew Garrett <[email protected]>Applied to for-linus, thanks.
Thanks Jesse.
Stable, can you please pick this up too?
When it goes into Linus's tree, yes. Care to let me know what the git commit id of it is when that happens?
thanks,
greg k-h
* Greg KH <[email protected]>:
Quoted 15 lines · Alex Chiang
Quoted 14 lines
* Jesse Barnes <[email protected]>:
Quoted 13 lines
Quoted 10 lines · Matthew Garrett
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Applied to for-linus, thanks.
Stable, can you please pick this up too?
When it goes into Linus's tree, yes. Care to let me know what the git commit id of it is when that happens?
commit cc2893b6af5265baa1d68b17b136cffca9e40cfa
Thanks!
/ac
Quoted 16 lines · Alex Chiang
* Greg KH <[email protected]>:
Quoted 15 lines · Alex Chiang
Quoted 14 lines
* Jesse Barnes <[email protected]>:
Quoted 13 lines
Quoted 10 lines · Matthew Garrett
If the firmware puts a device back into D0 state at resume time, we'll update its state in
resume_noirqand 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.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Applied to for-linus, thanks.
Stable, can you please pick this up too?
When it goes into Linus's tree, yes. Care to let me know what the git commit id of it is when that happens?
commit
cc2893b6af5265baa1d68b17b136cffca9e40cfa
Now queued up.
thanks,
greg k-h