Thread (3 messages) flat view 3 messages, 2 authors, 2d ago
WARM2d

[PATCH] powerpc/pseries/pci: Fix misleading VF limit error message

From: Jiangshan Yi <hidden>
Date: 2026-08-13 03:53:39
Also in: lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

When the number of requested VFs exceeds MAX_VFS_FOR_MAP_PE, the
message prints that limit but labels it "Configurable VFs". Print
each limit with its own message so both are reported when both are
exceeded.

Signed-off-by: Jiangshan Yi <redacted>
---
 arch/powerpc/platforms/pseries/pci.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index d11a64a086c1..1e1903bf3f1d 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -133,10 +133,12 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
 	/* First integer stores max config */
 	max_config_vfs = of_read_number(&max_vfs[0], 1);
 	if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) {
-		dev_err(&pdev->dev,
-			"Num VFs %x > %x Configurable VFs\n",
-			num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ?
-			MAX_VFS_FOR_MAP_PE : max_config_vfs);
+		if (max_config_vfs < num_vfs)
+			dev_err(&pdev->dev, "Num VFs %x > %x Configurable VFs\n",
+				num_vfs, max_config_vfs);
+		if (num_vfs > MAX_VFS_FOR_MAP_PE)
+			dev_err(&pdev->dev, "Num VFs %x > %x PE mapping limit\n",
+				num_vfs, MAX_VFS_FOR_MAP_PE);
 		return -EINVAL;
 	}
 
-- 
2.25.1

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help