diff mbox

[1/7] PCI ASPM: do not clear enabled field by support field

Message ID 4A666796.4020100@jp.fujitsu.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Kenji Kaneshige July 22, 2009, 1:12 a.m. UTC
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.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

---
 drivers/pci/pcie/aspm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Shaohua Li July 23, 2009, 6:54 a.m. UTC | #1
On Wed, Jul 22, 2009 at 09:12:54AM +0800, Kenji Kaneshige wrote:
> 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.
In original implementation with aspm_default and aspm_support can help us check
if BIOS wrongly enables aspm. Do we still have such check with this change?

Thanks,
Shaohua
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kenji Kaneshige July 24, 2009, 2:30 a.m. UTC | #2
Shaohua Li wrote:
> On Wed, Jul 22, 2009 at 09:12:54AM +0800, Kenji Kaneshige wrote:
>> 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.
> In original implementation with aspm_default and aspm_support can help us check
> if BIOS wrongly enables aspm. Do we still have such check with this change?

Yes. This patch is to fixes this check. In the current implementation,
I don't think this check works properly because aspm_enable bit is
cleared using aspm_support. ASPM driver disables ASPM only when it
is set in aspm_enabled and it is cleared in specified state. So we
must not clear aspm_enable using aspm_support.

In addition, we don't need to clear bits in aspm_default for this
check. I think this just make confusion.

Thanks,
Kenji Kaneshige



--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: 20090721/drivers/pci/pcie/aspm.c
===================================================================
--- 20090721.orig/drivers/pci/pcie/aspm.c
+++ 20090721/drivers/pci/pcie/aspm.c
@@ -346,12 +346,12 @@  static void pcie_aspm_cap_init(struct pc
 	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;