From: Paolo Abeni <pabeni@redhat.com>
To: Xiaolei Wang <xiaolei.wang@windriver.com>,
nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, rmk+kernel@armlinux.org.uk,
Kexin.Hao@windriver.com
Cc: netdev@vger.kernel.org, stable@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: macb: Relocate mog_init_rings() callback from macb_mac_link_up() to macb_open()
Date: Thu, 18 Dec 2025 13:14:42 +0100 [thread overview]
Message-ID: <f73dcdc2-a63f-44e9-9c3e-c1c6340d099f@redhat.com> (raw)
In-Reply-To: <20251209085238.2570041-1-xiaolei.wang@windriver.com>
On 12/9/25 9:52 AM, Xiaolei Wang wrote:
> In the non-RT kernel, local_bh_disable() merely disables preemption,
> whereas it maps to an actual spin lock in the RT kernel. Consequently,
> when attempting to refill RX buffers via netdev_alloc_skb() in
> macb_mac_link_up(), a deadlock scenario arises as follows:
> Chain caused by macb_mac_link_up():
> &bp->lock --> (softirq_ctrl.lock)
>
> Chain caused by macb_start_xmit():
> (softirq_ctrl.lock) --> _xmit_ETHER#2 --> &bp->lock
Including the whole lockdep splat instead of the above would be clearer;
in fact, I had to fetch the relevant info from there.
> Notably, invoking the mog_init_rings() callback upon link establishment
> is unnecessary. Instead, we can exclusively call mog_init_rings() within
> the ndo_open() callback. This adjustment resolves the deadlock issue.
> Given that mog_init_rings() is only applicable to
> non-MACB_CAPS_MACB_IS_EMAC cases, we can simply move it to macb_open()
> and simultaneously eliminate the MACB_CAPS_MACB_IS_EMAC check.
This part is not clear to me: AFAICS the new code now does such init
step unconditionally, which looks confusing. I think such step should
still be under the relevant conditional (or you need to include a
better/more verbose explanation describing why such check is not really
needed).
> Fixes: 633e98a711ac ("net: macb: use resolved link config in mac_link_up()")
> Cc: stable@vger.kernel.org
> Suggested-by: Kevin Hao <kexin.hao@windriver.com>
> Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Side note: you still need to include the 'net' tag into the subj prefix.
/P
next prev parent reply other threads:[~2025-12-18 12:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 8:52 Xiaolei Wang
2025-12-18 12:14 ` Paolo Abeni [this message]
2025-12-19 9:16 ` xiaolei wang
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=f73dcdc2-a63f-44e9-9c3e-c1c6340d099f@redhat.com \
--to=pabeni@redhat.com \
--cc=Kexin.Hao@windriver.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=stable@vger.kernel.org \
--cc=xiaolei.wang@windriver.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
all inboxes | Powered by JetHome®