]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI/sysfs: Suppress FW_BUG warning when NUMA node already matches
authorLi RongQing <lirongqing@baidu.com>
Tue, 17 Mar 2026 00:28:03 +0000 (20:28 -0400)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 30 Mar 2026 21:46:51 +0000 (16:46 -0500)
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
drivers/pci/pci-sysfs.c

index 16eaaf749ba9705580ccc2c5ac7154336f821c9b..dd7c9e5f993ee4edefb94dfc8ff4204af2d5bf25 100644 (file)
@@ -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);