linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Kuppuswamy Sathyanarayanan  <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: ashok.raj@intel.com, knsathya@kernel.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH 5/5] PCI/ACPI: Centralize pci_aer_available() checking
Date: Wed, 25 Nov 2020 19:18:16 -0600	[thread overview]
Message-ID: <20201126011816.711106-6-helgaas@kernel.org> (raw)
In-Reply-To: <20201126011816.711106-1-helgaas@kernel.org>

From: Bjorn Helgaas <bhelgaas@google.com>

Check pci_aer_available() in acpi_pci_root_create() when we're interpreting
_OSC results so host_bridge->native_aer becomes the single way to determine
whether we control AER capabilities.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/acpi/pci_root.c         | 3 +++
 drivers/pci/pcie/portdrv_core.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 36142ed7b8f8..f9969b86d3b6 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -941,6 +941,9 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
 		host_bridge->native_dpc = 1;
 	}
 
+	if (!pci_aer_available())
+		host_bridge->native_aer = 0;
+
 	dev_info(&root->device->dev, "OS native features: SHPCHotplug%c PCIeHotplug%c PME%c AER%c DPC%c LTR%c\n",
 		FLAG(host_bridge->native_shpc_hotplug),
 		FLAG(host_bridge->native_pcie_hotplug),
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
index 2a1190e8db60..48c14c2471ef 100644
--- a/drivers/pci/pcie/portdrv_core.c
+++ b/drivers/pci/pcie/portdrv_core.c
@@ -220,7 +220,7 @@ static int get_port_device_capability(struct pci_dev *dev)
 	}
 
 #ifdef CONFIG_PCIEAER
-	if (host->native_aer && dev->aer_cap && pci_aer_available()) {
+	if (host->native_aer && dev->aer_cap) {
 		services |= PCIE_PORT_SERVICE_AER;
 
 		/*
-- 
2.25.1


  parent reply	other threads:[~2020-11-26  1:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-26  1:18 [PATCH v12 0/5] Simplify PCIe native ownership Bjorn Helgaas
2020-11-26  1:18 ` [PATCH 1/5] PCI/DPC: Ignore devices with no AER Capability Bjorn Helgaas
2020-11-26  2:01   ` Kuppuswamy, Sathyanarayanan
2020-11-28 20:24     ` Bjorn Helgaas
2020-11-28 21:49       ` Kuppuswamy, Sathyanarayanan
2020-11-28 21:53         ` Bjorn Helgaas
2020-11-28 21:56           ` Kuppuswamy, Sathyanarayanan
2020-11-28 23:25             ` Bjorn Helgaas
2020-11-29  4:32               ` Kuppuswamy, Sathyanarayanan
2020-12-01 15:34                 ` Bjorn Helgaas
2020-11-26  1:18 ` [PATCH 2/5] PCI: Assume control of portdrv-related features only when portdrv enabled Bjorn Helgaas
2020-11-26  1:18 ` [PATCH 3/5] PCI/ACPI: Tidy _OSC control bit checking Bjorn Helgaas
2020-11-26  1:18 ` [PATCH 4/5] PCI/ACPI: Centralize pcie_ports_native checking Bjorn Helgaas
2020-11-26  3:20   ` Kuppuswamy, Sathyanarayanan
2020-11-28 21:45     ` Bjorn Helgaas
2020-11-26  1:18 ` Bjorn Helgaas [this message]
2020-11-26  3:48 ` [PATCH v12 0/5] Simplify PCIe native ownership Kuppuswamy, Sathyanarayanan
2020-12-01  1:11   ` Kuppuswamy, Sathyanarayanan
2020-12-08  6:03     ` Kuppuswamy, Sathyanarayanan

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=20201126011816.711106-6-helgaas@kernel.org \
    --to=helgaas@kernel.org \
    --cc=ashok.raj@intel.com \
    --cc=bhelgaas@google.com \
    --cc=knsathya@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    /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).