From: Dave Marquardt <davemarq@linux.ibm.com>
To: Mingming Cao <mmc@linux.ibm.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
horms@kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, nnac123@linux.ibm.com,
maddy@linux.ibm.com, mpe@ellerman.id.au,
linuxppc-dev@lists.ozlabs.org, bjking1@linux.ibm.com,
shaik.abdulla1@ibm.com, stable@vger.kernel.org
Subject: Re: [PATCH net 1/2] ibmveth: h_free logical LAN on open-fail after register
Date: Fri, 25 Sep 2026 14:01:04 -0500 [thread overview]
Message-ID: <87jyo917gv.fsf@linux.ibm.com> (raw)
In-Reply-To: <7a56fbfb9e0674f011f4e310fbd7dfd8e67c30aa.1790357373.git.mmc@linux.ibm.com> (Mingming Cao's message of "Fri, 25 Sep 2026 11:05:29 -0700")
Mingming Cao <mmc@linux.ibm.com> writes:
> ibmveth_open() registers the logical LAN, then allocates the RX
> buffer pools. A pool failure jumps to out_free_buffer_pools without
> h_free_logical_lan(), so PHYP still owns the buffer-list page when
> it is unmapped. request_irq() failure already issued the hypercall
> before taking the same label.
>
> Move that h_free to the shared post-register unwind so both paths
> deregister before the buffer list is unmapped.
>
> Fixes: d43732ce021f ("ibmveth: properly unwind on init errors")
> Cc: stable@vger.kernel.org
> Signed-off-by: Mingming Cao <mmc@linux.ibm.com>
> ---
> drivers/net/ethernet/ibm/ibmveth.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index 73e051d26b9d..3e44f6b714d4 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -718,10 +718,6 @@ static int ibmveth_open(struct net_device *netdev)
> if (rc != 0) {
> netdev_err(netdev, "unable to request irq 0x%x, rc %d\n",
> netdev->irq, rc);
> - do {
> - lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
> - } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
> -
> goto out_free_buffer_pools;
> }
This code change is good. But I noticed another thing that's a pretty
minor bug of useless code just after this:
rc = -ENOMEM;
rc isn't used in that code path after it is set. Is there some reason I
do not understand to have this here?
> @@ -737,6 +733,9 @@ static int ibmveth_open(struct net_device *netdev)
> return 0;
>
> out_free_buffer_pools:
> + do {
> + lpar_rc = h_free_logical_lan(adapter->vdev->unit_address);
> + } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY));
> while (--i >= 0) {
> if (adapter->rx_buff_pool[i].active)
> ibmveth_free_buffer_pool(adapter,
Reviewed-by: Dave Marquardt <davemarq@linux.ibm.com>
next prev parent reply other threads:[~2026-09-25 19:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 18:05 [PATCH net 0/2] ibmveth: fix open-fail unwind after LAN registration Mingming Cao
2026-09-25 18:05 ` [PATCH net 1/2] ibmveth: h_free logical LAN on open-fail after register Mingming Cao
2026-09-25 19:01 ` Dave Marquardt [this message]
2026-09-25 19:48 ` mingming cao
2026-09-25 20:36 ` Dave Marquardt
2026-09-25 18:05 ` [PATCH net 2/2] ibmveth: fix TX LTB and filter unwind on open-fail Mingming Cao
2026-09-25 19:08 ` Dave Marquardt
2026-10-01 23:10 ` [PATCH net 0/2] ibmveth: fix open-fail unwind after LAN registration patchwork-bot+netdevbpf
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=87jyo917gv.fsf@linux.ibm.com \
--to=davemarq@linux.ibm.com \
--cc=andrew+netdev@lunn.ch \
--cc=bjking1@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mmc@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=nnac123@linux.ibm.com \
--cc=pabeni@redhat.com \
--cc=shaik.abdulla1@ibm.com \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.