Avoid triggering lockdep checker in ath_hw_reset()

Use spin_lock_irqsave_nested() instead of spin_lock_irqsave().  Use a
separate counter for the locking subclass, so that we don't exceed the
maximal value of 8.  We have 10 queues, but inactive queues don't get a
locking subclass number.

Provide a replacement for spin_lock_irqsave_nested() for kernels older
than 2.6.19.


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3995 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
proski 2009-04-12 05:53:23 +00:00
parent 407bde2595
commit b424bc2d8b
2 changed files with 10 additions and 2 deletions

View File

@ -1633,7 +1633,7 @@ static HAL_BOOL ath_hw_reset(struct ath_softc *sc, HAL_OPMODE opmode,
HAL_BOOL ret;
unsigned long __axq_lockflags[HAL_NUM_TX_QUEUES];
struct ath_txq * txq;
int i;
int i, lclass = 0;
u_int8_t old_privFlags = sc->sc_curchan.privFlags;
/* ath_hal_reset() resets all TXDP pointers, so we need to
@ -1643,7 +1643,8 @@ static HAL_BOOL ath_hw_reset(struct ath_softc *sc, HAL_OPMODE opmode,
for (i = 0; i < HAL_NUM_TX_QUEUES; i++) {
if (ATH_TXQ_SETUP(sc, i)) {
txq = &sc->sc_txq[i];
spin_lock_irqsave(&txq->axq_lock, __axq_lockflags[i]);
spin_lock_irqsave_nested(&txq->axq_lock,
__axq_lockflags[i], lclass++);
}
}

View File

@ -210,6 +210,13 @@ typedef unsigned long resource_size_t;
#define request_module(_fmt, _modname) request_module(_modname)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#ifndef spin_lock_irqsave_nested
#define spin_lock_irqsave_nested(_lock, _flags, _subclass) \
spin_lock_irqsave(_lock, _flags)
#endif
#endif
#endif /* __KERNEL__ */
#endif /* _ATH_COMPAT_H_ */