From eb1a1bfe9c6b73dc939d30ff9b7aec4792b70a42 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 27 Feb 2012 13:28:38 -0600 Subject: [PATCH 4/4] wct4xxp: 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/wct4xxp/base.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 7127561..d8be794 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -378,6 +378,11 @@ struct t4 { 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) { return (wc->t1e1) != 0; @@ -5072,6 +5077,11 @@ t4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) spin_lock_init(&wc->reglock); wc->devtype = (const struct devtype *)(ent->driver_data); + 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_octal(wc)) wc->numspans = 8; else if (wc->devtype->flags & FLAG_2PORT) -- 1.7.9.2