File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -436,8 +436,10 @@ static int i8042_start(struct serio *serio)
436
436
{
437
437
struct i8042_port * port = serio -> port_data ;
438
438
439
+ spin_lock_irq (& i8042_lock );
439
440
port -> exists = true;
440
- mb ();
441
+ spin_unlock_irq (& i8042_lock );
442
+
441
443
return 0 ;
442
444
}
443
445
@@ -450,16 +452,20 @@ static void i8042_stop(struct serio *serio)
450
452
{
451
453
struct i8042_port * port = serio -> port_data ;
452
454
455
+ spin_lock_irq (& i8042_lock );
453
456
port -> exists = false;
457
+ port -> serio = NULL ;
458
+ spin_unlock_irq (& i8042_lock );
454
459
455
460
/*
461
+ * We need to make sure that interrupt handler finishes using
462
+ * our serio port before we return from this function.
456
463
* We synchronize with both AUX and KBD IRQs because there is
457
464
* a (very unlikely) chance that AUX IRQ is raised for KBD port
458
465
* and vice versa.
459
466
*/
460
467
synchronize_irq (I8042_AUX_IRQ );
461
468
synchronize_irq (I8042_KBD_IRQ );
462
- port -> serio = NULL ;
463
469
}
464
470
465
471
/*
@@ -576,7 +582,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
576
582
577
583
spin_unlock_irqrestore (& i8042_lock , flags );
578
584
579
- if (likely (port -> exists && !filtered ))
585
+ if (likely (serio && !filtered ))
580
586
serio_interrupt (serio , data , dfl );
581
587
582
588
out :
You can’t perform that action at this time.
0 commit comments