Changeset 30952


Ignore:
Timestamp:
2012-03-15T20:32:31+01:00 (6 years ago)
Author:
nbd
Message:

swconfig: use a mutex instead of a spinlock, many swconfig calls sleep

Location:
trunk/target/linux/generic/files
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/net/phy/swconfig.c

    r30839 r30952  
    354354        } 
    355355        if (dev) 
    356                 spin_lock(&dev->lock); 
     356                mutex_lock(&dev->sw_mutex); 
    357357        else 
    358358                DPRINTF("device %d not found\n", id); 
     
    365365swconfig_put_dev(struct switch_dev *dev) 
    366366{ 
    367         spin_unlock(&dev->lock); 
     367        mutex_unlock(&dev->sw_mutex); 
    368368} 
    369369 
     
    963963        } 
    964964        swconfig_defaults_init(dev); 
    965         spin_lock_init(&dev->lock); 
     965        mutex_init(&dev->sw_mutex); 
    966966        swconfig_lock(); 
    967967        dev->id = ++swdev_id; 
     
    10011001        swconfig_destroy_led_trigger(dev); 
    10021002        kfree(dev->portbuf); 
    1003         spin_lock(&dev->lock); 
     1003        mutex_lock(&dev->sw_mutex); 
    10041004        swconfig_lock(); 
    10051005        list_del(&dev->dev_list); 
    10061006        swconfig_unlock(); 
    1007         spin_unlock(&dev->lock); 
     1007        mutex_unlock(&dev->sw_mutex); 
    10081008} 
    10091009EXPORT_SYMBOL_GPL(unregister_switch); 
  • trunk/target/linux/generic/files/include/linux/switch.h

    r30839 r30952  
    192192        unsigned long def_global, def_port, def_vlan; 
    193193 
    194         spinlock_t lock; 
     194        struct mutex sw_mutex; 
    195195        struct switch_port *portbuf; 
    196196 
Note: See TracChangeset for help on using the changeset viewer.