[dahdi-commits] sruffell: branch linux/2.6 r10566 - /linux/branches/2.6/drivers/dahdi/wct4xxp/

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Wed Mar 21 14:11:56 CDT 2012


Author: sruffell
Date: Wed Mar 21 14:11:53 2012
New Revision: 10566

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10566
Log:
wct4xxp: Add compile-time option to disable ASPM for PCIe devices.

Certain BIOSes appear to enable ASPM even though it is not fully supported by
the platform. Also, since the PCIe links for TDM cards are always in use it
does not make sense to allow them to transition to the disabled state.

Just turn off power management on the PCIe links completely. For more
information see http://lwn.net/Articles/449448/.

Internal-Issue-ID: DAHLIN-283
Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10558

Modified:
    linux/branches/2.6/drivers/dahdi/wct4xxp/base.c

Modified: linux/branches/2.6/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/branches/2.6/drivers/dahdi/wct4xxp/base.c?view=diff&rev=10566&r1=10565&r2=10566
==============================================================================
--- linux/branches/2.6/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/branches/2.6/drivers/dahdi/wct4xxp/base.c Wed Mar 21 14:11:53 2012
@@ -173,6 +173,15 @@
 /* #define CONFIG_FORCE_EXTENDED_RESET */
 /* #define CONFIG_NOEXTENDED_RESET */
 
+/*
+ * Uncomment the following definition in order to disable Active-State Power
+ * Management on the PCIe bridge for PCIe cards. This has been known to work
+ * around issues where the BIOS enables it on the cards even though the
+ * platform does not support it.
+ *
+ */
+/* #define CONFIG_WCT4XXP_DISABLE_ASPM */
+
 #if defined(CONFIG_FORCE_EXTENDED_RESET) && defined(CONFIG_NOEXTENDED_RESET)
 #error "You cannot define both CONFIG_FORCE_EXTENDED_RESET and " \
 		"CONFIG_NOEXTENDED_RESET."
@@ -377,6 +386,11 @@
 #endif	
 	struct spi_state st;
 };
+
+static inline bool is_pcie(const struct t4 *wc)
+{
+	return (wc->devtype->flags & FLAG_EXPRESS) > 0;
+}
 
 static inline bool has_e1_span(const struct t4 *wc)
 {
@@ -5075,6 +5089,13 @@
 	spin_lock_init(&wc->reglock);
 	wc->devtype = (const struct devtype *)(ent->driver_data);
 
+#ifdef CONFIG_WCT4XXP_DISABLE_ASPM
+	if (is_pcie(wc)) {
+		pci_disable_link_state(pdev->bus->self, PCIE_LINK_STATE_L0S |
+			PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM);
+	};
+#endif
+
 	if (is_octal(wc))
 		wc->numspans = 8;
 	else if (wc->devtype->flags & FLAG_2PORT)




More information about the dahdi-commits mailing list