File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -478,15 +478,22 @@ bool ps2_handle_response(struct ps2dev *ps2dev, u8 data)
478
478
}
479
479
EXPORT_SYMBOL (ps2_handle_response );
480
480
481
+ /*
482
+ * Clears state of PS/2 device after communication error by resetting majority
483
+ * of flags and waking up waiters, if any.
484
+ */
481
485
void ps2_cmd_aborted (struct ps2dev * ps2dev )
482
486
{
483
- if (ps2dev -> flags & PS2_FLAG_ACK )
487
+ unsigned long old_flags = ps2dev -> flags ;
488
+
489
+ /* reset all flags except last nak */
490
+ ps2dev -> flags &= PS2_FLAG_NAK ;
491
+
492
+ if (old_flags & PS2_FLAG_ACK )
484
493
ps2dev -> nak = 1 ;
485
494
486
- if (ps2dev -> flags & (PS2_FLAG_ACK | PS2_FLAG_CMD ))
495
+ if (old_flags & (PS2_FLAG_ACK | PS2_FLAG_CMD ))
487
496
wake_up (& ps2dev -> wait );
488
497
489
- /* reset all flags except last nack */
490
- ps2dev -> flags &= PS2_FLAG_NAK ;
491
498
}
492
499
EXPORT_SYMBOL (ps2_cmd_aborted );
You can’t perform that action at this time.
0 commit comments