linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: linux-pci@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org, Keith Busch <keith.busch@intel.com>,
	Sinan Kaya <okaya@codeaurora.org>, Lukas Wunner <lukas@wunner.de>,
	Frederick Lawler <fred@fredlawl.com>
Subject: [PATCH v2 13/13] PCI/portdrv: Rename and reverse sense of pcie_ports_auto
Date: Fri, 09 Mar 2018 13:01:05 -0600	[thread overview]
Message-ID: <152062205984.77693.16740685304948811604.stgit@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <152062141493.77693.9630397416694091342.stgit@bhelgaas-glaptop.roam.corp.google.com>

From: Bjorn Helgaas <bhelgaas@google.com>

The platform may restrict the OS's use of PCIe services, e.g., via the ACPI
_OSC method.  The user may use "pcie_ports=native" to force the port driver
to use PCIe services even if the platform asked us not to.

The "pcie_ports=native" parameter determines the setting of
pcie_ports_auto.  Rename this to pcie_ports_native and reverse the
sense to simplify the code.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pcie/portdrv.h      |    2 +-
 drivers/pci/pcie/portdrv_core.c |   15 ++++-----------
 drivers/pci/pcie/portdrv_pci.c  |   10 +++++-----
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
index 62e28b5afa51..3e0058a5500f 100644
--- a/drivers/pci/pcie/portdrv.h
+++ b/drivers/pci/pcie/portdrv.h
@@ -12,7 +12,7 @@
 
 #include <linux/compiler.h>
 
-extern bool pcie_ports_auto;
+extern bool pcie_ports_native;
 
 /* Service Type */
 #define PCIE_PORT_SERVICE_PME_SHIFT	0	/* Power Management Event */
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index ed24a407518a..a1f838f2646a 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -193,17 +193,10 @@ static int pcie_init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
 static int get_port_device_capability(struct pci_dev *dev)
 {
 	struct pci_host_bridge *host = pci_find_host_bridge(dev->bus);
-	bool native;
 	int services = 0;
 
-	/*
-	 * If the user specified "pcie_ports=native", use the PCIe services
-	 * regardless of whether the platform has given us permission.  On
-	 * ACPI systems, this means we ignore _OSC.
-	 */
-	native = !pcie_ports_auto;
-
-	if (dev->is_hotplug_bridge && (native || host->use_hotplug)) {
+	if (dev->is_hotplug_bridge &&
+	    (pcie_ports_native || host->use_hotplug)) {
 		services |= PCIE_PORT_SERVICE_HP;
 
 		/*
@@ -215,7 +208,7 @@ static int get_port_device_capability(struct pci_dev *dev)
 	}
 
 	if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR) &&
-	    pci_aer_available() && (native || host->use_aer)) {
+	    pci_aer_available() && (pcie_ports_native || host->use_aer)) {
 		services |= PCIE_PORT_SERVICE_AER;
 
 		/*
@@ -231,7 +224,7 @@ static int get_port_device_capability(struct pci_dev *dev)
 	 * those yet.
 	 */
 	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT &&
-	    (native || host->use_pme)) {
+	    (pcie_ports_native || host->use_pme)) {
 		services |= PCIE_PORT_SERVICE_PME;
 
 		/*
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
index 8b62192342ac..569fd636b3c4 100644
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -25,18 +25,18 @@
 bool pcie_ports_disabled;
 
 /*
- * If this switch is set, ACPI _OSC will be used to determine whether or not to
- * enable PCIe port native services.
+ * If the user specified "pcie_ports=native", use the PCIe services regardless
+ * of whether the platform has given us permission.  On ACPI systems, this
+ * means we ignore _OSC.
  */
-bool pcie_ports_auto = true;
+bool pcie_ports_native;
 
 static int __init pcie_port_setup(char *str)
 {
 	if (!strncmp(str, "compat", 6)) {
 		pcie_ports_disabled = true;
 	} else if (!strncmp(str, "native", 6)) {
-		pcie_ports_disabled = false;
-		pcie_ports_auto = false;
+		pcie_ports_native = true;
 	}
 
 	return 1;

  parent reply	other threads:[~2018-03-09 19:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 18:59 [PATCH v2 00/13] PCI: Simplify PCIe port driver Bjorn Helgaas
2018-03-09 18:59 ` [PATCH v2 01/13] PCI/portdrv: Merge pcieport_if.h into portdrv.h Bjorn Helgaas
2018-03-12  7:59   ` Christoph Hellwig
2018-03-09 19:00 ` [PATCH v2 02/13] PCI/PM: Move pcie_clear_root_pme_status() to core Bjorn Helgaas
2018-03-12  8:00   ` Christoph Hellwig
2018-03-09 19:00 ` [PATCH v2 03/13] PCI/PM: Clear PCIe PME Status bit in core, not PCIe port driver Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 04/13] PCI/PM: Clear PCIe PME Status bit for Root Complex Event Collectors Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 05/13] PCI/portdrv: Disable port driver in compat mode Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 06/13] PCI/portdrv: Remove pcie_port_bus_type link order dependency Bjorn Helgaas
2018-03-12  8:01   ` Christoph Hellwig
2018-03-12 14:17     ` Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 07/13] PCI/portdrv: Remove unused PCIE_PORT_SERVICE_VC Bjorn Helgaas
2018-03-12  8:02   ` Christoph Hellwig
2018-03-09 19:00 ` [PATCH v2 08/13] PCI/portdrv: Simplify PCIe feature permission checking Bjorn Helgaas
2018-03-12  8:04   ` Christoph Hellwig
2018-03-12 14:03     ` Bjorn Helgaas
2018-03-12 14:20       ` Lukas Wunner
2018-03-19 18:37         ` Bjorn Helgaas
2019-05-07 12:00   ` David Woodhouse
2019-05-07 12:49     ` Bjorn Helgaas
2019-05-07 13:02       ` David Woodhouse
2019-05-07 14:07         ` Bjorn Helgaas
2019-05-08  6:45           ` David Woodhouse
2018-03-09 19:00 ` [PATCH v2 09/13] PCI/portdrv: Remove unnecessary include of <linux/pci-aspm.h> Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 10/13] PCI/portdrv: Remove "pcie_hp=nomsi" kernel parameter Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 11/13] PCI/portdrv: Remove unnecessary "pcie_ports=auto" parameter Bjorn Helgaas
2018-03-09 19:00 ` [PATCH v2 12/13] PCI/portdrv: Encapsulate pcie_ports_auto inside the port driver Bjorn Helgaas
2018-03-09 19:01 ` Bjorn Helgaas [this message]
2018-03-19 18:43 ` [PATCH v2 00/13] PCI: Simplify PCIe " Bjorn Helgaas

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=152062205984.77693.16740685304948811604.stgit@bhelgaas-glaptop.roam.corp.google.com \
    --to=helgaas@kernel.org \
    --cc=fred@fredlawl.com \
    --cc=keith.busch@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=okaya@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    /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).