linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nirmal Patel <nirmal.patel@linux.intel.com>
To: nirmal.patel@linux.intel.com, <linux-pci@vger.kernel.org>
Subject: [PATCH] PCI: vmd: VMD to control Hotplug on its rootports
Date: Wed,  5 Jul 2023 13:20:38 -0400	[thread overview]
Message-ID: <20230705172038.844706-1-nirmal.patel@linux.intel.com> (raw)

The hotplug functionality is broken in various combinations of guest
OSes i.e. RHEL, SlES and hypervisors i.e. KVM and ESXI.

VMD enabled on Intel ADL cpus caused interrupt storm for smasung
drives due to AER being enabled on VMD controlled root ports.
The patch 04b12ef163d10e348db664900ae7f611b83c7a0e
("PCI: vmd: Honor APCI _OSC on PCIe features.") was added to the VMD
driver to correct the issue based on the following assumption:
	“Since VMD is an aperture to regular PCIe root ports, honor ACPI
	_OSC to disable PCIe features accordingly to resolve the issue.”
	Link: https://lore.kernel.org/r/20211203031541.1428904-1-kai.heng.feng@canonical.com

VMD as a PCIe device is an end point(type 0), not a PCIe aperture
(pcie bridge). In fact VMD is a type 0 raid controller(class code).
When BIOS boots, all root ports under VMD is inaccessible by BIOS, and
as such, they maintain their power on default states. The VMD UEFI DXE
driver loads and configure all devices under VMD. This is how AER,
power management and hotplug gets enabled in UEFI, since the BIOS pci
driver cannot access the root ports.

The patch worked around the interrupt storm by assigning the native
ACPI states to the  root ports under VMD. It assigns AER, hotplug,
PME, etc. These have been restored back to the power on default state
in guest OS, which says the root port hot plug enable is default OFF.
At most, the work around should have only assigned AER state.
An additional patch should be added to exclude hot plug from the
original patch.
This will cause hot plug to start working again in the guest, as the
settings implemented by the UEFI VMD DXE driver will remain in effect
in Linux.

Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
---
 drivers/pci/controller/vmd.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 769eedeb8802..52c2461b4761 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -701,8 +701,6 @@ static int vmd_alloc_irqs(struct vmd_dev *vmd)
 static void vmd_copy_host_bridge_flags(struct pci_host_bridge *root_bridge,
 				       struct pci_host_bridge *vmd_bridge)
 {
-	vmd_bridge->native_pcie_hotplug = root_bridge->native_pcie_hotplug;
-	vmd_bridge->native_shpc_hotplug = root_bridge->native_shpc_hotplug;
 	vmd_bridge->native_aer = root_bridge->native_aer;
 	vmd_bridge->native_pme = root_bridge->native_pme;
 	vmd_bridge->native_ltr = root_bridge->native_ltr;
-- 
2.31.1


             reply	other threads:[~2023-07-05 17:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 17:20 Nirmal Patel [this message]
2023-07-13 16:58 ` [PATCH] PCI: vmd: VMD to control Hotplug on its rootports Bjorn Helgaas
2023-07-13 19:26   ` Jonathan Derrick
2023-07-24 21:59     ` Patel, Nirmal
2023-07-19  2:00   ` Patel, Nirmal

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=20230705172038.844706-1-nirmal.patel@linux.intel.com \
    --to=nirmal.patel@linux.intel.com \
    --cc=linux-pci@vger.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).