From: Simon Horman <horms@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: airoha: Move net_devs registration in a dedicated routine
Date: Mon, 15 Dec 2025 14:39:19 +0000 [thread overview]
Message-ID: <aUAdlzPgf_lQKgLM@horms.kernel.org> (raw)
In-Reply-To: <aUAcHVULgJTpdGzT@lore-desk>
On Mon, Dec 15, 2025 at 03:33:01PM +0100, Lorenzo Bianconi wrote:
> > On Sun, Dec 14, 2025 at 10:30:07AM +0100, Lorenzo Bianconi wrote:
> > > Since airoha_probe() is not executed under rtnl lock, there is small race
> > > where a given device is configured by user-space while the remaining ones
> > > are not completely loaded from the dts yet. This condition will allow a
> > > hw device misconfiguration since there are some conditions (e.g. GDM2 check
> > > in airoha_dev_init()) that require all device are properly loaded from the
> > > device tree. Fix the issue moving net_devices registration at the end of
> > > the airoha_probe routine.
> > >
> > > Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
> > > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> >
> > Hi Lorenzo,
> >
> > As a fix this patch looks good to me.
> >
> > Reviewed-by: Simon Horman <horms@kernel.org>
>
> Hi Simon,
>
> thx for the review.
>
> >
> > But I am somewhat surprised that the netdev isn't unregistered earlier
> > both in airoha_remove() and the unwind ladder of airoha_probe().
>
> do you mean moving unregister_netdev() before
> airoha_qdma_stop_napi()/airoha_hw_cleanup()? I was thinking about it to be
> honest :)
> Since it is not related to this fix, I will post a patch as soon as net-next is
> open again.
Yes, that is what I was thinking.
And I agree that this is net-next material unrelated to this fix.
While you are there, I would look at making the unwind ladder
in probe follow the same pattern as remove, if possible.
I think that might mean moving airoha_ppe_deinit().
But perhaps you already thought of that too.
Or there is some good reason not to do so.
prev parent reply other threads:[~2025-12-15 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-14 9:30 [PATCH net] net: airoha: Move net_devs registration in a dedicated routine Lorenzo Bianconi
2025-12-15 14:11 ` Simon Horman
2025-12-15 14:33 ` Lorenzo Bianconi
2025-12-15 14:39 ` Simon Horman [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=aUAdlzPgf_lQKgLM@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 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.