On Thu, Aug 5, 2010 at 8:33 AM, Maxim Levitsky <maximlevit...@gmail.com> wrote:
> Atheros PCIe wireless cards handled by ath5k, don't work well with PCIe
> ASPM L0s enabled.
>
> For example,  Acer Aspire One (AOA150, Atheros Communications Inc. AR5001
> Wireless Network Adapter [168c:001c] (rev 01)) doesn't work well with ASPM
> enabled. With ASPM ath5k will eventually stall on heavy traffic with often
> 'unsupported jumbo' warnings appearing. Disabling ASPM L0s in ath5k fixes
> these problems.
>
> Also card sends a storm of RXORN interrupts even though medium is idle.
> According to vendor, all PCIe ath5k supported cards should have L0s disabled.
> Also, its safe to reenable L1, even if device is pre 1.1 PCIe device, in 
> which case
> kernel ASPM code unconditionaly disables L0s/L1.
>
> you must have CONFIG_PCIEASPM enabled, or otherwise this patch reduces to 
> no-op.
> Note that usually this patch will do nothing anyway, because as soon as 
> CONFIG_PCIEASPM
> is enabled, Linux will usualy disable ASPM on this device due to it beeing a 
> 'Legacy' PCIE
> device. This patch ensures that L0s is always disabled regardless of that 
> 'Legacy' setting
>
> All credit for finding and fixing that bug,
> goes to Jussi Kivilinna <jussi.kivili...@mbnet.fi>
>
>
> Signed-off-by: Maxim Levitsky <maximlevit...@gmail.com>
> ---
>  drivers/net/wireless/ath/ath5k/base.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c 
> b/drivers/net/wireless/ath/ath5k/base.c
> index 648972d..d691325 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>
> @@ -472,6 +473,18 @@ 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.
> +        * According to vendor, indeed L0s must be disabled.
> +        * 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");

Acked-by: Luis R. Rodriguez <lrodrig...@atheros.com>

Please repost to linux-wireless and address Linville. Also Cc
sta...@kernel.org on the commit log entry.

  Luis
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to