From patchwork Fri Aug 13 15:27:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 119469 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7DFRawl014255 for ; Fri, 13 Aug 2010 15:27:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934522Ab0HMP1e (ORCPT ); Fri, 13 Aug 2010 11:27:34 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:35282 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934495Ab0HMP1d (ORCPT ); Fri, 13 Aug 2010 11:27:33 -0400 Received: from mcgrof by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) id 1OjwAK-0006jQ-IE; Fri, 13 Aug 2010 15:27:28 +0000 From: "Luis R. Rodriguez" To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, ath5k-devel@venema.h4ckr.net, linux-kernel@vger.kernel.org, Maxim Levitsky , David Quan , Matthew Garrett , Tim Gardner , Jussi Kivilinna , stable@kernel.org, "Luis R. Rodriguez" Subject: [PATCH] ath5k: disable ASPM L0s for all cards Date: Fri, 13 Aug 2010 11:27:28 -0400 Message-Id: <1281713248-25761-1-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.6.2.rc1.3.g81d3f Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 13 Aug 2010 15:27:37 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 0d5de25..373dcfe 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -476,6 +477,26 @@ ath5k_pci_probe(struct pci_dev *pdev, int ret; u8 csz; + /* + * L0s needs to be disabled on all ath5k cards. + * + * For distributions shipping with CONFIG_PCIEASPM (this will be enabled + * by default in the future in 2.6.36) this will also mean both L1 and + * L0s will be disabled when a pre 1.1 PCIe device is detected. We do + * know L1 works correctly even for all ath5k pre 1.1 PCIe devices + * though but cannot currently undue the effect of a blacklist, for + * details you can read pcie_aspm_sanity_check() and see how it adjusts + * the device link capability. + * + * It may be possible in the future to implement some PCI API to allow + * drivers to override blacklists for pre 1.1 PCIe but for now it is + * best to accept that both L0s and L1 will be disabled completely for + * distributions shipping with CONFIG_PCIEASPM rather than having this + * issue present. Motivation for adding this new API will be to help + * with power consumption for some of these devices. + */ + 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");