Re: [PATCH net v2 2/2] net: ngbe: clear DRV_LOAD bit when ngbe_open() fails

From: Breno Leitao

Date: Tue Sep 22 2026 - 06:59:04 EST


On Tue, Sep 22, 2026 at 06:08:36PM +0800, Zhang Yunfei wrote:
> ngbe_open() sets the WX_CFG_PORT_CTL_DRV_LOAD bit via
> wx_control_hw(wx, true) to tell the management firmware that the
> host driver has taken over the port (NCSI/OOB firmware stops using
> its management channel). Every error path of ngbe_open() returns
> without clearing it, leaving rings, IRQs and the PHY torn down
> while the firmware still believes the host owns the port, an
> inconsistent driver-firmware handshake state that persists until
> the next successful ifup.
>
> Roll the bit back on all open error paths, matching ngbe_close()
> and ngbe_dev_shutdown(), which already clear it.

silly question, why unwind, rather than not taking hw control until the
port is actually up, as the last thing in ngbe_open()?

Looking at txgbe, it does something like:

static int txgbe_open(struct net_device *netdev) {
.....
txgbe_up_complete(wx);

return 0;
}

Would ngbe_open() be able to follow a similar approach?

--breno