linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>, "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>,
	Taku Izumi <izumi.taku@jp.fujitsu.com>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	stable@kernel.org
Subject: [PATCH] PCI: Remove not needed check in disable aspm link
Date: Mon, 18 Mar 2013 10:37:06 -0700	[thread overview]
Message-ID: <1363628226-6679-1-git-send-email-yinghai@kernel.org> (raw)
In-Reply-To: <CAE9FiQXmeb66dc8fET0y99BjqpUXp11c7utiQ5keR1Wf+N9xaA@mail.gmail.com>

Roman reported ath5k does not work anymore on 3.8.
Bisected to
| commit 8c33f51df406e1a1f7fa4e9b244845b7ebd61fa6
| Author: Taku Izumi <izumi.taku@jp.fujitsu.com>
| Date:   Tue Oct 30 15:27:13 2012 +0900
|
|    PCI/ACPI: Request _OSC control before scanning PCI root bus
|
|    This patch moves up the code block to request _OSC control in order to
|    separate ACPI work and PCI work in acpi_pci_root_add().

It make pci_disable_link_state does not work anymore as acpi_disabled
is set before pci root bus scanning.
It will skip that in quirks and pcie_aspm_sanity_check.

We could revert to old logic, but that will make booting path and hotplug
path with different aspm_disabled again.

Acctually we don't need to check aspm_disabled in disable link, as
we already have protection about link state following.

https://bugzilla.kernel.org/show_bug.cgi?id=55211
http://article.gmane.org/gmane.linux.kernel.pci/20640

Need it for 3.8 stable.

Reported-by: Roman Yepishev <roman.yepishev@gmail.com>
Bisected-by: Roman Yepishev <roman.yepishev@gmail.com>
Tested-by: Roman Yepishev <roman.yepishev@gmail.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Taku Izumi <izumi.taku@jp.fujitsu.com>
Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: stable@kernel.org

---
 drivers/pci/pcie/aspm.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

