diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-07-28 04:01:58 (GMT) |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-07-28 04:01:58 (GMT) |
commit | dadf6cd391f4208cfe0fbb01ba5b70c0f1b3b920 (patch) | |
tree | 5339918e23c6b8bca68b6b9cb10f5ab5e5cfbea2 /drivers/input | |
parent | 97baec00952afead33eea0b1b97ee4d5850dce00 (diff) | |
parent | efcfbfb1d8bf756d1b58fe215bf4e419d176435b (diff) | |
download | linux-dadf6cd391f4208cfe0fbb01ba5b70c0f1b3b920.tar.xz |
Merge tag 'v4.9.40' into linux-linaro-lsk-v4.9
This is the 4.9.40 stable release
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/serio/i8042.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 89abfdb..c84c685 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -434,8 +434,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; } @@ -448,16 +450,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; } /* @@ -574,7 +580,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: |