From: Stephen Hemminger Date: Fri, 14 Aug 2009 05:15:15 +0000 (+0000) Subject: sky2: hold spinlock around phy_power_down X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0da6d7b331f391d3c0ce52fb5289f7edeb94e280;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sky2: hold spinlock around phy_power_down Avoid any possible problems with accessing PHY registers on shutdown. This is a purely theoretical issue and is not related to any of the outstanding bug reports. Since receiver and transmitter are already shutdown and phy interrupts for this device are already disabled, there should already be enough protection. Suggested by Mike McCormack. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index b75b48e83970..1d3ee03fa648 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -1893,7 +1893,9 @@ static int sky2_down(struct net_device *dev) synchronize_irq(hw->pdev->irq); napi_synchronize(&hw->napi); + spin_lock_bh(&sky2->phy_lock); sky2_phy_power_down(hw, port); + spin_unlock_bh(&sky2->phy_lock); /* turn off LED's */ sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);