Index: linux-2.6/drivers/pci/pcie/aspm.c
===================================================================
--- linux-2.6.orig/drivers/pci/pcie/aspm.c
+++ linux-2.6/drivers/pci/pcie/aspm.c
@@ -493,15 +493,6 @@ static int pcie_aspm_sanity_check(struct
 			return -EINVAL;
 
 		/*
-		 * If ASPM is disabled then we're not going to change
-		 * the BIOS state. It's safe to continue even if it's a
-		 * pre-1.1 device
-		 */
-
-		if (aspm_disabled)
-			continue;
-
-		/*
 		 * Disable ASPM for pre-1.1 PCIe device, we follow MS to use
 		 * RBER bit to determine if a function is 1.1 version device
 		 */
@@ -718,15 +709,11 @@ void pcie_aspm_powersave_config_link(str
  * pci_disable_link_state - disable pci device's link state, so the link will
  * never enter specific states
  */
-static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem,
-				     bool force)
+static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
 {
 	struct pci_dev *parent = pdev->bus->self;
 	struct pcie_link_state *link;
 
-	if (aspm_disabled && !force)
-		return;
-
 	if (!pci_is_pcie(pdev))
 		return;
 
@@ -757,13 +744,13 @@ static void __pci_disable_link_state(str
 
 void pci_disable_link_state_locked(struct pci_dev *pdev, int state)
 {
-	__pci_disable_link_state(pdev, state, false, false);
+	__pci_disable_link_state(pdev, state, false);
 }
 EXPORT_SYMBOL(pci_disable_link_state_locked);
 
 void pci_disable_link_state(struct pci_dev *pdev, int state)
 {
-	__pci_disable_link_state(pdev, state, true, false);
+	__pci_disable_link_state(pdev, state, true);
 }
 EXPORT_SYMBOL(pci_disable_link_state);
 
@@ -781,7 +768,7 @@ void pcie_clear_aspm(struct pci_bus *bus
 		__pci_disable_link_state(child, PCIE_LINK_STATE_L0S |
 					 PCIE_LINK_STATE_L1 |
 					 PCIE_LINK_STATE_CLKPM,
-					 false, true);
+					 false);
 	}
 }
 

  reply	other threads:[~2013-03-18 17:37 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-55211-13546@https.bugzilla.kernel.org/>
     [not found] ` <20130317155023.5B2EB11FB81@bugzilla.kernel.org>
2013-03-17 17:19   ` [Bug 55211] pci_disable_link_state PCIE_LINK_STATE_L0S no longer disables ASPM for ath5k Yinghai Lu
2013-03-18 17:37     ` Yinghai Lu [this message]
2013-03-27 22:56       ` [PATCH] PCI: Remove not needed check in disable aspm link Bjorn Helgaas
2013-03-28  7:41         ` Yinghai Lu
2013-03-28 12:46           ` Bjorn Helgaas
2013-03-28 20:21             ` Yinghai Lu
2013-03-28 20:24             ` Yinghai Lu
2013-03-28 20:24               ` Yinghai Lu
2013-03-29  3:22                 ` Bjorn Helgaas
     [not found]                   ` <CAE9FiQVu5QyxaKsYzzQoroQD=TvsziHzDOtoeg=FvhZ8HyN5yw@mail.gmail.com>
2013-03-29 12:24                     ` Bjorn Helgaas
2013-03-29 18:02                       ` Yinghai Lu
2013-03-29 18:04                         ` Yinghai Lu
2013-04-01 23:52                           ` Bjorn Helgaas
2013-04-02  0:03                             ` Yinghai Lu
2013-04-02 20:10                               ` Bjorn Helgaas
2013-06-12  6:20                                 ` Yinghai Lu
2013-06-12 17:05                                   ` Bjorn Helgaas
2013-06-12 19:41                                     ` Yinghai Lu
2013-06-13  3:50                                       ` Bjorn Helgaas
2013-06-13  4:11                                         ` Jiang Liu (Gerry)
2013-06-13 13:57                                           ` Bjorn Helgaas
2013-06-13  5:47                                         ` Yinghai Lu
2013-06-13 12:04                                           ` Rafael J. Wysocki
2013-06-14 14:11                                       ` Bjorn Helgaas
2013-06-14 16:17                                         ` Yinghai Lu
2013-06-14 16:33                                           ` Bjorn Helgaas
2013-06-14 16:57                                             ` Yinghai Lu
2013-06-14 17:44                                               ` Bjorn Helgaas
2013-06-14 18:26                                                 ` Yinghai Lu
2013-06-14 21:26                                                   ` Bjorn Helgaas
2013-06-14 21:30                                                     ` Matthew Garrett
2013-06-14 22:17                                                     ` Yinghai Lu
2013-06-14 22:27                                                       ` Matthew Garrett
2013-06-14 22:40                                                         ` Yinghai Lu
2013-06-14 22:48                                                           ` Matthew Garrett
2013-06-14 23:00                                                             ` Yinghai Lu
2014-06-14 21:21                                       ` [PATCH RFC 0/4] PCI: pciehp: Fix Command Completion handling Bjorn Helgaas
2014-06-14 21:21                                         ` [PATCH RFC 1/4] PCI: pciehp: Make pcie_wait_cmd() self-contained Bjorn Helgaas
2014-06-14 21:21                                         ` [PATCH RFC 2/4] PCI: pciehp: Wait for hotplug command completion lazily Bjorn Helgaas
2015-05-29 22:45                                           ` Alex Williamson
2015-06-01 21:43                                             ` Bjorn Helgaas
2015-06-01 22:02                                               ` Alex Williamson
2015-06-01 22:12                                                 ` Bjorn Helgaas
2014-06-14 21:21                                         ` [PATCH RFC 3/4] PCI: pciehp: Compute timeout from hotplug command start time Bjorn Helgaas
2014-06-15  2:18                                           ` Yinghai Lu
2014-06-17  0:13                                             ` Bjorn Helgaas
2014-06-17 17:33                                               ` Yinghai Lu
2014-06-14 21:21                                         ` [PATCH RFC 4/4] PCI: pciehp: Remove assumptions about which commands cause completion events Bjorn Helgaas
2014-06-17  3:25                                           ` Rajat Jain
2014-06-16  1:26                                         ` [PATCH RFC 0/4] PCI: pciehp: Fix Command Completion handling Rajat Jain
2014-08-15 22:05                                         ` Yinghai Lu
2014-08-15 23:35                                           ` Bjorn Helgaas
2013-04-02  0:10                             ` [PATCH] PCI: Remove not needed check in disable aspm link Rafael J. Wysocki
2013-03-29 18:11                   ` Roman Yepishev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363628226-6679-1-git-send-email-yinghai@kernel.org \
    --to=yinghai@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).