From b127bd55d9cd9d5b40278b30645669d6d46933bc Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Wed, 19 Aug 2009 10:57:31 +0900 Subject: [PATCH] PCI ASPM: do not clear enabled field by support field We must not clear bits in 'aspm_enabled' using 'aspm_support', or 'aspm_enabled' and 'aspm_default' might be different from the actual state. In addtion, 'aspm_default' should be intialized even if 'aspm_support' is 0. Acked-by: Shaohua Li Signed-off-by: Kenji Kaneshige Signed-off-by: Jesse Barnes --- drivers/pci/pcie/aspm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c index 3d27c97e0486..9759714f77e7 100644 --- a/drivers/pci/pcie/aspm.c +++ b/drivers/pci/pcie/aspm.c @@ -346,12 +346,12 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist) link->latency.l0s = max_t(u32, link->latency.l0s, l0s); link->latency.l1 = max_t(u32, link->latency.l1, l1); + /* Save default state */ + link->aspm_default = link->aspm_enabled; + if (!link->aspm_support) return; - link->aspm_enabled &= link->aspm_support; - link->aspm_default = link->aspm_enabled; - /* ENDPOINT states*/ list_for_each_entry(child, &linkbus->devices, bus_list) { int pos; -- 2.30.2