Skip to content

cc1: harden RTL8821CU Wi-Fi across warm reboots - #261

Open
pdscomp wants to merge 5 commits into
mainfrom
doom/oldwifibroke
Open

cc1: harden RTL8821CU Wi-Fi across warm reboots#261
pdscomp wants to merge 5 commits into
mainfrom
doom/oldwifibroke

Conversation

@pdscomp

@pdscomp pdscomp commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Problem

The Elegoo Centauri Carbon 1 RTL8821CU Wi-Fi adapter intermittently failed after warm reboot:

  • Early failures occurred during USB enumeration, including SET_ADDRESS returning -EPROTO.
  • Later captures showed the adapter enumerate and bind, then fail rtw88 vendor control transfers with -EPROTO during firmware startup.
  • Once wedged, the old path issued more than 1,000 failing register controls and could remain broken across soft resets.

The original failure reproduced every 3-5 soft reboot/flash cycles on the CC1 original mainboard (not the updated wifi chip one).

Changes

linux: add slow-reset quirk for the CC1 USB hub

Marks the CC1 QinHeng 1a86:8091 parent hub with USB_QUIRK_HUB_SLOW_RESET. USB core gives downstream devices an extra 100 ms after port reset, directly improving the pre-enumeration warm-reset failure without cycling the whole hub.

The initial hub-quirk plus shutdown-unbind experiment reached roughly 10 cycles before a different, post-bind -EPROTO failure was captured.

rtw88: retry failed USB register controls

Retries only register-control -EPROTO failures after 5, 20, 80, 320, and 1280 ms. Successful transfers have no added delay. A terminal failure latches the control transport as broken, preserving the triggering operation/address and suppressing the previous thousand-message error storm.

This replaces a discarded blanket 5 ms delay experiment, which added about 18 seconds to Wi-Fi startup and still failed after 19 loops.

rtw88: serialize USB vendor controls

Adds the vendor-request mutex used by Realtek's 8821cu driver. It keeps a register request and its RTL8821C 0x4e0 reg-sec companion atomic and serializes firmware-page controls on the same mutex, preventing control requests from interleaving. Firmware fragments are not individually retried because the full download is checksummed.

Validation

  • Clean rtw88 build: 1,143 tasks passed; both patches applied without fuzz.
  • Full CC1 SWU build on current main: 6,521 tasks passed.
  • Combined production fixes plus an experimental shutdown hook: 44 consecutive reboot loops.
  • Final image with only the kernel/rtw88 changes and no shutdown hook: 540 consecutive successful reboot loops on carbon-devu.
  • No fixed successful-path delay remains.

The reboot counts validate the combined final patch set; the driver patches were not individually ablated.

@pdscomp
pdscomp temporarily deployed to approval-given July 20, 2026 13:38 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

✅ Build Artifacts

Branch: doom/oldwifibroke
Build: 80a77c2 (merge into main)

Artifact Size
CC1 Firmware 91.31 MB

View workflow run

@pdscomp
pdscomp marked this pull request as ready for review July 20, 2026 14:00
@pdscomp
pdscomp requested a review from jamesturton July 20, 2026 14:00
@pdscomp

pdscomp commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Full Wi-Fi investigation log and test history:

https://gist.github.com/pdscomp/c207506c250913d83c703178d089b901

@pdscomp
pdscomp temporarily deployed to approval-given July 21, 2026 13:33 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown

✅ Build Artifacts

Branch: doom/oldwifibroke
Build: 085eb29 (merge into main)

Artifact Size
CC1 Firmware 91.31 MB

View workflow run

@github-actions

Copy link
Copy Markdown

✅ Build Artifacts

Branch: doom/oldwifibroke
Build: 9073ece (merge into main)

Artifact Size
CC1 Firmware 91.31 MB

View workflow run

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.

1 participant