From c79311de867866603b3c37000507da68b7b238cb Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Wed, 21 Mar 2012 16:33:57 +0000 Subject: 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 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10557 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wcte12xp/base.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/dahdi/wcte12xp/base.c') diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index a2f341f..1495161 100644 --- a/drivers/dahdi/wcte12xp/base.c +++ b/drivers/dahdi/wcte12xp/base.c @@ -99,6 +99,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"; static const char *vpmoct_name = "VPMOCT032"; @@ -2743,6 +2748,13 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi } #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; -- cgit v1.2.3