Page MenuHomeFreeBSD

atkbd: fix first keystroke force reset
ClosedPublic

Authored by aokblast on Fri, May 23, 7:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 30, 3:45 PM
Unknown Object (File)
Wed, May 28, 8:06 PM
Unknown Object (File)
Wed, May 28, 8:02 PM
Unknown Object (File)
Wed, May 28, 7:06 PM
Unknown Object (File)
Wed, May 28, 6:51 PM
Subscribers

Details

Summary

The Framework Laptop EC debug console shows the keyboard force reset
when the first keystroke interrupt reached.

It is because the return value of probe_keyboard is non zero from the
echo test so that the kernel consider the keyboard is unconfigured.

So that when the keyboard interrupt is reached at the first time, it try
to reset then configure the keyboard.

Co-Authored-By: obiwac
Sponsored By: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Fri, May 23, 8:15 PM
sys/dev/atkbdc/atkbd.c
1260–1271

Could this introduce a regression on other systems? I found

Every byte sent to the keyboard gets a response of 0xFA ("acknowledge") from the keyboard.
The only exceptions to this are the keyboard's response to the "Resend" and "Echo" commands

should we do something like

int data;

data = read_kbd_data(kbdc);
if (data == KBD_ACK)
        data = read_kbd_data(kbdc);
if (data != KBD_ECHO) {
        empty_both_buffers(...

Should we cache read_kbd_data() rather than reread it?

Be compatible for correct behavior

This revision now requires review to proceed.Sat, May 24, 2:34 AM

Should we cache read_kbd_data() rather than reread it?

What do you mean on the cache? I thought read keyboard data is deque from some where or read from the bus. So reread will cause the different value.

sys/dev/atkbdc/atkbd.c
1260–1271

Yes, I look at the AT keyboard manual and it also has the narration. Fix it. Also, Maybe the chromebook is also the same problem but I don't have one to check.

This revision is now accepted and ready to land.Sat, May 24, 4:30 PM

@wulf Are you still have concern on the read_kbd_data? If not, I plan to create the patch for merging.

@wulf Are you still have concern on the read_kbd_data? If not, I plan to create the patch for merging.

Go forward if this patch fixes something for you. And you wrote that it really fixes

This revision was automatically updated to reflect the committed changes.
jrtc27 added inline comments.
sys/dev/atkbdc/atkbd.c
1252