Skip to content

sm8550-6.18: Fix TF card IO performance regression#9546

Merged
igorpecovnik merged 1 commit intoarmbian:mainfrom
kasimling:odin2_fix_sdcard_io_perf_2
Mar 23, 2026
Merged

sm8550-6.18: Fix TF card IO performance regression#9546
igorpecovnik merged 1 commit intoarmbian:mainfrom
kasimling:odin2_fix_sdcard_io_perf_2

Conversation

@kasimling
Copy link
Contributor

@kasimling kasimling commented Mar 16, 2026

  • Fix the issue that downstream MSM sdhc driver cannot work on 6.18.14 or newer kernel
  • Switch back to downstream MSM sdhc driver for Ayn Odin2 devices to fix the IO performance regression brought by upstream driver.

Before this fix, average sequential read bandwidth on a UHS-I SDR104 card is 16.8MiB/s. After this fix applied, it is 85.1MiB/s.

It fixes commit f785a6d

Summary by CodeRabbit

  • Chores
    • Kernel config updated to enable 48-bit ARM64 addressing, expanded netfilter/NAT/bridge capabilities, enable MMC downstream support, and remove certain debug-info options.
  • Improvements
    • Switch to downstream MMC/SDHC implementation with device-tree updates for Odin2 to improve storage, power and performance behavior.
  • Maintenance
    • Minor driver cleanup to streamline MMC/SDHC removal/cleanup paths.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7f5e5411-ac5c-476d-a458-33bdfd692c84

📥 Commits

Reviewing files that changed from the base of the PR and between a8b961b and 0a055ca.

📒 Files selected for processing (4)
  • config/kernel/linux-sm8550-edge.config
  • patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
  • patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch

Disabled knowledge base sources:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

Updates enable and wire Qualcomm downstream SDHC support on SM8550: kernel config changes, removal of platform free calls in the downstream SDHCI driver, clock ops revert for SDCC RCGs, and device-tree additions/replacements to instantiate the downstream SDHC node with clocks, regulators, interconnects, QoS and operating-points.

Changes

Cohort / File(s) Summary
Kernel Configuration
config/kernel/linux-sm8550-edge.config
Enable ARM64 48-bit VA, add legacy xtables and various IPv4/IPv6/bridge netfilter NAT/targets/modules, enable MMC_SDHCI_MSM_DOWNSTREAM, remove DWARF5/reduced debug options.
SDHCI Driver cleanup
patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
Removed sdhci_pltfm_free() calls from Qualcomm downstream SDHCI driver cleanup paths (probe error label and remove).
Clock ops revert
patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
Change .ops for gcc_sdcc2_apps_clk_src and gcc_sdcc4_apps_clk_src back to clk_rcg2_shared_ops from clk_rcg2_shared_floor_ops.
Device tree: Odin2 downstream SDHC
patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch
Replace &sdhc_2 nodes with a qcom,sdhci-msm-v5-downstream node in two Odin2 DTS files: add regs/irqs, clocks, DLL HSR, SMMU/IOMMU, DMA coherence, interconnect/msm-bus vectors, operating-points (opp tables), pinctrl, card-detect/reset GPIOs, QoS subnodes and regulator bindings.

Sequence Diagram(s)

sequenceDiagram
  participant DT as Device Tree
  participant Kernel as Kernel (platform core)
  participant Driver as sdhci-msm-downstream
  participant Clk as Clock framework
  participant Reg as Regulators
  participant Inter as Interconnect/msm-bus
  participant MMC as MMC core

  DT->>Kernel: describe sdhci@8804000 (downstream node)
  Kernel->>Driver: bind driver for compatible qcom,sdhci-msm-v5-downstream
  Driver->>Clk: request/enable clocks
  Driver->>Reg: request/enable vdd/vdd-io regulators
  Driver->>Inter: configure interconnect / msm-bus vectors / QoS
  Driver->>MMC: register host with MMC core
  MMC-->>Driver: begin card/IO operations
  Note over Driver,Kernel: On error/removal, platform free call removed (no sdhci_pltfm_free)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • igorpecovnik

Poem

