public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Alok Tiwari <alok.a.tiwari@oracle.com>
Cc: usman.ansari@broadcom.com, siva.kallam@broadcom.com,
	jgg@ziepe.ca, kalesh-anakkur.purayil@broadcom.com,
	vikas.gupta@broadcom.com, bhargava.marreddy@broadcom.com,
	linux-rdma@vger.kernel.org, alok.a.tiwarilinux@gmail.com
Subject: Re: [PATCH] RDMA/bng_re: Fix CREQ BAR base validity check in bng_re_map_creq_db
Date: Wed, 4 Mar 2026 11:52:29 +0200	[thread overview]
Message-ID: <20260304095229.GX12611@unreal> (raw)
In-Reply-To: <20260227154002.71038-1-alok.a.tiwari@oracle.com>

On Fri, Feb 27, 2026 at 07:35:21AM -0800, Alok Tiwari wrote:
> bng_re_map_creq_db() initializes creq_db->reg.bar_id to the fixed BAR
> index used for the CREQ doorbell, then reads the BAR start address via
> pci_resource_start().
> 
> The existing code checked !bar_id, which is not a validity test for the
> PCI resource start. Check !bar_base instead and log an error when the
> BAR start address is 0.
> 
> Fixes: 4f830cd8d7fe ("RDMA/bng_re: Add infrastructure for enabling Firmware channel")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
>  drivers/infiniband/hw/bng_re/bng_fw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/bng_re/bng_fw.c b/drivers/infiniband/hw/bng_re/bng_fw.c
> index 17d7cc3aa11d..92e7fa4dcf1a 100644
> --- a/drivers/infiniband/hw/bng_re/bng_fw.c
> +++ b/drivers/infiniband/hw/bng_re/bng_fw.c
> @@ -581,7 +581,7 @@ static int bng_re_map_creq_db(struct bng_re_rcfw *rcfw, u32 reg_offt)
>  	creq_db->dbinfo.flags = 0;
>  	creq_db->reg.bar_id = BNG_FW_COMM_CONS_PCI_BAR_REGION;
>  	creq_db->reg.bar_base = pci_resource_start(pdev, creq_db->reg.bar_id);
> -	if (!creq_db->reg.bar_id)
> +	if (!creq_db->reg.bar_base)

Why is this check needed in the first place? The driver does nothing except
print an error message, which is unlikely to ever occur.

IMHO, you can remove it.

Thanks

>  		dev_err(&pdev->dev,
>  			"CREQ BAR region %d resc start is 0!",
>  			creq_db->reg.bar_id);
> -- 
> 2.50.1
> 

      parent reply	other threads:[~2026-03-04  9:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27 15:35 [PATCH] RDMA/bng_re: Fix CREQ BAR base validity check in bng_re_map_creq_db Alok Tiwari
2026-03-02 10:22 ` Siva Reddy Kallam
2026-03-04  9:52 ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260304095229.GX12611@unreal \
    --to=leon@kernel.org \
    --cc=alok.a.tiwari@oracle.com \
    --cc=alok.a.tiwarilinux@gmail.com \
    --cc=bhargava.marreddy@broadcom.com \
    --cc=jgg@ziepe.ca \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=siva.kallam@broadcom.com \
    --cc=usman.ansari@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox