diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-02-15 13:47:50 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-02-15 13:47:50 +0000 |
commit | 3e7b461431b83c9acda0922e204c1c3434c1eda3 (patch) | |
tree | 5db3189b59dcbded6a0903ec24450f2e0f9180ec /target | |
parent | dcb13d40980be316858dcb1a8f1bf5b196019e82 (diff) | |
download | mtk-20170518-3e7b461431b83c9acda0922e204c1c3434c1eda3.zip mtk-20170518-3e7b461431b83c9acda0922e204c1c3434c1eda3.tar.gz mtk-20170518-3e7b461431b83c9acda0922e204c1c3434c1eda3.tar.bz2 |
ramips: raeth: serialize ramips_link_adjust calls
SVN-Revision: 30549
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/ramips/files/drivers/net/ramips.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c index 4a3f4c3..9f76779 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 |