wlcore: Use spin_trylock in wlcore_irq_locked() for running the queue
authorTony Lindgren <tony@atomide.com>
Thu, 2 Jul 2020 16:29:49 +0000 (09:29 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 15 Jul 2020 09:12:29 +0000 (12:12 +0300)
commitf0325e38ab39c2e270770b72c79795772ac3b49e
tree3022cbd901ab1a2c6e04e157eb2ffe92e83aa7eb
parenteb215c33f308cefe6d3691ffac27f9f498280811
wlcore: Use spin_trylock in wlcore_irq_locked() for running the queue

We currently have a collection of flags and locking between the
threaded irq and tx work:

- wl->flags bitops
- wl->mutex
- wl->wl_lock spinlock

The bitops flags do not need a spinlock around them, and
wlcore_irq() already holds the mutex calling wlcore_irq_locked().
And we only need the spinlock to see if we need to run the queue
or not.

To simplify the locking, we can use spin_trylock and always run the
tx queue unless we know there's nothing to do.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200702162951.45392-3-tony@atomide.com
drivers/net/wireless/ti/wlcore/main.c