From: Gabor Juhos Date: Wed, 15 Feb 2012 13:47:50 +0000 (+0000) Subject: ramips: raeth: serialize ramips_link_adjust calls X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=f08fcb33fbb197d48b3c8f04cd384ac0f866a9eb ramips: raeth: serialize ramips_link_adjust calls SVN-Revision: 30549 --- diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c index 4a3f4c3b87..9f76779af4 100644 --- a/target/linux/ramips/files/drivers/net/ramips.c +++ b/target/linux/ramips/files/drivers/net/ramips.c @@ -407,22 +407,30 @@ ramips_phy_disconnect(struct raeth_priv *re) static void ramips_phy_start(struct raeth_priv *re) { + unsigned long flags; + if (re->phy_dev) { phy_start(re->phy_dev); } else { + spin_lock_irqsave(&re->phy_lock, flags); re->link = 1; ramips_link_adjust(re); + spin_unlock_irqrestore(&re->phy_lock, flags); } } static void ramips_phy_stop(struct raeth_priv *re) { + unsigned long flags; + if (re->phy_dev) { phy_stop(re->phy_dev); } else { + spin_lock_irqsave(&re->phy_lock, flags); re->link = 0; ramips_link_adjust(re); + spin_unlock_irqrestore(&re->phy_lock, flags); } } #else