Changeset 28380


Ignore:
Timestamp:
2011-10-08T13:37:14+02:00 (6 years ago)
Author:
jogo
Message:

ag71xx: close a race between the phy state machine and link state

A fast stop/start cycle could leave the ag71xx interrupts and tx engine
disabled when using a phy driver with a fixed link and the start/stop
happens between two phy state machine polls.

Prevent this by always forcing the link down on stop regardless of phy
state and having a phy connected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c

    r26922 r28380  
    6060{ 
    6161        struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); 
    62  
    63         if (ag->phy_dev) { 
     62        unsigned long flags; 
     63 
     64        if (ag->phy_dev) 
    6465                phy_stop(ag->phy_dev); 
    65         } else { 
    66                 if (pdata->has_ar7240_switch) 
     66        else if (pdata->has_ar7240_switch) 
    6767                        ag71xx_ar7240_stop(ag); 
     68 
     69        spin_lock_irqsave(&ag->lock, flags); 
     70        if (ag->link) { 
    6871                ag->link = 0; 
    6972                ag71xx_link_adjust(ag); 
    7073        } 
     74        spin_unlock_irqrestore(&ag->lock, flags); 
    7175} 
    7276 
Note: See TracChangeset for help on using the changeset viewer.