all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-kernel bookworm-6.14 1/1] backport fix for passthrough for devices without PCI power management
@ 2025-07-22  9:56 Dominik Csapak
  2025-07-22  9:56 ` [pve-devel] [PATCH pve-kernel bookworm-6.8 " Dominik Csapak
  2025-07-22 12:03 ` [pve-devel] applied: [PATCH pve-kernel bookworm-6.14 " Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2025-07-22  9:56 UTC (permalink / raw)
  To: pve-devel

fixes broken start for virtual functions:

 kvm: -device vfio-pci,host=0000:07:10.0,id=hostpci0,bus=pci.0,addr=0x10: vfio 0000:07:10.0: error getting device from group 23: Permission denied
 Verify all devices in group 23 are bound to vfio-<bus> or pci-stub and not already in use

and for nvidia vgpu:
 kvm: -device vfio-pci,host=0000:21:00.4,id=hostpci0,bus=pci.0,addr=0x10: vfio 0000:21:00.4: error getting device info: Input/output error

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
this can probably be cherry picked for trixie

 ...me-PM-on-devices-that-don-t-support-.patch | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 patches/kernel/0014-PCI-Set-up-runtime-PM-on-devices-that-don-t-support-.patch

diff --git a/patches/kernel/0014-PCI-Set-up-runtime-PM-on-devices-that-don-t-support-.patch b/patches/kernel/0014-PCI-Set-up-runtime-PM-on-devices-that-don-t-support-.patch
new file mode 100644
index 0000000..3f271ef
--- /dev/null
+++ b/patches/kernel/0014-PCI-Set-up-runtime-PM-on-devices-that-don-t-support-.patch
@@ -0,0 +1,57 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Wed, 11 Jun 2025 18:31:16 -0500
+Subject: [PATCH] PCI: Set up runtime PM on devices that don't support PCI PM
+
+commit 4d4c10f763d7 ("PCI: Explicitly put devices into D0 when
+initializing") intended to put PCI devices into D0, but in doing so
+unintentionally changed runtime PM initialization not to occur on
+devices that don't support PCI PM.  This caused a regression in vfio-pci
+due to an imbalance with it's use.
+
+Adjust the logic in pci_pm_init() so that even if PCI PM isn't supported
+runtime PM is still initialized.
+
+Cc: Alex Williamson <alex.williamson@redhat.com>
+Reported-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
+Closes: https://lore.kernel.org/linux-pci/20250424043232.1848107-1-superm1@kernel.org/T/#m7e8929d6421690dc8bd6dc639d86c2b4db27cbc4
+Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+Closes: https://lore.kernel.org/linux-pci/20250424043232.1848107-1-superm1@kernel.org/T/#m40d277dcdb9be64a1609a82412d1aa906263e201
+Tested-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
+Fixes: 4d4c10f763d7 ("PCI: Explicitly put devices into D0 when initializing")
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+(backported from https://lore.kernel.org/all/20250611233117.61810-1-superm1@kernel.org/)
+Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
+---
+ drivers/pci/pci.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
+index 1358f4c17209..5d9208977665 100644
+--- a/drivers/pci/pci.c
++++ b/drivers/pci/pci.c
+@@ -3217,14 +3217,14 @@ void pci_pm_init(struct pci_dev *dev)
+ 	/* find PCI PM capability in list */
+ 	pm = pci_find_capability(dev, PCI_CAP_ID_PM);
+ 	if (!pm)
+-		return;
++		goto poweron;
+ 	/* Check device's ability to generate PME# */
+ 	pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc);
+ 
+ 	if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
+ 		pci_err(dev, "unsupported PM cap regs version (%u)\n",
+ 			pmc & PCI_PM_CAP_VER_MASK);
+-		return;
++		goto poweron;
+ 	}
+ 
+ 	dev->pm_cap = pm;
+@@ -3269,6 +3269,7 @@ void pci_pm_init(struct pci_dev *dev)
+ 	pci_read_config_word(dev, PCI_STATUS, &status);
+ 	if (status & PCI_STATUS_IMM_READY)
+ 		dev->imm_ready = 1;
++poweron:
+ 	pci_pm_power_up_and_verify_state(dev);
+ 	pm_runtime_forbid(&dev->dev);
+ 	pm_runtime_set_active(&dev->dev);
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-22 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-22  9:56 [pve-devel] [PATCH pve-kernel bookworm-6.14 1/1] backport fix for passthrough for devices without PCI power management Dominik Csapak
2025-07-22  9:56 ` [pve-devel] [PATCH pve-kernel bookworm-6.8 " Dominik Csapak
2025-07-22 11:29   ` [pve-devel] applied: " Thomas Lamprecht
2025-07-22 12:03 ` [pve-devel] applied: [PATCH pve-kernel bookworm-6.14 " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal