On Thu, May 24, 2018 at 02:11:55PM +0300, Vladimir Zapolskiy wrote: > The change replaces a custom implementation of .set_link_ksettings > callback with a shared phy_ethtool_set_link_ksettings(), this fixes > sleep in atomic context bug, which is encountered every time when link > settings are changed by ethtool. > > Now duplex mode setting is enforced in ravb_adjust_link() only, also > now TX/RX is disabled when link is put down or modifications to E-MAC > registers ECMR and GECMR are expected for both cases of checked and > ignored link status pin state from E-MAC interrupt handler. > > Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@xxxxxxxxxx> > --- > drivers/net/ethernet/renesas/ravb_main.c | 58 +++++++++----------------------- > 1 file changed, 15 insertions(+), 43 deletions(-) > > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index 3d91caa44176..0d811c02ff34 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c > @@ -980,6 +980,13 @@ static void ravb_adjust_link(struct net_device *ndev) > struct ravb_private *priv = netdev_priv(ndev); > struct phy_device *phydev = ndev->phydev; > bool new_state = false; > + unsigned long flags; > + > + spin_lock_irqsave(&priv->lock, flags); Hi Vladimir It is pretty unusual to see an adjust_link callback take a lock. Is it clearly defined what it is protecting? Andrew