netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
	Andrew Lunn <andrew@lunn.ch>, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-arm-kernel@lists.infradead.org,
	Simon Horman <simon.horman@corigine.com>,
	alexis.lothore@bootlin.com
Subject: Re: [PATCH net-next] net: altera_tse: fix init sequence to avoid races with register_netdev
Date: Sun, 11 Jun 2023 18:30:24 +0200	[thread overview]
Message-ID: <20230611183024.6e6fd46a@pc-7.home> (raw)
In-Reply-To: <ZIXrYupBmpviSEW3@shell.armlinux.org.uk>

Hi,

On Sun, 11 Jun 2023 16:42:26 +0100
"Russell King (Oracle)" <linux@armlinux.org.uk> wrote:

> On Sun, Jun 11, 2023 at 12:40:19PM +0200, Maxime Chevallier wrote:
> > As reported here[1], the init sequence in altera_tse can be racy should
> > any operation on the registered netdev happen after netdev registration
> > but before phylink initialization.
> > 
> > Fix the registering order to avoid such races by making register_netdev
> > the last step of the probing sequence.
> > 
> > [1]: https://lore.kernel.org/netdev/ZH9XK5yEGyoDMIs%2F@shell.armlinux.org.uk/
> > 
> > Fixes: fef2998203e1 ("net: altera: tse: convert to phylink")
> > Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> > ---
> > This patch targets net-next as it fixes a commit that is in net-next
> > too.  
> 
> While it fixes the order in which stuff is registered, it introduces
> a new bug - register_netdev() is what atomically allocated a netdev
> name, and you use the netdev name when creating the PCS MII bus:
> 
> 	snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", ndev->name);
> 
> This needs to change, because this will end up being "eth%d-pcs-mii".
> 
> I am at a loss why you didn't realise this (or in fact recognise that
> there are other issues) given that I sent you three patches fixing
> this mess.
> 

Hmpf your patches went un-noticed, sorry... I'll base later work on that.

I will also followup with a similar series for dwmac-socfpga

Best regards,

Maxime

      reply	other threads:[~2023-06-11 16:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-11 10:40 [PATCH net-next] net: altera_tse: fix init sequence to avoid races with register_netdev Maxime Chevallier
2023-06-11 15:42 ` Russell King (Oracle)
2023-06-11 16:30   ` Maxime Chevallier [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=20230611183024.6e6fd46a@pc-7.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=alexis.lothore@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=simon.horman@corigine.com \
    --cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).