public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Vikas Gupta <vikas.gupta@broadcom.com>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, vsrama-krishna.nemani@broadcom.com,
	bhargava.marreddy@broadcom.com, rajashekar.hudumula@broadcom.com,
	ajit.khaparde@broadcom.com, dharmender.garg@broadcom.com,
	rahul-rg.gupta@broadcom.com
Subject: Re: [PATCH net v2 1/2] bnge: fix initial HWRM sequence
Date: Fri, 17 Apr 2026 07:42:54 -0700	[thread overview]
Message-ID: <20260417074254.42f01fa7@kernel.org> (raw)
In-Reply-To: <CAHLZf_voEPTrfkuO6pJcchaQaOqJin8m7j-+hwMrjJcGFmJv0A@mail.gmail.com>

On Fri, 17 Apr 2026 11:46:08 +0530 Vikas Gupta wrote:
> > > -err_func_unrgtr:
> > > -     bnge_fw_unregister_dev(bd);
> > > +err_free_ctx_mem:
> > > +     bnge_free_ctx_mem(bd);
> > >       return rc;
> > >  }  
> >
> > This error path appears to have the same regression. If
> > bnge_hwrm_func_drv_rgtr() fails after bnge_func_qcaps() has already
> > configured the backing store, freeing the context memory directly without
> > unregistering might allow the hardware to access freed memory.  
> 
> Even if bnge_hwrm_func_drv_rgtr() fails, it is still safe to free the context
> memory at the host because the driver unloads from this point.

Looking closer, indeed, the way bnge_hwrm_func_drv_unrgtr() is written
the AI suggestion is pointless. Hopefully you're right cause debugging
FW corrupting host memory after reboot on bnxt is not fun.

> AI reviews appear to ignore logic related to handling context memory
> in the patch.
> I see no valid comments on the patch.

Why is bnge_func_qcaps() allocating context mem? It may be the case
that context mem has to be allocated but bnge_func_qcaps() doesn't
sound like a function that'd perform such key part of init.
Why not just move the alloc earlier in bnge_fw_register_dev() ?

  reply	other threads:[~2026-04-17 14:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 15:16 [PATCH net v2 0/2] bnge fixes Vikas Gupta
2026-04-15 15:16 ` [PATCH net v2 1/2] bnge: fix initial HWRM sequence Vikas Gupta
2026-04-17  2:22   ` Jakub Kicinski
2026-04-17  6:16     ` Vikas Gupta
2026-04-17 14:42       ` Jakub Kicinski [this message]
2026-04-17 15:47         ` Vikas Gupta
2026-04-15 15:16 ` [PATCH net v2 2/2] bnge: remove unsupported backing store type Vikas Gupta
2026-04-16  3:54   ` Przemek Kitszel
2026-04-16  5:22     ` Vikas Gupta

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=20260417074254.42f01fa7@kernel.org \
    --to=kuba@kernel.org \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bhargava.marreddy@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=dharmender.garg@broadcom.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rahul-rg.gupta@broadcom.com \
    --cc=rajashekar.hudumula@broadcom.com \
    --cc=vikas.gupta@broadcom.com \
    --cc=vsrama-krishna.nemani@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