FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 04-27-2010, 03:27 AM
Alex Chiang
 
Default SRU: pci: Ensure we re-enable devices on resume

BugLink: http://bugs.launchpad.net/bugs/566149

SRU justification:
The original patch which added the check in pci_set_power_state was a
minor thinko, and prevented platform resume code from running. This patch
removes the incorrect check, allowing platform resume code to run, thus
re-enabling devices such as USB ports.

Backport of upstream commit:

commit cc2893b6af5265baa1d68b17b136cffca9e40cfa
Author: Matthew Garrett <mjg@redhat.com>
Date: Thu Apr 22 09:30:51 2010 -0400

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.

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>

Signed-off-by: Alex Chiang <achiang@canonical.com>
---
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e5f3f1c..579dcf5 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -591,7 +591,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) ;
@@ -628,10 +628,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

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 04-27-2010, 09:51 AM
Tim Gardner
 
Default SRU: pci: Ensure we re-enable devices on resume

On 04/27/2010 04:27 AM, Alex Chiang wrote:
> BugLink: http://bugs.launchpad.net/bugs/566149
>
> SRU justification:
> The original patch which added the check in pci_set_power_state was a
> minor thinko, and prevented platform resume code from running. This patch
> removes the incorrect check, allowing platform resume code to run, thus
> re-enabling devices such as USB ports.
>
> Backport of upstream commit:
>
> commit cc2893b6af5265baa1d68b17b136cffca9e40cfa
> Author: Matthew Garrett<mjg@redhat.com>
> Date: Thu Apr 22 09:30:51 2010 -0400
>
> 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.
>
> 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>
>
> Signed-off-by: Alex Chiang<achiang@canonical.com>
> ---
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index e5f3f1c..579dcf5 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -591,7 +591,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) ;
> @@ -628,10 +628,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
>

This looks like it is also appropriate for Lucid as well as
stable@kernel.org, right?

Acked-by: Tim Gardner <tim.gardner@canonical.com>

rtg
--
Tim Gardner tim.gardner@canonical.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 04-27-2010, 10:35 AM
Stefan Bader
 
Default SRU: pci: Ensure we re-enable devices on resume

Tim Gardner wrote:
> On 04/27/2010 04:27 AM, Alex Chiang wrote:
>> BugLink: http://bugs.launchpad.net/bugs/566149
>>
>> SRU justification:
>> The original patch which added the check in pci_set_power_state was a
>> minor thinko, and prevented platform resume code from running. This patch
>> removes the incorrect check, allowing platform resume code to run, thus
>> re-enabling devices such as USB ports.
>>
>> Backport of upstream commit:
>>
>> commit cc2893b6af5265baa1d68b17b136cffca9e40cfa
>> Author: Matthew Garrett<mjg@redhat.com>
>> Date: Thu Apr 22 09:30:51 2010 -0400
>>
>> 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.
>>
>> 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>
>>
>> Signed-off-by: Alex Chiang<achiang@canonical.com>
>> ---
>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>> index e5f3f1c..579dcf5 100644
>> --- a/drivers/pci/pci.c
>> +++ b/drivers/pci/pci.c
>> @@ -591,7 +591,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) ;
>> @@ -628,10 +628,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
>>
>
> This looks like it is also appropriate for Lucid as well as
> stable@kernel.org, right?
>
> Acked-by: Tim Gardner <tim.gardner@canonical.com>
>
> rtg

If this is part of what was discussed yesterday on irc, this is going upstream
stable and through that to Lucid. Just for Karmic it needed a specific SRU as we
don't pick stable for that anymore.

Acked-by: Stefan Bader <stefan.bader@canonical.com>

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 04-27-2010, 01:22 PM
Alex Chiang
 
Default SRU: pci: Ensure we re-enable devices on resume

* Stefan Bader <stefan.bader@canonical.com>:
> Tim Gardner wrote:
> >
> > This looks like it is also appropriate for Lucid as well as
> > stable@kernel.org, right?
>
> If this is part of what was discussed yesterday on irc, this is
> going upstream stable and through that to Lucid. Just for
> Karmic it needed a specific SRU as we don't pick stable for
> that anymore.

Correct, for Lucid, we'll get it via -stable.

Thanks,
/ac


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 01:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org