diff mbox

[v3] ath5k: disable ASPM

Message ID 1276961564.5173.12.camel@maxim-laptop (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Maxim Levitsky June 19, 2010, 3:32 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 3abbe75..4f6bd7c 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -48,6 +48,7 @@ 
 #include <linux/netdevice.h>
 #include <linux/cache.h>
 #include <linux/pci.h>
+#include <linux/pci-aspm.h>
 #include <linux/ethtool.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
@@ -469,6 +470,19 @@  ath5k_pci_probe(struct pci_dev *pdev,
 	int ret;
 	u8 csz;
 
+	/*
+	 * Disable PCIE ASPM L0S on the card.
+	 * ASPM triggers hardware bug, that makes card stall transmission
+	 * untill reset, and even that doesn't always help.
+	 * This happens on meduim to heavy transmit utilization.
+	 * In addition to stall, hardware usually gives a storm of
+	 * RXORN interrupts, despite idle channel, and otherwise doesn't work.
+	 * Windows driver also disables the L0s ASPM,
+	 * probably due to same reason
+	 * Note: to benefit from this fix, please _enable_ CONFIG_PCIEASPM
+	 */
+	pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
+
 	ret = pci_enable_device(pdev);
 	if (ret) {
 		dev_err(&pdev->dev, "can't enable device\n");