rpms/kernel/devel linux-2.6-pci-fixup-resume.patch, NONE, 1.1 kernel.spec, 1.1975, 1.1976

Matthew Garrett mjg59 at fedoraproject.org
Thu Apr 22 18:02:28 UTC 2010


Author: mjg59

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv13388

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-pci-fixup-resume.patch 
Log Message:
* Thu Apr 22 2010 Matthew Garrett <mjg at redhat.com>
- linux-2.6-pci-fixup-resume.patch: make sure we enable power resources on D0


linux-2.6-pci-fixup-resume.patch:
 pci.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--- NEW FILE linux-2.6-pci-fixup-resume.patch ---
>From 1895a7a58cfe75c99c591a10433e46f1bd1bd092 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <mjg at redhat.com>
Date: Thu, 22 Apr 2010 09:26:56 -0400
Subject: [PATCH] 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.

Signed-off-by: Matthew Garrett <mjg at redhat.com>
---
 drivers/pci/pci.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 5ea587e..3749912 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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
-- 
1.7.0.1



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1975
retrieving revision 1.1976
diff -u -p -r1.1975 -r1.1976
--- kernel.spec	21 Apr 2010 17:11:52 -0000	1.1975
+++ kernel.spec	22 Apr 2010 18:02:27 -0000	1.1976
@@ -684,6 +684,7 @@ Patch570: linux-2.6-selinux-mprotect-che
 Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
 
 Patch600: linux-2.6-acpi-sleep-live-sci-live.patch
+Patch601: linux-2.6-pci-fixup-resume.patch
 
 Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
 
@@ -1248,6 +1249,7 @@ ApplyPatch linux-2.6-defaults-aspm.patch
 
 # ACPI
 ApplyPatch linux-2.6-acpi-sleep-live-sci-live.patch
+ApplyPatch linux-2.6-pci-fixup-resume.patch
 
 # ALSA
 ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
@@ -2019,6 +2021,9 @@ fi
 #                 ||     ||
 
 %changelog
+* Thu Apr 22 2010 Matthew Garrett <mjg at redhat.com>
+- linux-2.6-pci-fixup-resume.patch: make sure we enable power resources on D0
+
 * Wed Apr 21 2010 Chuck Ebbert <cebbert at redhat.com>
 - Linux 2.6.34-rc5-git1
 - New config option: CONFIG_QUOTA_DEBUG enabled for debug kernels



More information about the scm-commits mailing list