Ticket #907: preempt-has-no-spinlocks-here.diff

File preempt-has-no-spinlocks-here.diff, 2.8 kB (added by Mark Glines <mark@glines.org>, 5 years ago)

disable spinlock checks on PREEMPT && !SMP

  • net80211/ieee80211_linux.h

    old new  
    6464#define IEEE80211_RESCHEDULE    schedule 
    6565 
    6666/* Locking */ 
    67 /* NB: beware, spin_is_locked() is not usefully defined for UP+!PREEMPT  
     67/* NB: beware, spin_is_locked() is not usefully defined for non-SMP 
    6868 * because spinlocks do not exist in this configuration. Instead IRQs  
    6969 * are simply disabled, as this is all that is needed  
    7070 */ 
     
    9191#define IEEE80211_LOCK(_ic)     spin_lock(&(_ic)->ic_comlock) 
    9292#define IEEE80211_UNLOCK(_ic)   spin_unlock(&(_ic)->ic_comlock) 
    9393 
    94 #if (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)) && defined(spin_is_locked) 
     94#if defined(CONFIG_SMP) && defined(spin_is_locked) 
    9595#define IEEE80211_LOCK_ASSERT(_ic) \ 
    9696        KASSERT(spin_is_locked(&(_ic)->ic_comlock),("ieee80211com not locked!")) 
    9797#else 
     
    114114} while (0) 
    115115#define IEEE80211_VAPS_UNLOCK_IRQ_EARLY(_ic)    spin_unlock_irqrestore(&(_ic)->ic_vapslock, _vaps_lockflags) 
    116116 
    117 #if (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)) && defined(spin_is_locked) 
     117#if defined(CONFIG_SMP) && defined(spin_is_locked) 
    118118#define IEEE80211_VAPS_LOCK_ASSERT(_ic) \ 
    119119        KASSERT(spin_is_locked(&(_ic)->ic_vapslock), \ 
    120120                ("ieee80211com_vaps not locked!")) 
     
    146146#define IEEE80211_NODE_UNLOCK_IRQ_EARLY(_ni)            \ 
    147147        spin_unlock_irqrestore(&(_ni)->ni_nodelock, __node_lockflags); 
    148148 
    149 #if (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)) && defined(spin_is_locked) 
     149#if defined(CONFIG_SMP) && defined(spin_is_locked) 
    150150#define IEEE80211_NODE_LOCK_ASSERT(_nt) \ 
    151151        KASSERT(spin_is_locked(&(_ni)->ni_nodelock), \ 
    152152                ("802.11 node not locked!")) 
     
    177177#define IEEE80211_NODE_TABLE_UNLOCK_IRQ_EARLY(_nt)              \ 
    178178        spin_unlock_irqrestore(&(_nt)->nt_nodelock, __node_lockflags); 
    179179 
    180 #if (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)) && defined(spin_is_locked) 
     180#if defined(CONFIG_SMP) && defined(spin_is_locked) 
    181181#define IEEE80211_NODE_TABLE_LOCK_ASSERT(_nt) \ 
    182182        KASSERT(spin_is_locked(&(_nt)->nt_nodelock), \ 
    183183                ("802.11 node table not locked!")) 
     
    202202#define IEEE80211_SCAN_UNLOCK_IRQ_EARLY(_nt)            \ 
    203203        spin_unlock_irqrestore(&(_nt)->nt_scanlock, __scan_lockflags); 
    204204 
    205 #if (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)) && defined(spin_is_locked) 
     205#if defined(CONFIG_SMP) && defined(spin_is_locked) 
    206206#define IEEE80211_SCAN_LOCK_ASSERT(_nt) \ 
    207207        KASSERT(spin_is_locked(&(_nt)->nt_scanlock), ("scangen not locked!")) 
    208208#else 
     
    220220#define ACL_LOCK_BH(_as)                spin_lock_bh(&(_as)->as_lock) 
    221221#define ACL_UNLOCK_BH(_as)              spin_unlock_bh(&(_as)->as_lock) 
    222222 
    223 #if (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)) && defined(spin_is_locked) 
     223#if defined(CONFIG_SMP) && defined(spin_is_locked) 
    224224#define ACL_LOCK_ASSERT(_as) \ 
    225225        KASSERT(spin_is_locked(&(_as)->as_lock), ("ACL not locked!")) 
    226226#else