Keyboard uunresponsive after resume from suspend

If I suspend my laptop to RAM and wake it back up both keyboard and mouse are stuck for a few seconds (external USB mouse works fine when connected.) after which mouse starts working. The keyboard either wont work at all or rarely gets stuck on same input repeatedly sending same character. Ive had this issue for last 3 ubuntu releases before which it worked fine.

I've tried solutions here, and here. My command line includes atkbd.reset=1 i8042.direct i8042.dumbkbd none of them seems to help. What i have tried:

atkbd.reset=1 i8042.nomux=1 i8042.reset=1 i8042.nopnp=1 i8042.dumbkbd=1 i8042.direct

dmesg | grep i8042 output:

    [    1.495444] i8042: PNP: PS/2 Controller [PNP030b:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
    [    1.498084] serio: i8042 KBD port at 0x60,0x64 irq 1
    [    1.498089] serio: i8042 AUX port at 0x60,0x64 irq 12
    [    1.648255] input: AT Raw Set 2 keyboard as /devices/platform/i8042/serio0/input/input3
    [    2.364299] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input5
    [  225.155223] i8042: Can't write CTR while closing AUX port
    [  225.671941] i8042: Can't reactivate AUX port
    [  226.236540] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input15
    [  226.889445] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input17
    [  260.835043] i8042: Can't write CTR while closing AUX port
    [  261.351775] i8042: Can't reactivate AUX port
    [  261.908339] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input19
    [  262.480772] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input21
    [  286.021240] i8042: Can't write CTR while closing AUX port
    [  286.537976] i8042: Can't reactivate AUX port
    [  287.088777] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input23
    [  287.643256] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input25

Looks like it is initializing kbd and mouse as new devices but isn't setting up the keyboard correctly.


Solution 1:

I have a laptop with the i8042 device, too. I noticed that when the machine resumed after a suspend, that the dmesg command showed log entries with

rfkill: input handler

which is supposed to enable and disable wireless.

Since the keyboard is also an input device, I wondered if rfkill might be impacting the keyboard in some way. So I disabled rfkill by doing:

sudo mv /usr/sbin/rfkill /usr/sbin/rfkill.disabled

After rebooting, the problem with the keyboard has gone away for the past 2 days, despite multiple tests over many hours, to reproduce the problem. However, control over turning WiFi on/off is gone from the desktop.

If you see rfkill in your dmesg output, you might give this a try.