🐰
Hopping through DT branches, I peep and sing,
New SDHC roots sprout, and clocks again swing,
Regulators hum, interconnects hum too,
Cleanup steps trimmed — the startup’s anew,
Kernel carrots crunch for devices that spring.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main objective: fixing a TF card (SD card) IO performance regression by switching to the downstream MSM sdhc driver.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 05 Milestone: Second quarter release size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Mar 16, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch (1)

126-206: Consider extracting shared SDHC configuration to reduce duplication.

The sdhc_2 node is nearly identical between qcs8550-ayn-odin2.dts and qcs8550-ayn-odin2portal.dts (~80 lines). If both Odin2 variants will continue to share this configuration, consider extracting it to a common dtsi file (e.g., qcs8550-ayn-odin2-sdhc.dtsi) to improve maintainability.

This is optional and can be deferred if the configurations are expected to diverge in the future.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch`
around lines 126 - 206, Extract the duplicated sdhc_2 node (sdhci@8804000) and
its child opp-table (sdhc2_opp_table) into a new common dtsi (e.g.,
qcs8550-ayn-odin2-sdhc.dtsi), then include that dtsi from both
qcs8550-ayn-odin2.dts and qcs8550-ayn-odin2portal.dts and remove the duplicate
node blocks; ensure you preserve labels (sdhc_2, sdhci@8804000,
sdhc2_opp_table), phandles (vdd-supply, vdd-io-supply, &gcc, &apps_smmu, etc.),
pinctrl references (&sdc2_default, &sdc2_sleep, &sdc2_card_det_n) and
interconnect/MSM-bus settings so all references resolve, and if future
divergence is expected keep only truly shared properties in the new dtsi and
leave variant-specific overrides in each DTS.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch`:
- Around line 40-46: The comment above qcom,dll-hsr-list incorrectly includes an
extra "0" ("0 but it is calculated"); edit the comment in the patch's block that
mentions DLL_CONFIG_2 so it reads "...DLL_CONFIG_2 value is not passed from the
device tree, but it is calculated in the driver." (reference symbols:
qcom,dll-hsr-list and DLL_CONFIG_2) — remove the stray "0" and keep punctuation
consistent with qcs8550-ayn-odin2portal.dts.

---

Nitpick comments:
In
`@patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch`:
- Around line 126-206: Extract the duplicated sdhc_2 node (sdhci@8804000) and
its child opp-table (sdhc2_opp_table) into a new common dtsi (e.g.,
qcs8550-ayn-odin2-sdhc.dtsi), then include that dtsi from both
qcs8550-ayn-odin2.dts and qcs8550-ayn-odin2portal.dts and remove the duplicate
node blocks; ensure you preserve labels (sdhc_2, sdhci@8804000,
sdhc2_opp_table), phandles (vdd-supply, vdd-io-supply, &gcc, &apps_smmu, etc.),
pinctrl references (&sdc2_default, &sdc2_sleep, &sdc2_card_det_n) and
interconnect/MSM-bus settings so all references resolve, and if future
divergence is expected keep only truly shared properties in the new dtsi and
leave variant-specific overrides in each DTS.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 19e910b5-5627-4f3c-9b46-90a851564624

📥 Commits

Reviewing files that changed from the base of the PR and between a3f8d14 and a8b961b.

📒 Files selected for processing (4)
  • config/kernel/linux-sm8550-edge.config
  • patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
  • patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch

@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Mar 16, 2026
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot removed the Needs review Seeking for review label Mar 16, 2026
 - Fix the issue that downstream MSM sdhc driver cannot work on 6.18.14
   or newer kernel
 - Switch back to downstream MSM sdhc driver for Ayn Odin2 devices to
   fix the IO performance regression brought by upstream driver.

Before this fix, average sequential read bandwidth on a UHS-I SDR104
card is 16.8MiB/s. After this fix applied, it is 85.1MiB/s.

It fixes commit f785a6d

Signed-off-by: Alex Ling <ling_kasim@hotmail.com>
@igorpecovnik igorpecovnik force-pushed the odin2_fix_sdcard_io_perf_2 branch from a8b961b to 0a055ca Compare March 23, 2026 10:07
@github-actions github-actions bot added Needs review Seeking for review and removed Ready to merge Reviewed, tested and ready for merge labels Mar 23, 2026
@igorpecovnik igorpecovnik merged commit 33699ef into armbian:main Mar 23, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

2 participants