aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-02-15 13:47:50 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-02-15 13:47:50 +0000
commit846b753561da1a9598a1f34a92ac28dd46b41ae4 (patch)
tree59f8eba821fafc626a1fabd53ad5011cf030f0d4 /target
parentd50d8e09a47e419dc28531493a75d95630740a64 (diff)
downloadupstream-846b753561da1a9598a1f34a92ac28dd46b41ae4.tar.gz
upstream-846b753561da1a9598a1f34a92ac28dd46b41ae4.tar.bz2
upstream-846b753561da1a9598a1f34a92ac28dd46b41ae4.zip
ramips: raeth: serialize ramips_link_adjust calls
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30549 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files/drivers/net/ramips.c8
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 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