Re: [PATCH net] net: stmmac: Fix race between stmmac_drv_probe and stmmac_open

From: David Miller
Date: Tue Dec 27 2016 - 21:32:56 EST


From: Florian Fainelli <f.fainelli@xxxxxxxxx>
Date: Tue, 27 Dec 2016 18:23:06 -0800

> There is currently a small window during which the network device registered by
> stmmac can be made visible, yet all resources, including and clock and MDIO bus
> have not had a chance to be set up, this can lead to the following error to
> occur:
...
> Fix this by making sure that register_netdev() is the last thing being done,
> which guarantees that the clock and the MDIO bus are available.
>
> Fixes: 4bfcbd7abce2 ("stmmac: Move the mdio_register/_unregister in probe/remove")
> Reported-by: Kweh, Hock Leong <hock.leong.kweh@xxxxxxxxx>
> Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>

Applied and queued up for -stable, thanks Florian.