ramips: raeth: serialize ramips_link_adjust calls
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30549 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
d50d8e09a4
commit
846b753561
|
@ -407,22 +407,30 @@ ramips_phy_disconnect(struct raeth_priv *re)
|
||||||
static void
|
static void
|
||||||
ramips_phy_start(struct raeth_priv *re)
|
ramips_phy_start(struct raeth_priv *re)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
if (re->phy_dev) {
|
if (re->phy_dev) {
|
||||||
phy_start(re->phy_dev);
|
phy_start(re->phy_dev);
|
||||||
} else {
|
} else {
|
||||||
|
spin_lock_irqsave(&re->phy_lock, flags);
|
||||||
re->link = 1;
|
re->link = 1;
|
||||||
ramips_link_adjust(re);
|
ramips_link_adjust(re);
|
||||||
|
spin_unlock_irqrestore(&re->phy_lock, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ramips_phy_stop(struct raeth_priv *re)
|
ramips_phy_stop(struct raeth_priv *re)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
if (re->phy_dev) {
|
if (re->phy_dev) {
|
||||||
phy_stop(re->phy_dev);
|
phy_stop(re->phy_dev);
|
||||||
} else {
|
} else {
|
||||||
|
spin_lock_irqsave(&re->phy_lock, flags);
|
||||||
re->link = 0;
|
re->link = 0;
|
||||||
ramips_link_adjust(re);
|
ramips_link_adjust(re);
|
||||||
|
spin_unlock_irqrestore(&re->phy_lock, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue