public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches
@ 2026-03-17  0:28 lirongqing
  2026-03-17  1:20 ` Krzysztof Wilczyński
  2026-03-17 21:33 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: lirongqing @ 2026-03-17  0:28 UTC (permalink / raw)
  To: Bjorn Helgaas, kwilczynski, 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.

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>
---
Diff with v1: invert the check and return if they are same 

 drivers/pci/pci-sysfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 16eaaf7..dd7c9e5 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);
-- 
2.9.4


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

* Re: [PATCH][v2] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches
  2026-03-17  0:28 [PATCH][v2] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches lirongqing
@ 2026-03-17  1:20 ` Krzysztof Wilczyński
  2026-03-17 21:33 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2026-03-17  1:20 UTC (permalink / raw)
  To: lirongqing; +Cc: Bjorn Helgaas, linux-pci, linux-kernel

Hello,

The patch is very nice, so much cleaner now.

> 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.

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

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

* Re: [PATCH][v2] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches
  2026-03-17  0:28 [PATCH][v2] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches lirongqing
  2026-03-17  1:20 ` Krzysztof Wilczyński
@ 2026-03-17 21:33 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2026-03-17 21:33 UTC (permalink / raw)
  To: lirongqing; +Cc: Bjorn Helgaas, kwilczynski, linux-pci, linux-kernel

On Mon, Mar 16, 2026 at 08:28:03PM -0400, lirongqing wrote:
> 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.
> 
> 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>

Applied to pci/misc for v7.1, thanks!

> ---
> Diff with v1: invert the check and return if they are same 
> 
>  drivers/pci/pci-sysfs.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> index 16eaaf7..dd7c9e5 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);
> -- 
> 2.9.4
> 

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

end of thread, other threads:[~2026-03-17 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17  0:28 [PATCH][v2] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches lirongqing
2026-03-17  1:20 ` Krzysztof Wilczyński
2026-03-17 21:33 ` Bjorn Helgaas

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