From patchwork Wed Dec 5 20:57:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 203951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2233A2C00EC for ; Thu, 6 Dec 2012 07:58:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754112Ab2LEU56 (ORCPT ); Wed, 5 Dec 2012 15:57:58 -0500 Received: from mail-gh0-f202.google.com ([209.85.160.202]:35002 "EHLO mail-gh0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754119Ab2LEU54 (ORCPT ); Wed, 5 Dec 2012 15:57:56 -0500 Received: by mail-gh0-f202.google.com with SMTP id z10so671231ghb.1 for ; Wed, 05 Dec 2012 12:57:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=+ICzr3F/ECLNbgpPn5S5+1r7+ZNfMbYz+GxlYQlaU4o=; b=TMpBq4glBRAaZwKA9HgKWLdo0oSEPziH8qr+Xj7m0un85I7yKU7CQxNtS3Xo1aqPlM NX08JFYRh2B9HN3SWkr0hmr+If7xU/snTfUXRPKlI//wCIzKJ1XE8lAcA+OxuREdGMjf wg7Wiw5kCd2ZEQ+wjS322F+C0efWCQJP8s3s920u4hOWTIRkoEzuuea2+/CXT6OYQHhj 5RbaEMUxvADgUufeS8QPdrrFy6ZvvUvHTPubWU0HW9tcrZICf2kWTTVj+qQCAJ9ax+JN tXBRIqrUUjI0xd8N90BKSysY5c5cD0DUnp+h1UX5coe4dOjsEgZ74r5OQwZ2AgD67JZR TxKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=+ICzr3F/ECLNbgpPn5S5+1r7+ZNfMbYz+GxlYQlaU4o=; b=eK+9/+XkVUgbltJHTzeE+t/Zlj5jg3cqo5FORb0HmgUzC7xm62Uiy3Q1pt72c9KnS0 eYVGxlbKDP5UFJRY1h7YWsnotJXk4p7uSUaNQQ9cmiQhJoYSQtkxWrtVTa/E8hPiAHbu GLyx0jqkTOGoP2pePyOAE8YO81KzHvoXC/LqPklaw6ysDi5ZK8rP+XeZuiy3qMytQYOA kwMc8VgWKBVc+gCe82Nu/uFQdcDCelvTyFWogoZncyrmsGqyJN7NF9AoEfW8ivghPZtH 3n2DXgEnLAsrTiKHp5CJKkT9iFXtCb7lm+YaZ/5aXv1ZNKcmuowMohsX6kcyqncblASB Sv5g== Received: by 10.236.193.106 with SMTP id j70mr12130086yhn.11.1354741076472; Wed, 05 Dec 2012 12:57:56 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i27si475068yhb.0.2012.12.05.12.57.56 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 05 Dec 2012 12:57:56 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.17.131.112]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 4E0D8100047; Wed, 5 Dec 2012 12:57:56 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 09CF9180280; Wed, 5 Dec 2012 12:57:56 -0800 (PST) Subject: [PATCH 07/12] e1000e: Use standard #defines for PCIe Capability ASPM fields To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Alex Duyck , e1000-devel@lists.sourceforge.net, Don Skidmore , Peter P Waskiewicz Jr , Bruce Allan , Jesse Brandeburg , Greg Rose , John Ronciak , Jeff Kirsher , Carolyn Wyborny Date: Wed, 05 Dec 2012 13:57:56 -0700 Message-ID: <20121205205755.13851.77284.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20121205205724.13851.50508.stgit@bhelgaas.mtv.corp.google.com> References: <20121205205724.13851.50508.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmgXAhO4czcH661gsPx2mYiBQ+6iPL7nEkLo4Y0VvwT7KwsGsJtqHQ7sHj9XsRXj2qpUYeJhk3QmRKF+9gEnJxA/5M/G1/umuheqGBImZfzOL4U+Z4ggPOqA8kpaMVT1H089TD0Woc4HiSMYHMyG4B5PxD4MGR83gK4tPHjqRIwv6tvfRKLgE/oxDrGMuobQoathSzuCWKUPApyLxahsCtsBFXGRA== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use the standard #defines for PCIe Capability ASPM fields. Previously we used PCIE_LINK_STATE_L0S and PCIE_LINK_STATE_L1 directly, but these are defined for the Linux ASPM interfaces, e.g., pci_disable_link_state(), and only coincidentally match the actual register bits. PCIE_LINK_STATE_CLKPM, also part of that interface, does not match the register bit. Signed-off-by: Bjorn Helgaas CC: Jeff Kirsher CC: Jesse Brandeburg CC: Bruce Allan CC: Carolyn Wyborny CC: Don Skidmore CC: Greg Rose CC: Peter P Waskiewicz Jr CC: Alex Duyck CC: John Ronciak CC: e1000-devel@lists.sourceforge.net --- drivers/net/ethernet/intel/e1000e/netdev.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index f444eb0..b8561ef 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5613,15 +5613,22 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) #else static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) { + u16 aspm_ctl = 0; + + if (state & PCIE_LINK_STATE_L0S) + aspm_ctl |= PCI_EXP_LNKCTL_ASPM_L0S; + if (state & PCIE_LINK_STATE_L1) + aspm_ctl |= PCI_EXP_LNKCTL_ASPM_L1; + /* * Both device and parent should have the same ASPM setting. * Disable ASPM in downstream component first and then upstream. */ - pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, state); + pcie_capability_clear_word(pdev, PCI_EXP_LNKCTL, aspm_ctl); if (pdev->bus->self) pcie_capability_clear_word(pdev->bus->self, PCI_EXP_LNKCTL, - state); + aspm_ctl); } #endif static void e1000e_disable_aspm(struct pci_dev *pdev, u16 state)