summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-02-15 13:47:50 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-02-15 13:47:50 +0000
commit815334db9cace1915630583ed0457995c3604907 (patch)
tree59f8eba821fafc626a1fabd53ad5011cf030f0d4 /target
parentd214321c8c7b01a9a5b58eaa1e75e06004dbf364 (diff)
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 4a3f4c3b8..9f76779af 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