提交 0973a4dd 编写于 作者: V Vladimir Zapolskiy 提交者: David S. Miller

ravb: fix invalid context bug while calling auto-negotiation by ethtool

Since commit 35b5f6b1 ("PHYLIB: Locking fixes for PHY I/O
potentially sleeping") phy_start_aneg() function utilizes a mutex
to serialize changes to phy state, however the helper function is
called in atomic context.

The bug can be reproduced by running "ethtool -r" command, the bug
is reported if CONFIG_DEBUG_ATOMIC_SLEEP build option is enabled.

Fixes: c156633f ("Renesas Ethernet AVB driver proper")
Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6783f50e
...@@ -1152,15 +1152,10 @@ static int ravb_set_link_ksettings(struct net_device *ndev, ...@@ -1152,15 +1152,10 @@ static int ravb_set_link_ksettings(struct net_device *ndev,
static int ravb_nway_reset(struct net_device *ndev) static int ravb_nway_reset(struct net_device *ndev)
{ {
struct ravb_private *priv = netdev_priv(ndev);
int error = -ENODEV; int error = -ENODEV;
unsigned long flags;
if (ndev->phydev) { if (ndev->phydev)
spin_lock_irqsave(&priv->lock, flags);
error = phy_start_aneg(ndev->phydev); error = phy_start_aneg(ndev->phydev);
spin_unlock_irqrestore(&priv->lock, flags);
}
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册