From e9430f239b7dc0beae0b1ea4d433be8bb9b16fcd Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 27 Feb 2012 13:28:38 -0600 Subject: [PATCH 3/4] wcte12xp, wctdm24xxp: 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. Signed-off-by: Shaun Ruffell --- drivers/dahdi/wctdm24xxp/base.c | 10 ++++++++++ drivers/dahdi/wcte12xp/base.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 07813da..5c1a49c 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -191,6 +191,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,11 @@ __wctdm_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) wc->vb.pdev = pdev; wc->vb.debug = &debug; + if (is_pcie(wc)) { + pci_disable_link_state(pdev->bus->self, PCIE_LINK_STATE_L0S | + PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM); + }; + if (is_hx8(wc)) { wc->vb.ops = &hx8_voicebus_operations; ret = voicebus_boot_init(&wc->vb, wc->board_name); diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c index 5771c01..650bdf8 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"; @@ -2790,6 +2795,11 @@ static int __devinit te12xp_init_one(struct pci_dev *pdev, const struct pci_devi } #endif /* CONFIG_VOICEBUS_ECREFERENCE */ + if (is_pcie(wc)) { + pci_disable_link_state(pdev->bus->self, PCIE_LINK_STATE_L0S | + PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM); + }; + snprintf(wc->name, sizeof(wc->name)-1, "wcte12xp%d", index); pci_set_drvdata(pdev, wc); wc->vb.ops = &voicebus_operations; -- 1.7.9.2