staging: unisys: visorinput: ensure proper locking wrt creation & ints
authorTim Sell <Timothy.Sell@unisys.com>
Sat, 11 Jun 2016 01:48:25 +0000 (21:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2016 18:44:26 +0000 (20:44 +0200)
commit24ce1b66619c499f5913eac5debf9170f7a9dcc3
tree318a1e2bdfd292889e7468feffb3198985ede434
parent64088bd476be1a7abb6167f8fee4f0aa4d87598d
staging: unisys: visorinput: ensure proper locking wrt creation & ints

Ensure we properly lock between visorinput_channel_interrupt(),
visorinput_open(), and devdata_create().  We now guarantee that:

* interrupts will be disabled and remain disabled during device creation,
  by setting 'paused = true' across device creation

* we canNOT get into visorinput_open() until the device structure is
  totally initialized, by delaying the input_register_device() until the
  end of device initialization

We also now ensure that lock_visor_dev is held across updates of devdata
state, to ensure state consistency.

Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Acked-By: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorinput/visorinput.c