HID: intel-ish-hid: Optimize writing ipc message from queue
authorHong Liu <hong.liu@intel.com>
Tue, 12 Feb 2019 12:05:21 +0000 (20:05 +0800)
committerJiri Kosina <jkosina@suse.cz>
Fri, 15 Feb 2019 21:47:21 +0000 (22:47 +0100)
commitb22f805bbe090d42e2eed86aa075687e47f924b7
tree176d9f41542e7c53ea37a72c8ad80f87b4dab684
parent0d28f49412405d87d3aae83da255070a46e67627
HID: intel-ish-hid: Optimize writing ipc message from queue

Currently we are using one additional static variable and a spinlock to
prevent contention of writing IPC messages to ISH hardware, which is
not necessary. Once ISH is ready to accept new data, we can push new
data to hardware. This pushing of new data is already protected by
wr_processing_spinlock for contention, which is enough. So use this
spinlock to check both readiness for accepting new data and once ready
allow writing of ipc message from queue to ISH hardware.

While here, cleaned up some space after return.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Tested-by: Hongyan Song <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ipc/ipc.c
drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h