summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi RongQing <lirongqing@baidu.com>2026-03-17 03:28:03 +0300
committerBjorn Helgaas <bhelgaas@google.com>2026-03-31 00:46:51 +0300
commit47e2a338222c902dc44f4f6e29eb236a68600ef4 (patch)
treea6aeb2bdfaa4313fd2c9bef11b1675a910bf2401
parent0026bb20d12531ca2925b60bf081cc8be910ccf9 (diff)
downloadlinux-47e2a338222c902dc44f4f6e29eb236a68600ef4.tar.xz
PCI/sysfs: Suppress FW_BUG warning when NUMA node already matches
The numa_node sysfs interface allows users to manually override a PCI device's NUMA node assignment. Currently, every write triggers a FW_BUG warning and taints the kernel, even when writing the same value that is already set. Check if the requested node is already assigned to the device. If it matches, return success immediately without tainting the kernel or printing a warning. Signed-off-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260317002803.2353-1-lirongqing@baidu.com
-rw-r--r--drivers/pci/pci-sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 16eaaf749ba9..dd7c9e5f993e 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -378,6 +378,9 @@ static ssize_t numa_node_store(struct device *dev,
if (node != NUMA_NO_NODE && !node_online(node))
return -EINVAL;
+ if (node == dev->numa_node)
+ return count;
+
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
pci_alert(pdev, FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates.",
node);