[dahdi-commits] sruffell: linux/trunk r10557 - in /linux/trunk/drivers/dahdi: voicebus/ wctdm...

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


Author: sruffell
Date: Wed Mar 21 11:33:57 2012
New Revision: 10557

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10557
Log:
wcte12xp, wctdm24xxp: 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>

Modified:
    linux/trunk/drivers/dahdi/voicebus/voicebus.h
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c
    linux/trunk/drivers/dahdi/wcte12xp/base.c

Modified: linux/trunk/drivers/dahdi/voicebus/voicebus.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/voicebus/voicebus.h?view=diff&rev=10557&r1=10556&r2=10557
==============================================================================
--- linux/trunk/drivers/dahdi/voicebus/voicebus.h (original)
+++ linux/trunk/drivers/dahdi/voicebus/voicebus.h Wed Mar 21 11:33:57 2012
@@ -56,6 +56,15 @@
 /* Define this to only run the processing in an interrupt handler
  * (and not tasklet). */
 #define CONFIG_VOICEBUS_INTERRUPT
+
+/*
+ * Enable 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.
+ *
+ */
+#undef CONFIG_VOICEBUS_DISABLE_ASPM
 
 /* Define this to use a FIFO for the software echocan reference.
  * (experimental) */

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=10557&r1=10556&r2=10557
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Wed Mar 21 11:33:57 2012
@@ -190,6 +190,11 @@
 static const struct wctdm_desc wcaex410 = { "Wildcard AEX410", FLAG_EXPRESS, 4 };
 static const struct wctdm_desc wcha80000 = { "HA8-0000", 0, 8 };
 static const struct wctdm_desc wchb80000 = { "HB8-0000", FLAG_EXPRESS, 8 };
+
+static inline bool is_pcie(const struct wctdm *wc)
+{
+	return (wc->desc->flags & FLAG_EXPRESS) > 0;
+}
 
 /**
  * Returns true if the card is one of the Hybrid Digital Analog Cards.
@@ -5679,6 +5684,13 @@
 	wc->vb.pdev = pdev;
 	wc->vb.debug = &debug;
 
+#ifdef CONFIG_VOICEBUS_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_hx8(wc)) {
 		wc->vb.ops = &hx8_voicebus_operations;
 		ret = voicebus_boot_init(&wc->vb, wc->board_name);

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=10557&r1=10556&r2=10557
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Wed Mar 21 11:33:57 2012
@@ -98,6 +98,11 @@
 static const struct t1_desc te120p = {"Wildcard TE120P"};
 static const struct t1_desc te122 = {"Wildcard TE122"};
 static const struct t1_desc te121 = {"Wildcard TE121"};
+
+static inline bool is_pcie(const struct t1 *t1)
+{
+	return (0 == strcmp(t1->variety, te121.name));
+}
 
 /* names of HWEC modules */
 static const char *vpmadt032_name = "VPMADT032";
@@ -2743,6 +2748,13 @@
 	}
 #endif /* CONFIG_VOICEBUS_ECREFERENCE */
 
+#ifdef CONFIG_VOICEBUS_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
+
 	snprintf(wc->name, sizeof(wc->name)-1, "wcte12xp%d", index);
 	pci_set_drvdata(pdev, wc);
 	wc->vb.ops = &voicebus_operations;




More information about the dahdi-commits mailing list