Bug 1806085 - [i8042] Keystrokes missed in LUKS password for first 5 seconds
Summary: [i8042] Keystrokes missed in LUKS password for first 5 seconds
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-22 00:46 UTC by James
Modified: 2020-09-07 09:58 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-07 09:58:50 UTC
Type: Bug


Attachments (Terms of Use)
dmesg with default i8042 parameters (81.38 KB, text/plain)
2020-05-25 10:49 UTC, James
no flags Details
dmesg with i8024 parameters reset=1 nomux=1 (82.01 KB, text/plain)
2020-05-25 10:50 UTC, James
no flags Details
[PATCH] Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists (1.49 KB, patch)
2020-08-24 15:26 UTC, Hans de Goede
no flags Details | Diff

Description James 2020-02-22 00:46:54 UTC
Description of problem:
For the first few seconds (or characters) of the LUKS password prompt during boot, keystrokes do not register with certainty -- perhaps a 50% chance. It seems to be worse if a Shift+... combination is used. After a while (or maybe 3-4 keypresses) thing settle and keystrokes register normally.

This seems to be machine-specific. I have one laptop where this does not manifest, another where it does. In both cases the keyboard is of the built-in i8042 variety :

[   2.471166] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4

Secureboot is enabled. There are no keyboard problems after the LUKS prompt.

[Curiously the one with the trouble also has problems with a TPM interrupt storm, but said module is disabled in UEFI setup. Only mention it because I recall this being on the same bus as the i8042 keyboard.]

Version-Release number of selected component (if applicable):
plymouth-0.9.4-11.20191022git32c097c.fc31.x86_64
dracut-049-27.git20181204.fc31.1.x86_64
kernel-5.4.20-200.fc31.x86_64

How reproducible:
Regularly.

Steps to Reproduce:
1. (Re)boot, wait for LUKS password prompt.
2. Attempt to type password.

Actual results:
First few keystrokes missed.

Expected results:
All keystrokes registered.

Comment 1 James 2020-04-19 10:58:47 UTC
Still present in F32, plymouth-0.9.4-14.20200325gite31c81f.fc32.x86_64

Comment 2 James 2020-05-15 06:48:13 UTC
Still present with kernel-5.6.11-300.fc32.x86_64. What is known:

- It looks like every other keystroke is missing.
- This affects both the graphical and text-mode console password prompt.
- The effect lasts a few seconds after presenting the password prompt.
- It only affects the laptop's built-in keyboard, this is not seen with a USB keyboard.
- There's some hardware dependency, it doesn't affect any other laptop I have.
- There are no keyboard-related issues at any point afterwards when the machine is booted.

Comment 3 James 2020-05-24 22:45:30 UTC
Changing this to kernel because I think it's i8042-related on this hardware. Things work better if I add "i8042.reset=1 i8042.nomux=1" to the kernel cmdline.

kernel-5.6.11-300.fc32.x86_64
kernel-5.6.12-300.fc32.x86_64
kernel-5.6.13-300.fc32.x86_64

Comment 4 Hans de Goede 2020-05-25 07:51:48 UTC
(In reply to James Ettle from comment #3)
> Changing this to kernel because I think it's i8042-related on this hardware.
> Things work better if I add "i8042.reset=1 i8042.nomux=1" to the kernel
> cmdline.

Interesting, good detective work there :)

Can you try if you need both, or is just nomux=1 (or reset=1) enough?

The kernel PS/2 driver has a list of quirks for devices which need the
nomux option. Not sure about the reset option.

To add a quirk I need DMI info, please run the following command
as *normal* user and copy and paste the output here:

