Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

RDMA/bnxt_re: Fix incorrect BAR check in bnxt_qplib_map_creq_db()

RCFW_COMM_CONS_PCI_BAR_REGION is defined as BAR 2, so checking
!creq_db->reg.bar_id is incorrect and always false.

pci_resource_start() returns the BAR base address, and a value of 0
indicates that the BAR is unassigned. Update the condition to test
bar_base == 0 instead.

This ensures the driver detects and logs an error for an unassigned
RCFW communication BAR.

Fixes: cee0c7bba486 ("RDMA/bnxt_re: Refactor command queue management code")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20251217100158.752504-1-alok.a.tiwari@oracle.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Alok Tiwari and committed by
Leon Romanovsky
145a417a 8aaa848e

+1 -1
+1 -1
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
··· 1112 1112 creq_db->dbinfo.flags = 0; 1113 1113 creq_db->reg.bar_id = RCFW_COMM_CONS_PCI_BAR_REGION; 1114 1114 creq_db->reg.bar_base = pci_resource_start(pdev, creq_db->reg.bar_id); 1115 - if (!creq_db->reg.bar_id) 1115 + if (!creq_db->reg.bar_base) 1116 1116 dev_err(&pdev->dev, 1117 1117 "QPLIB: CREQ BAR region %d resc start is 0!", 1118 1118 creq_db->reg.bar_id);