public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches
@ 2026-03-13  5:08 lirongqing
  2026-03-14 20:54 ` Krzysztof Wilczyński
  0 siblings, 1 reply; 4+ messages in thread
From: lirongqing @ 2026-03-13  5:08 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

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.

Fix by comparing the new value against the existing dev->numa_node.
Only emit the warning and update the node when they differ. Writing
the same value becomes a harmless no-op.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/pci/pci-sysfs.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 16eaaf7..9f52410 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -378,11 +378,13 @@ static ssize_t numa_node_store(struct device *dev,
 	if (node != NUMA_NO_NODE && !node_online(node))
 		return -EINVAL;
 
-	add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
-	pci_alert(pdev, FW_BUG "Overriding NUMA node to %d.  Contact your vendor for updates.",
-		  node);
+	if (node != dev->numa_node) {
+		add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
+		pci_alert(pdev, FW_BUG "Overriding NUMA node to %d.  Contact your vendor for updates.",
+			  node);
+		dev->numa_node = node;
+	}
 
-	dev->numa_node = node;
 	return count;
 }
 
-- 
2.9.4


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

end of thread, other threads:[~2026-03-16  3:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13  5:08 [PATCH] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches lirongqing
2026-03-14 20:54 ` Krzysztof Wilczyński
2026-03-16  2:20   ` 答复: [????] " Li,Rongqing(ACG CCN)
2026-03-16  3:12     ` Krzysztof Wilczy��ski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox