public inbox for platform-driver-x86@vger.kernel.org
 help / color / mirror / Atom feed
* [Bug 221238] New: lg-laptop: Spurious ACK and dropped keystrokes due to unprotected i8042 port access
@ 2026-03-15 11:15 bugzilla-daemon
  2026-03-15 11:18 ` [Bug 221238] " bugzilla-daemon
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: bugzilla-daemon @ 2026-03-15 11:15 UTC (permalink / raw)
  To: platform-driver-x86

https://bugzilla.kernel.org/show_bug.cgi?id=221238

            Bug ID: 221238
           Summary: lg-laptop: Spurious ACK and dropped keystrokes due to
                    unprotected i8042 port access
           Product: Drivers
           Version: 2.5
          Hardware: Intel
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Platform_x86
          Assignee: drivers_platform_x86@kernel-bugs.osdl.org
          Reporter: alfonso.garcia.frey@gmail.com
        Regression: No

The lg-laptop driver (drivers/platform/x86/lg-laptop.c) communicates with the
LG embedded controller using raw inb()/outb() on i8042 ports 0x60/0x64,
completely bypassing the kernel's i8042 driver and its locking (i8042_mutex /
i8042_lock). This causes a race condition between lg-laptop EC transactions and
the atkbd driver's interrupt handling, resulting in:

  1. atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying
to access hardware directly.
  2. Intermittent key drops — keys (particularly on the left side of the
keyboard matrix: s, w, left Ctrl) stop responding for several seconds.
  3. Occasional phantom or misinterpreted scancodes.

The problem has worsened significantly since battery_hook_register() was added
to the driver (commit 822933b1b29), which causes periodic EC access in the
background on every battery status poll — independent of any user Fn-key
interaction.

Steps to reproduce:

  1. Boot any LG Gram laptop (tested on 16Z90Q-G.AD76F, 2022 model) with the
lg_laptop module loaded.
  2. Use the keyboard normally for 10-30 minutes.
  3. Observe dmesg | grep "Spurious ACK" — messages accumulate over time.
  4. Keys intermittently stop registering input.

Frequency:

  - Kernel 6.8.0-101 (with battery_hook_register): ~28 spurious ACKs/day,
frequent key drops
  - Kernel 5.15.0-171 (without battery hook): ~7 spurious ACKs/day, less
frequent key drops
  - Blacklisting lg_laptop: 0 spurious ACKs, no key drops (confirms the driver
as the cause)

Hardware:

  - LG Gram 16Z90Q-G.AD76F (2022)
  - Built-in PS/2 keyboard: AT Translated Set 2 keyboard (i8042,
isa0060/serio0)

Affected kernel versions:

  - 5.15.0-171-generic (Ubuntu/Mint)
  - 6.8.0-101-generic (Ubuntu HWE)
  - Likely all versions since driver inclusion (4.14+), worsened after battery
hook addition

Proposed fix:

Wrap the raw port I/O sequences in lg-laptop.c with i8042_lock_chip() /
i8042_unlock_chip() to serialize access with the kernel's i8042 interrupt
handler:

  #include <linux/i8042.h>

  static int lg_ec_read(unsigned char addr, unsigned char *val)
  {
      int ret;

      ret = i8042_lock_chip();
      if (ret)
          return ret;

      /* existing inb/outb sequence */

      i8042_unlock_chip();
      return 0;
  }

This is the same approach used by other drivers that need direct EC port
access. All functionality is preserved.

Current workaround:

  echo "blacklist lg_laptop" | sudo tee
/etc/modprobe.d/blacklist-lg-laptop.conf

This eliminates the issue but disables keyboard backlight, fan mode, battery
care, and Fn-key hotkey support.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-25 23:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-15 11:15 [Bug 221238] New: lg-laptop: Spurious ACK and dropped keystrokes due to unprotected i8042 port access bugzilla-daemon
2026-03-15 11:18 ` [Bug 221238] " bugzilla-daemon
2026-03-15 11:29 ` [Bug 221238] lg-laptop: Spurious ACK and dropped keystrokes caused by ACPI method calls conflicting with i8042 driver bugzilla-daemon
2026-03-15 11:34 ` bugzilla-daemon
2026-03-15 13:56 ` bugzilla-daemon
2026-03-15 13:58 ` bugzilla-daemon
2026-03-15 14:51 ` bugzilla-daemon
2026-03-15 21:07 ` bugzilla-daemon
2026-03-19  4:04 ` bugzilla-daemon
2026-03-19 13:01 ` bugzilla-daemon
2026-03-25 23:18 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox