]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
HID: intel_ish-hid: clarify locking in client code
authorArnd Bergmann <arnd@arndb.de>
Thu, 18 May 2017 20:21:41 +0000 (22:21 +0200)
committerJiri Kosina <jkosina@suse.cz>
Tue, 30 May 2017 12:11:52 +0000 (14:11 +0200)
commit538be0aa8610168d7a8f4b119452056f537cff46
tree178e53f7cd116baf59c744160d4eb825f884e02c
parent1260662fa3f293042fb0ae124c9a621f29f5bcab
HID: intel_ish-hid: clarify locking in client code

I was trying to understand this code while working on a warning
fix and the locking made no sense: spin_lock_irqsave() is pointless
when run inside of an interrupt handler or nested inside of another
spin_lock_irq() or spin_lock_irqsave().

Here it turned out that the comment above the function is wrong,
as both recv_ishtp_cl_msg_dma() and recv_ishtp_cl_msg() can in fact
be called from a work queue rather than an ISR, so we do have to
use the irqsave() version once.

This fixes the comments accordingly, removes the misleading 'dev_flags'
variable and modifies the inner spinlock to not use 'irqsave'.

No functional change is intended, this is just for readability and
it slightly simplifies the object code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ishtp/client.c