summaryrefslogtreecommitdiff
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-07-12 14:17:17 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-07-12 14:17:17 -0700
commitdda5202b001cb59b16a1d20d063edd71e12905b3 (patch)
tree7f1e5ffa9aa8116699b5f2ec5e0c857eb4976694 /drivers/input/serio
parentede2e7cdc58e1847cc73bd26b88a634631a43112 (diff)
parent340d394a789518018f834ff70f7534fc463d3226 (diff)
downloadlinux-exynos-dda5202b001cb59b16a1d20d063edd71e12905b3.tar.gz
linux-exynos-dda5202b001cb59b16a1d20d063edd71e12905b3.tar.bz2
linux-exynos-dda5202b001cb59b16a1d20d063edd71e12905b3.zip
Merge branch 'next' into for-linus
Prepare second round of input updates for 4.13 merge window.
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/i8042.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index c52da651269b..824f4c1c1f31 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -436,8 +436,10 @@ static int i8042_start(struct serio *serio)
{
struct i8042_port *port = serio->port_data;
+ spin_lock_irq(&i8042_lock);
port->exists = true;
- mb();
+ spin_unlock_irq(&i8042_lock);
+
return 0;
}
@@ -450,16 +452,20 @@ static void i8042_stop(struct serio *serio)
{
struct i8042_port *port = serio->port_data;
+ spin_lock_irq(&i8042_lock);
port->exists = false;
+ port->serio = NULL;
+ spin_unlock_irq(&i8042_lock);
/*
+ * We need to make sure that interrupt handler finishes using
+ * our serio port before we return from this function.
* We synchronize with both AUX and KBD IRQs because there is
* a (very unlikely) chance that AUX IRQ is raised for KBD port
* and vice versa.
*/
synchronize_irq(I8042_AUX_IRQ);
synchronize_irq(I8042_KBD_IRQ);
- port->serio = NULL;
}
/*
@@ -576,7 +582,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
spin_unlock_irqrestore(&i8042_lock, flags);
- if (likely(port->exists && !filtered))
+ if (likely(serio && !filtered))
serio_interrupt(serio, data, dfl);
out: