Skip to content

Fix Goodix fingerprint reader disconnecting when USB-C devices are plugged in or on suspend/resume#5130

Open
dinatih wants to merge 4 commits intobasecamp:devfrom
dinatih:fix-goodix-fingerprint-usb-disconnect
Open

Fix Goodix fingerprint reader disconnecting when USB-C devices are plugged in or on suspend/resume#5130
dinatih wants to merge 4 commits intobasecamp:devfrom
dinatih:fix-goodix-fingerprint-usb-disconnect

Conversation

@dinatih
Copy link
Copy Markdown

@dinatih dinatih commented Mar 27, 2026

Problem

On Framework laptops (Radeon 860M), the Goodix fingerprint reader (27c6:609c) intermittently
disconnects in two scenarios:

1. USB-C device plugged inucsi_acpi errors trigger a USB reset on bus 1:

ucsi_acpi USBC000:00: unknown error 256
ucsi_acpi USBC000:00: unknown error 256
ucsi_acpi USBC000:00: unknown error 0
usb 1-1: reset full-speed USB device number 2 using xhci_hcd
usb 1-1: reset full-speed USB device number 2 using xhci_hcd

2. Resume from suspend — the xhci controller hosting bus 1 dies during PM resume, causing
the device to fully disconnect without emitting a standard udev remove event:

xhci_hcd 0000:c1:00.4: xHCI host not responding to stop endpoint command
xhci_hcd 0000:c1:00.4: xHCI host controller not responding, assume dead
xhci_hcd 0000:c1:00.4: HC died; cleaning up
usb 1-1: PM: dpm_run_callback(): usb_dev_resume returns -22
usb 1-1: PM: failed to resume async: error -22
usb 1-1: USB disconnect, device number 2

After this, lsusb no longer shows the device and fingerprint auth is broken until reboot.

Fix

For USB-C disconnects: udev rule sets power/control = on to disable runtime power
management on the device, preventing the USB reset from fully dropping it.

For suspend/resume failures: USB quirk RESET_RESUME (0x0080) handles most resume cycles.
For cases where the xhci controller itself dies (as shown above), a systemd-sleep post-resume
hook detects the missing device and rebinds the xhci PCI controller (0000:c1:00.4) to force
USB re-enumeration.

Confirmed working from today's logs (29 March 2026):

# Hook triggered after xhci death — device restored
root: fix-goodix-fingerprint-resume: device not found after resume, rebinding xhci controller
root: fix-goodix-fingerprint-resume: device restored successfully

# Hook confirmed device present on normal resumes — no action taken
root: fix-goodix-fingerprint-resume: device present, nothing to do

Changes

  • default/udev/99-goodix-fingerprint.rules — disable runtime PM on the device
  • default/modprobe.d/fix-goodix-fingerprint-usb.conf — apply RESET_RESUME quirk
  • default/systemd/system-sleep/fix-goodix-fingerprint-resume — post-resume hook to rebind
    xhci controller when device fails to come back after suspend
  • install/config/hardware/fix-goodix-fingerprint-usb.sh — deploy all of the above
  • migrations/1774637906.sh — apply on existing installs

Test plan

  • Boot: fingerprint reader detected (lsusb | grep 27c6)
  • Plug/unplug USB-C device: fingerprint reader stays functional
  • Suspend/resume: fingerprint reader still present after wakeup
  • journalctl | grep fix-goodix-fingerprint-resume shows "device present" or "device restored"

…ged in

Adds a udev rule that forces USB power control to always-on for the Goodix
fingerprint reader (27c6:609c), preventing disconnection caused by USB power
delivery negotiation when other devices (e.g. phones) are plugged in.

Despite the global USB autosuspend being disabled via modprobe, the Goodix
driver overrides power management for its own device. The udev rule explicitly
enforces power/control=on at the device level, which prevents it from failing
to recover during USB-C power negotiation events. This follows the same pattern
already used for the Dell XPS haptic touchpad fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 27, 2026 19:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a udev-based workaround to keep the Goodix (27c6:609c) fingerprint reader from autosuspending, preventing disconnects during USB-C power events (e.g., when plugging in a phone).

Changes:

  • Add a udev rule to force power/control=on for the Goodix fingerprint device.
  • Add an install-time hardware script to deploy/reload the rule only when a Goodix device is detected.
  • Add a migration + wire the fix into the main hardware setup pipeline.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
migrations/1774637906.sh Runs the new hardware fix for existing installations via migration.
install/config/hardware/fix-goodix-fingerprint-usb.sh Detects the device and installs/reloads the udev rule.
install/config/all.sh Ensures the fix script runs during the standard install/config flow.
default/udev/fix-goodix-fingerprint-usb.rules Implements the udev rule that forces the device to stay powered on.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install/config/hardware/fix-goodix-fingerprint-usb.sh Outdated
Comment thread install/config/hardware/fix-goodix-fingerprint-usb.sh Outdated
Comment thread install/config/hardware/fix-goodix-fingerprint-usb.sh Outdated
Comment thread default/udev/fix-goodix-fingerprint-usb.rules Outdated
Comment thread migrations/1774637906.sh Outdated
…d quoting

- Check both idVendor and idProduct (27c6:609c) when detecting the device
- Add bash shebang to avoid ambiguity with sh execution
- Narrow udevadm trigger to USB subsystem + vendor/product match
- Match add|change actions in udev rule to cover power management transitions
- Quote $OMARCHY_PATH in migration source command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…sume

The Goodix fingerprint reader (27c6:609c) also fails to recover after system
suspend with error -EINVAL during async USB resume. Adding the RESET_RESUME
quirk (0x0080) forces a full USB reset on wake instead of a soft resume,
which resolves the issue.

Tested on Framework 13 (AMD Ryzen AI 5 340): closing and reopening the lid
now correctly restores fingerprint authentication.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dinatih dinatih requested a review from Copilot March 27, 2026 23:55
@dinatih dinatih changed the title Fix Goodix fingerprint reader disconnecting when USB devices are plugged in Fix Goodix fingerprint reader disconnecting when USB-C devices are plugged in or on suspend/resume Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…esume failure

The RESET_RESUME quirk (0x0080) prevents disconnects in most cases, but on
some resume cycles the device fails with -EINVAL during async PM resume and
fully disconnects from the USB bus (error -22). The udev monitor didn't catch
this because no standard udev remove event was emitted.

This adds a systemd-sleep post-resume hook that detects the absence of the
Goodix device after wakeup and forces re-enumeration by rebinding the xhci
PCI controller hosting bus 1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants