Skip to content

nanopi-r76s: fix slow WiFi by enabling SDIO SDR104#9929

Merged
SuperKali merged 2 commits into
armbian:mainfrom
OpenSource-YYT:fix-nanopi-r76s-wifi-sdr104
Jun 4, 2026
Merged

nanopi-r76s: fix slow WiFi by enabling SDIO SDR104#9929
SuperKali merged 2 commits into
armbian:mainfrom
OpenSource-YYT:fix-nanopi-r76s-wifi-sdr104

Conversation

@SuperKali
Copy link
Copy Markdown
Member

@SuperKali SuperKali commented Jun 3, 2026

Description

The R76S WiFi (RTL8822CS on M.2 SDIO) never came up in UHS. The card runs on a fixed-1.8V rail yet still sets S18A=1, so the core sent CMD11. There is no real voltage transition to make, the dw_mmc clock update times out, and the bus drops to high speed.

The fix skips that switch when the host already signals 1.8V, matching the guard in mmc_sd_init_card(). It lands in current, edge and bleedingedge. cap-sd-highspeed on the node keeps a 50MHz path if SDR104 tuning ever fails.

How Has This Been Tested?

Built edge (7.0.11), flashed on an R76S, iperf3 over WiFi to the gateway.

  • Before: high speed SDIO card at 50MHz, ~51 down / ~23 up Mbit/s
  • After: UHS-I speed SDR104 SDIO card at 198MHz, ~210 down / ~52 up Mbit/s

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Summary by CodeRabbit

Release Notes

  • New Features

    • Added SD high-speed mode support for SDIO controllers across multiple kernel versions.
  • Bug Fixes

    • Fixed redundant voltage-switch sequences that could cause controller stalls when initializing certain SDIO cards already configured at 1.8V.

SuperKali added 2 commits June 3, 2026 19:41
A UHS SDIO card can report S18A=1 even on a fixed-1.8V rail, so the core
ran CMD11 and stalled the dw_mmc voltage switch, capping the bus at HS
50MHz. Guard the switch on signal_voltage, mirroring mmc_sd_init_card.
Added for current, edge and bleedingedge.

Signed-off-by: SuperKali <hello@superkali.me>
Gives the RTL8822CS a clean 50MHz high-speed fallback if SDR104 tuning
fails, instead of dropping to 25MHz legacy. With the mmc CMD11 fix the
WiFi now links at SDR104 200MHz, ~210 Mbit/s down versus 51 before.

Signed-off-by: SuperKali <hello@superkali.me>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b4a9a7a7-a338-4553-8342-891859bcf280

📥 Commits

Reviewing files that changed from the base of the PR and between 107075b and babdcec.

📒 Files selected for processing (6)
  • patch/kernel/archive/rockchip64-6.18/dt/rk3576-nanopi-r76s.dts
  • patch/kernel/archive/rockchip64-6.18/mmc-sdio-skip-cmd11-voltage-switch-when-already-1v8.patch
  • patch/kernel/archive/rockchip64-7.0/dt/rk3576-nanopi-r76s.dts
  • patch/kernel/archive/rockchip64-7.0/mmc-sdio-skip-cmd11-voltage-switch-when-already-1v8.patch
  • patch/kernel/archive/rockchip64-7.1/dt/rk3576-nanopi-r76s.dts
  • patch/kernel/archive/rockchip64-7.1/mmc-sdio-skip-cmd11-voltage-switch-when-already-1v8.patch

📝 Walkthrough

Walkthrough

This PR adds SD high-speed support to the RK3576 NanoPI R76S device-tree configuration and prevents redundant 1.8V voltage switching during SDIO initialization. Both changes are applied consistently across kernel versions 6.18, 7.0, and 7.1.

Changes

SDIO Capabilities and Voltage-Switch Fixes

Layer / File(s) Summary
Add SD high-speed capability to SDIO device-tree
patch/kernel/archive/rockchip64-6.18/dt/rk3576-nanopi-r76s.dts, patch/kernel/archive/rockchip64-7.0/dt/rk3576-nanopi-r76s.dts, patch/kernel/archive/rockchip64-7.1/dt/rk3576-nanopi-r76s.dts
The &sdio node is updated to include cap-sd-highspeed property across kernel versions 6.18, 7.0, and 7.1, enabling SD high-speed mode support.
Skip redundant 1.8V voltage switch in SDIO init
patch/kernel/archive/rockchip64-6.18/mmc-sdio-skip-cmd11-voltage-switch-when-already-1v8.patch, patch/kernel/archive/rockchip64-7.0/mmc-sdio-skip-cmd11-voltage-switch-when-already-1v8.patch, patch/kernel/archive/rockchip64-7.1/mmc-sdio-skip-cmd11-voltage-switch-when-already-1v8.patch
The mmc_sdio_init_card() function is patched across kernel versions 6.18, 7.0, and 7.1 to add a guard that prevents issuing CMD11 voltage switch when the host is already at 1.8V, preventing potential controller stalls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Ready to merge, 05

Suggested reviewers

  • joekhoobyar
  • krachlatte
  • pyavitz
  • rpardini
  • TheSnowfield
  • brentr

Poem

🐰 A rabbit hops through kernel trees so tall,
Device-trees bloom with cap-sd-highspeed call,
While voltage guards skip redundant CMD11 dance,
Three kernel paths get their RK3576 chance,
High-speed SDIO now flows without a stall! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: enabling SDIO SDR104 for WiFi performance improvement on the R76S board.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added 08 Milestone: Third quarter release size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jun 3, 2026
@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot removed the Needs review Seeking for review label Jun 4, 2026
@SuperKali SuperKali merged commit 2858333 into armbian:main Jun 4, 2026
13 checks passed
@SuperKali SuperKali deleted the fix-nanopi-r76s-wifi-sdr104 branch June 4, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

2 participants