Skip to content

MacBookAir9,1: t2bce_vhci desync after rapid S3 suspend/resume cycles — 'Unhandled system event: 50' on resume, internal keyboard dead, next suspend wedges (linux-t2 7.1.8) #24

Description

@githonllc

Summary

After several lid-close/lid-open S3 suspend/resume cycles in quick succession on a
MacBookAir9,1, one resume completes with t2bce_vhci: Unhandled system event: 50.
The next lid close (~24 s later) never reaches S3: the VHCI command channel
desyncs (Possible desync, cmd cancel timed out), the internal keyboard and
trackpad stop responding at the lock screen, a udev worker hangs indefinitely on
the trackpad evdev node, and the suspend request wedges. The machine had to be
forcibly powered off.

This uses the newer t2bce stack (v0.06), not legacy apple-bce.

Unlike #22 (hibernate/S4 resume failure followed by kernel GP faults), this is
plain S3 suspend, there is no oops, and the failure is preceded by the
Unhandled system event: 50 message — the VHCI simply desyncs and everything
that touches it hangs.

Hardware

  • Model: MacBookAir9,1
  • Board: Mac-0CFF9C7C2B63DF8D
  • Firmware: BIOS 2103.100.6.0.0, iBridge 23.16.15067.0.0
  • T2 Bridge Controller: PCI 0000:74:00.1 (106b:1801)

Software

  • Distribution: Omarchy / Arch Linux
  • Kernel: 7.1.8-arch1-Watanare-T2-3-t2 (linux-t2 7.1.8.arch1-3)
  • t2bce driver stack: v0.06 (drivers/staging/t2bce)
  • systemd 261.2-1, Hyprland 0.56.2-1
  • /sys/power/mem_sleep: s2idle [deep] — all sleeps below are S3 deep

Steps to reproduce

  1. Boot normally, log in to the graphical session.
  2. Close and open the lid several times over ~20 minutes (five S3 cycles here).
  3. On an eventually-unlucky resume, the kernel logs
    t2bce_vhci: Unhandled system event: 50 s=0 p1=0 p2=0 shortly after the
    internal keyboard re-enumerates.
  4. Close the lid again within ~30 seconds.
  5. The VHCI desyncs; internal keyboard/trackpad are dead at the lock screen and
    the suspend never enters S3. Only a forced power-off recovers.

Reproducibility is timing-dependent: four earlier cycles in the same boot —
including one where the lid was closed only 16 s after resume — survived. The
fatal cycle is the only one where Unhandled system event: 50 was logged.

Timeline (journal from the affected boot)

Suspend/resume cycles leading up to the failure:

14:24:26 PM: suspend exit
14:32:21 PM: suspend entry (deep)
14:33:04 PM: suspend exit
14:36:50 PM: suspend entry (deep)
14:39:04 PM: suspend exit
14:39:20 PM: suspend entry (deep)      <- 16 s after resume, survived
14:44:32 PM: suspend exit
14:44:58 PM: suspend entry (deep)
14:45:31 PM: suspend exit              <- fatal cycle's resume

The final resume looks normal at first (keyboard re-enumerates as usb 5-5
device 18), then the unhandled event arrives:

14:45:29.647 t2bce_core: suspend: exit status=0 stateful_valid=1 no_state_resume=0 no_state_fallback=0
14:45:29.655 t2bce_core: resume: exit status=0 path=stateful stateful_valid=0 no_state_resume=0 no_state_fallback=0
14:45:29.662 t2bce_vhci: stateful resume exit status=0
14:45:29.662 t2bce_vhci: bus_resume exit status=0 no_state_resume=0
14:45:29.727 usb 5-5: new high-speed USB device number 18 using t2bce_core
14:45:30.012 apple 0003:05AC:0280.003C: input,hiddev98,hidraw3: USB HID v1.01 Keyboard [Apple Inc. Apple Internal Keyboard / Trackpad] on usb-t2bce_vhci-5/input1
14:45:30.823 t2bce_vhci: Unhandled system event: 50 s=0 p1=0 p2=0
14:45:31.140 PM: suspend exit

Lid closed again at 14:45:55; the suspend request then wedges and the VHCI
desyncs:

14:45:55.321 systemd-logind: Suspending...
14:46:03.552 t2bce_vhci: Possible desync, cmd cancel timed out
14:46:06.624 t2bce_vhci: Possible desync, cmd cancel timed out
14:46:09.695 t2bce_vhci: Possible desync, cmd cancel timed out
14:46:10.498 systemd-logind: Delay lock is active (UID 0/root, PID 782/NetworkManager) but inhibitor timeout is reached.
14:46:10.502 systemd[1]: Starting System Suspend...
14:46:30.815 (udev-worker): event7: Spawned process '/usr/lib/udev/libinput-fuzz-to-zero /sys/devices/pci0000:00/.../t2bce_vhci/usb5/5-5/5-5:1.2/0003:05AC:0280.003D/input/input35/event7' is taking longer than 59s to complete.
14:46:40.928 t2bce_vhci: Possible desync, cmd cancel timed out

No PM: suspend entry ever follows the 14:46:10 suspend start — the freeze is
blocked on the hung VHCI — and the journal ends at 14:46:56 with the forced
power-off.

Other observations

  • Keyboard/trackpad input was dead the entire time; the power button (ACPI/EC
    path) still woke the display, which is how the lock screen cursor could be
    toggled while the keyboard stayed unresponsive.
  • No oops, no memory pressure, no NVMe/filesystem errors in the same window.
  • The user-session sleep-lock service (omarchy-sleep-lock.service) crash-looped
    with "Failed to inhibit: The operation inhibition has been requested for is
    already running" throughout — downstream symptom of the wedged suspend, not a
    cause.
  • After the forced reboot the driver behaves normally again.

Questions / suggestions

  1. What is system event 0x50? The Unhandled system event: 50 s=0 p1=0 p2=0
    message 0.3 s before PM: suspend exit is the only observable difference
    between this resume and the four healthy ones, so it looks like the T2 was
    already signalling a state the driver did not track.
  2. Could t2bce_vhci recover from a command-cancel timeout instead of staying
    permanently desynced — e.g. tear down and re-enumerate the virtual bus (the
    equivalent of the "HC died" path), so the keyboard comes back without a
    forced power-off? As it stands the hang also blocks the next suspend, which
    turns a driver glitch into an unclean shutdown.

Happy to provide the full journal for the affected boot or test patches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions