PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches
PATCH v2 1/1 PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches
From: Li RongQing <[email protected]>
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.
---
Diff with v1: invert the check and return if they are same
drivers/pci/pci-sysfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pci/pci-sysfs.c +3 -0
@@ -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);
Signature · 1 line
2.9.4
Hello,
The patch is very nice, so much cleaner now.
Quoted 8 lines
The
numa_nodesysfs interface allows users to manually override a PCI device's NUMA node assignment. Currently, every write triggers aFW_BUGwarning 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.
Something for future reference:
- The [PATCH][v2] would be better as [PATCH v2], as per the usual format
- The "PCI: sysfs" prefix that we use more often is "PCI/sysfs"
No need to send v3 just to fix this, unless someone (like Bjorn) would ask.
Thank you!
Krzysztof
Bjorn Helgaas
AppliedQuoted 7 lines · lirongqing
From: Li RongQing <[email protected]>
The
numa_nodesysfs interface allows users to manually override a PCI device's NUMA node assignment. Currently, every write triggers aFW_BUGwarning and taints the kernel, even when writing the same value that is already set.
Quoted 5 lines
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 <[email protected]>
Applied to pci/misc for v7.1, thanks!
Quoted 23 lines
---
Diff with v1: invert the check and return if they are samedrivers/pci/pci-sysfs.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pci/pci-sysfs.c +3
-0@@ -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);Signature · 1 line
2.9.4