grep . /sys/class/dmi/id/* 2>/dev/null

Comment 5 James 2020-05-25 10:49:12 UTC
Created attachment 1691897 [details]
dmesg with default i8042 parameters

Comment 6 James 2020-05-25 10:50:03 UTC
Created attachment 1691899 [details]
dmesg with i8024 parameters reset=1 nomux=1

Comment 7 James 2020-05-25 10:52:22 UTC
I've just done a number of test reboots and it seems that *both* i8042.reset=1 and i8042.nomux=1 are required for consistent behaviour at the LUKS password.

No adverse side-effects observed *yet*. All touchpad functions seem to work and the TPM is detected.

Note I've not done an exhaustive search of i8042's parameter space; I just stopped at what worked. I don't know if there's any better set of parameters here -- please let me know if there's a way I can extract better quality info on this.

The machine is essentially a badge-engineered Clevo N151CU chassis:

$ grep . /sys/class/dmi/id/* 2>/dev/null
/sys/class/dmi/id/bios_date:11/15/2019
/sys/class/dmi/id/bios_vendor:INSYDE Corp.
/sys/class/dmi/id/bios_version:1.07.07TE0
/sys/class/dmi/id/board_asset_tag:Tag 12345
/sys/class/dmi/id/board_name:Proteus
/sys/class/dmi/id/board_vendor:Entroware
/sys/class/dmi/id/board_version:EL07R4
/sys/class/dmi/id/chassis_asset_tag:No Asset Tag
/sys/class/dmi/id/chassis_type:10
/sys/class/dmi/id/chassis_vendor:Entroware
/sys/class/dmi/id/chassis_version:N/A                             
/sys/class/dmi/id/modalias:dmi:bvnINSYDECorp.:bvr1.07.07TE0:bd11/15/2019:svnEntroware:pnProteus:pvrEL07R4:rvnEntroware:rnProteus:rvrEL07R4:cvnEntroware:ct10:cvrN/A:
/sys/class/dmi/id/product_family:Proteus
/sys/class/dmi/id/product_name:Proteus
/sys/class/dmi/id/product_sku:EL07R4
/sys/class/dmi/id/product_version:EL07R4
/sys/class/dmi/id/sys_vendor:Entroware
/sys/class/dmi/id/uevent:MODALIAS=dmi:bvnINSYDECorp.:bvr1.07.07TE0:bd11/15/2019:svnEntroware:pnProteus:pvrEL07R4:rvnEntroware:rnProteus:rvrEL07R4:cvnEntroware:ct10:cvrN/A:

ADDITIONAL OBSERVATIONS:

For reference I have attached dmesg output both with and without the reset and nomux options. Out of curiosity I grepped both for '8042' and 'psmouse'.

With the kernel defaults, I see:

$ egrep '8042|psmouse' dmesg-i8042-default.log 
[    1.645768] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    2.272264] i8042: Detected active multiplexing controller, rev 1.1
[    2.274472] serio: i8042 KBD port at 0x60,0x64 irq 1
[    2.274480] serio: i8042 AUX0 port at 0x60,0x64 irq 12
[    2.274578] serio: i8042 AUX1 port at 0x60,0x64 irq 12
[    2.274603] serio: i8042 AUX2 port at 0x60,0x64 irq 12
[    2.274624] serio: i8042 AUX3 port at 0x60,0x64 irq 12
[    2.278436] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    3.862173] psmouse serio2: synaptics: Unable to query device: -5
[    8.870368] input: PS/2 Synaptics TouchPad as /devices/platform/i8042/serio2/input/input10
[    9.078254] psmouse serio2: Failed to enable mouse on isa0060/serio2

With reset=1 and nomux=1, we get:

$ egrep '8042|psmouse' dmesg-i8042-reset-nomux.log 
[    1.679506] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    1.684551] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.684555] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.688696] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    2.239664] psmouse serio1: synaptics: queried max coordinates: x [..5658], y [..4722]
[    2.277142] psmouse serio1: synaptics: queried min coordinates: x [1284..], y [1130..]
[    2.277146] psmouse serio1: synaptics: Your touchpad (PNP: PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.
[    2.347117] psmouse serio1: synaptics: Touchpad model: 1, fw: 9.32, id: 0x1e2a1, caps: 0xf00123/0x840300/0x2e800/0x52c093, board id: 3428, fw id: 2839257
[    2.393043] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input6
[    2.780422] input: MSFT0001:01 06CB:CD64 Touchpad as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-MSFT0001:01/0018:06CB:CD64.0001/input/input8

All touchpad functions appear to be working, though.

Comment 8 James 2020-08-23 13:43:24 UTC
(In reply to Hans de Goede from comment #4)
> The kernel PS/2 driver has a list of quirks for devices which need the
> nomux option. Not sure about the reset option.
> 
> To add a quirk I need DMI info, please run the following command
> as *normal* user and copy and paste the output here:
> 
> grep . /sys/class/dmi/id/* 2>/dev/null

Has this quirk made its way into any upstream kernel yet?

Comment 9 Hans de Goede 2020-08-23 13:51:12 UTC
I'm sorry, but the bugzilla email notification from this email was buried under a ton of other bugzilla email notifications, so I have not gotten around to even submitting a patch upstream for this yet :(

Your latest comment has bumped this up on the queue though, so I hope to expect to get around to this real soon now.

Comment 10 James 2020-08-23 14:42:40 UTC
Thanks for the update -- I'm in no rush for this. As soon as a kernel build with the patch is available, please let me know and I'll test it. Otherwise, please attach your patch here and I'll test it against the F32 current.

Comment 11 Hans de Goede 2020-08-24 12:21:25 UTC
Created attachment 1712351 [details]
[PATCH] Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists

Here is a kernel patch to auto-enable both the nomux and reset options on your model laptop. If you can build a kernel with this patch and give it a try that would be great.

Once I've confirmation that with this patch you no longer need to manually set the options I will submit it upstream.

Comment 12 James 2020-08-24 15:09:30 UTC
(In reply to Hans de Goede from comment #11)
> Created attachment 1712351 [details]
> [PATCH] Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists

I'm not sure that's the right patch -- it looks like something for thinkpad_acpi.

Comment 13 Hans de Goede 2020-08-24 15:22:31 UTC
Yes, I picked the first and only 0001-* file from the dir my file-selector defaulted to, but it was not the dir I expected, oops. I will attach the right one now.

Comment 14 Hans de Goede 2020-08-24 15:26:03 UTC
Created attachment 1712385 [details]
[PATCH] Input: i8042 - add Entroware Proteus EL07R4 to nomux and reset lists

Comment 15 James 2020-08-25 07:44:44 UTC
Thanks! I've built the and installed a kernel with the patch based on the 5.7.17-200 sources. The only problem at the moment is GRUB refuses to boot it with SecureBoot on -- 'invalid signature', despite the image being signed with a MOK I know works for modules.

I need SecureBoot to test since it appears the original keystroke problem only shows up when it is enabled. Which in itself is rather interesting...

Comment 16 Hans de Goede 2020-08-25 07:59:20 UTC
I'm afraid I don't have any experience with self signed kernels.

As a workaround you could do:

mokutil --disable-validation

And then after testing:

mokutil --enable-validation

Then you can boot an unsigned kernel while keeping secureboot on in the BIOS.

Comment 17 Hans de Goede 2020-09-02 17:44:53 UTC
Any luck with testing this?

Note you can even test it with secureboot disabled in the BIOS. You may then not be able to reproduce the original bug, but you should still be able to see the nomux result in dmesg, in the form of there being only 1 AUX port. That tests that the DMI match actually matches your machine which is the main thing which needs testing.

Comment 18 James 2020-09-02 19:52:21 UTC
(In reply to Hans de Goede from comment #17)
> Any luck with testing this?
> 
> Note you can even test it with secureboot disabled in the BIOS. You may then
> not be able to reproduce the original bug, but you should still be able to
> see the nomux result in dmesg, in the form of there being only 1 AUX port.
> That tests that the DMI match actually matches your machine which is the
> main thing which needs testing.

I haven't been able to Secure Boot a kernel I built myself, but based upon what you said above I believe the patch is working.

From a stock F32 kernel without any i8042 options:

[    1.645665] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    2.271128] i8042: Detected active multiplexing controller, rev 1.1
[    2.274164] serio: i8042 KBD port at 0x60,0x64 irq 1
[    2.274169] serio: i8042 AUX0 port at 0x60,0x64 irq 12
[    2.274171] serio: i8042 AUX1 port at 0x60,0x64 irq 12
[    2.274172] serio: i8042 AUX2 port at 0x60,0x64 irq 12
[    2.274173] serio: i8042 AUX3 port at 0x60,0x64 irq 12
[    2.279074] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    8.242957] input: PS/2 Synaptics TouchPad as /devices/platform/i8042/serio2/input/input10

With the i8042 options, OR (no i8042 options AND the patch):

[    1.646948] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
[    1.651549] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.651555] serio: i8042 AUX port at 0x60,0x64 irq 12
[    1.658027] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    2.368316] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input6

Comment 19 Hans de Goede 2020-09-07 09:58:50 UTC
Ok, thank you.

I've posted the patch upstream now.

For Fedora it is probably best to just wait for the patch to trickle-down from upstream, in the mean time you can keep using the kernel cmdline options.


Note You need to log in before you can comment on or make changes to this bug.