Bug 242660 - loader_lua.efi unable to do anything after r355347 on Lenovo ThinkPad E590T (20NB)
Summary: loader_lua.efi unable to do anything after r355347 on Lenovo ThinkPad E590T (...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-12-16 08:47 UTC by Trond Endrestøl
Modified: 2019-12-22 20:37 UTC (History)
1 user (show)

See Also:


Attachments
Patch by Toomas Soome (598 bytes, patch)
2019-12-17 02:07 UTC, Trond Endrestøl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond Endrestøl 2019-12-16 08:47:56 UTC
System is Lenovo ThinkPad E490T (20NB).
It's running the latest firmware, 1.22.
loader_lua.efi is installed in the ESP instead of the usual boot1.efi.
Pressing 2 or 3 when the menu is displayed, blocks the system. Ctr+Alt+Delete is working.
r355346 is the last revision known to work correctly under these circumstances.
Please advise on how to debug this issue.
Comment 1 Trond Endrestøl 2019-12-16 09:11:38 UTC
It's an E590T, sorry.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2019-12-16 21:24:27 UTC
Notify committer of r355347.
Comment 3 Trond Endrestøl 2019-12-17 02:07:05 UTC
Created attachment 210000 [details]
Patch by Toomas Soome

I have tried the attached patch.

When I pressed 3 the first time, the loader spat out:

kss: 0 kts: a3

Nothing else happened, so I hit 3 again, and the loader spat out:

kss: 0 kts: 23

The loader responds to keypresses but are unable to act upon them.
Comment 4 Toomas Soome freebsd_committer freebsd_triage 2019-12-17 08:24:37 UTC
(In reply to Trond.Endrestol from comment #3)
OK, I see, it was my error reading the specification.

What I did miss was statement:
"It should also be noted that certain input devices may not be able to produce shift or toggle state information, and in those cases the high order bit in the respective Toggle and Shift state fields should not be active."

Therefore we will need to process scancode/unicodechar despite the shift and toggle status bits.
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-12-17 08:30:59 UTC
A commit references this bug:

Author: tsoome
Date: Tue Dec 17 08:30:11 UTC 2019
New revision: 355844
URL: https://svnweb.freebsd.org/changeset/base/355844

Log:
  loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status

  From UEFI specification 2.8, page 434:
  "It should also be noted that certain input devices may not be able to produce
  shift or toggle state information, and in those cases the high order bit in
  the respective Toggle and Shift state fields should not be active."

  But we still need to check for ScanCode and UnicodeChar.

  PR:		242660
  Reported by:	Trond Endrestol
  MFC after:	1 week

Changes:
  head/stand/efi/libefi/efi_console.c
Comment 6 Trond Endrestøl 2019-12-17 09:11:11 UTC
(In reply to commit-hook from comment #5)
Thanks. I'll try the new change when I get home this afternoon.
Comment 7 Trond Endrestøl 2019-12-17 21:25:13 UTC
r355844 solved my problem, and quite possibly made the EFI loader better. Thank you, Toomas.
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-12-22 20:37:12 UTC
A commit references this bug:

Author: tsoome
Date: Sun Dec 22 20:36:57 UTC 2019
New revision: 356027
URL: https://svnweb.freebsd.org/changeset/base/356027

Log:
  MFC r355844:
  loader.efi: efi_readkey_ex needs to key despite the shift status or toggle status

  From UEFI specification 2.8, page 434:
  "It should also be noted that certain input devices may not be able to produce
  shift or toggle state information, and in those cases the high order bit in
  the respective Toggle and Shift state fields should not be active."

  But we still need to check for ScanCode and UnicodeChar.

  PR:             242660

Changes:
_U  stable/12/
  stable/12/stand/efi/libefi/efi_console.c