public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH kernel] add fix for regression causing broken power indicators/LEDs
@ 2024-07-26  9:06 Fiona Ebner
  2024-09-04  7:49 ` Alexander Zeidler
  2024-09-05 10:04 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2024-07-26  9:06 UTC (permalink / raw)
  To: pve-devel

The issue was reported in the enterprise support. The customer
contacted the ledmon maintainer, who found that it is not an issue
with ledmon, bisected the kernel and came up with this fix.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 ...n-Power-Indicator-bits-for-userspace.patch | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 patches/kernel/0021-PCI-pciehp-Retain-Power-Indicator-bits-for-userspace.patch

diff --git a/patches/kernel/0021-PCI-pciehp-Retain-Power-Indicator-bits-for-userspace.patch b/patches/kernel/0021-PCI-pciehp-Retain-Power-Indicator-bits-for-userspace.patch
new file mode 100644
index 0000000..7b94bcf
--- /dev/null
+++ b/patches/kernel/0021-PCI-pciehp-Retain-Power-Indicator-bits-for-userspace.patch
@@ -0,0 +1,56 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Blazej Kucman <blazej.kucman@intel.com>
+Date: Mon, 22 Jul 2024 16:14:40 +0200
+Subject: [PATCH] PCI: pciehp: Retain Power Indicator bits for userspace
+ indicators
+
+The sysfs "attention" file normally controls the Slot Control Attention
+Indicator with 0 (off), 1 (on), 2 (blink) settings.
+
+576243b3f9ea ("PCI: pciehp: Allow exclusive userspace control of
+indicators") added pciehp_set_raw_indicator_status() to allow userspace to
+directly control all four bits in both the Attention Indicator and the
+Power Indicator fields via the "attention" file.
+
+This is used on Intel VMD bridges so utilities like "ledmon" can use sysfs
+"attention" to control up to 16 indicators for NVMe device RAID status.
+
+abaaac4845a0 ("PCI: hotplug: Use FIELD_GET/PREP()") broke this by masking
+the sysfs data with PCI_EXP_SLTCTL_AIC, which discards the upper two bits
+intended for the Power Indicator Control field (PCI_EXP_SLTCTL_PIC).
+
+For NVMe devices behind an Intel VMD, ledmon settings that use the
+PCI_EXP_SLTCTL_PIC bits, i.e., ATTENTION_REBUILD (0x5), ATTENTION_LOCATE
+(0x7), ATTENTION_FAILURE (0xD), ATTENTION_OFF (0xF), no longer worked
+correctly.
+
+Mask with PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC to retain both the
+Attention Indicator and the Power Indicator bits.
+
+Fixes: abaaac4845a0 ("PCI: hotplug: Use FIELD_GET/PREP()")
+Link: https://lore.kernel.org/r/20240722141440.7210-1-blazej.kucman@intel.com
+Signed-off-by: Blazej Kucman <blazej.kucman@intel.com>
+[bhelgaas: commit log]
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Cc: stable@vger.kernel.org	# v6.7+
+(picked from https://lore.kernel.org/linux-pci/20240722141440.7210-1-blazej.kucman@intel.com/T/#u)
+Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
+---
+ drivers/pci/hotplug/pciehp_hpc.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
+index b1d0a1b3917d..9d3c249207c4 100644
+--- a/drivers/pci/hotplug/pciehp_hpc.c
++++ b/drivers/pci/hotplug/pciehp_hpc.c
+@@ -485,7 +485,9 @@ int pciehp_set_raw_indicator_status(struct hotplug_slot *hotplug_slot,
+ 	struct pci_dev *pdev = ctrl_dev(ctrl);
+ 
+ 	pci_config_pm_runtime_get(pdev);
+-	pcie_write_cmd_nowait(ctrl, FIELD_PREP(PCI_EXP_SLTCTL_AIC, status),
++
++	/* Attention and Power Indicator Control bits are supported */
++	pcie_write_cmd_nowait(ctrl, FIELD_PREP(PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC, status),
+ 			      PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC);
+ 	pci_config_pm_runtime_put(pdev);
+ 	return 0;
-- 
2.39.2



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


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

* Re: [pve-devel] [PATCH kernel] add fix for regression causing broken power indicators/LEDs
  2024-07-26  9:06 [pve-devel] [PATCH kernel] add fix for regression causing broken power indicators/LEDs Fiona Ebner
@ 2024-09-04  7:49 ` Alexander Zeidler
  2024-09-05 10:04 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Zeidler @ 2024-09-04  7:49 UTC (permalink / raw)
  To: Proxmox VE development discussion

On Fri Jul 26, 2024 at 11:06 AM CEST, Fiona Ebner wrote:
> The issue was reported in the enterprise support. The customer
> contacted the ledmon maintainer, who found that it is not an issue
> with ledmon, bisected the kernel and came up with this fix.
>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  ...n-Power-Indicator-bits-for-userspace.patch | 56 +++++++++++++++++++
>  1 file changed, 56 insertions(+)
>  create mode 100644 patches/kernel/0021-PCI-pciehp-Retain-Power-Indicator-bits-for-userspace.patch

Ping. Has been applied upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/pci/hotplug/pciehp_hpc.c?h=v6.11-rc6&id=5560a612c20d3daacbf5da7913deefa5c31742f4


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


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

* [pve-devel] applied: [PATCH kernel] add fix for regression causing broken power indicators/LEDs
  2024-07-26  9:06 [pve-devel] [PATCH kernel] add fix for regression causing broken power indicators/LEDs Fiona Ebner
  2024-09-04  7:49 ` Alexander Zeidler
@ 2024-09-05 10:04 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-09-05 10:04 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 26/07/2024 um 11:06 schrieb Fiona Ebner:
> The issue was reported in the enterprise support. The customer
> contacted the ledmon maintainer, who found that it is not an issue
> with ledmon, bisected the kernel and came up with this fix.
> 
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  ...n-Power-Indicator-bits-for-userspace.patch | 56 +++++++++++++++++++
>  1 file changed, 56 insertions(+)
>  create mode 100644 patches/kernel/0021-PCI-pciehp-Retain-Power-Indicator-bits-for-userspace.patch
> 
>

applied a cherry-pick of this, as the patch numbers recently changed.

But I took over your commit message and referenced you through an
Orginally-by trailer, I hope that was alright, thanks!


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


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

end of thread, other threads:[~2024-09-05 10:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-26  9:06 [pve-devel] [PATCH kernel] add fix for regression causing broken power indicators/LEDs Fiona Ebner
2024-09-04  7:49 ` Alexander Zeidler
2024-09-05 10:04 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal