From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C58B21FF15E for ; Fri, 26 Jul 2024 11:06:59 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 37C5C1B7B0; Fri, 26 Jul 2024 11:06:59 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 26 Jul 2024 11:06:21 +0200 Message-Id: <20240726090621.609116-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.060 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH kernel] add fix for regression causing broken power indicators/LEDs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "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 --- ...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 +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 +[bhelgaas: commit log] +Signed-off-by: Bjorn Helgaas +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 +--- + 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