Skip to content

sunxi: remove BSP GMAC/EPHY patch that breaks H6 internal EMAC#9609

Merged
igorpecovnik merged 1 commit into
mainfrom
sunxi-fix-h6-emac-ac200
Mar 28, 2026
Merged

sunxi: remove BSP GMAC/EPHY patch that breaks H6 internal EMAC#9609
igorpecovnik merged 1 commit into
mainfrom
sunxi-fix-h6-emac-ac200

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented Mar 28, 2026

Summary

  • Removes the BSP sunxi-gmac / sunxi-ephy / sunxi-ac200 patch (by chraac) from sunxi-6.12, 6.18 and 7.0, which was introduced in 01176b0 and breaks H6 internal EMAC
  • Drops CONFIG_SUNXI_GMAC=m from linux-sunxi64-legacy.config (driver no longer in tree)
  • Aligns CONFIG_SUN4I_EMAC to =m in legacy config (matches current/edge)

Problem

The BSP patch introduces conflicting out-of-tree drivers that clash with the correct mainline AC200 stack already present:

BSP driver added Conflicts with
sunxi-ac200.c mainline ac200.c (0201)
sunxi-ephy.c mainline ac200-phy.c (0202)
sunxi-gmac.c mainline dwmac-sun8i

Additionally the patch removes the of_gpio_flags enum from gpiolib-of.c (breaking other drivers) and depends on PWM_SUNXI_ENHANCE which does not exist in mainline.

Correct stack (already in place)

H6 internal EMAC is correctly handled by:

  • ac200.c + ac200-ephy-ctl.c (from Jernej's ac200-v3 branch) + ac200-phy.c + DTS patches

H618 EMAC is covered by dwmac-sun8i + drv-net-stmmac-dwmac-sun8i-add-second-emac-clock patch.

Test plan

  • Build sunxi64 current/edge/legacy and verify H6 EMAC (Tanix TX6, OrangePi 3, Pine H64) works
  • Verify H618 EMAC (OrangePi Zero2W) still works via dwmac-sun8i

Summary by CodeRabbit

  • Chores
    • Updated kernel configuration and patch series for sunxi architecture across multiple kernel versions (6.12, 6.18, 7.0)
    • Adjusted network driver module settings and removed related patches from the build configuration

The chraac BSP patch (driver-allwinner-h618-emac / 0203) introduced
conflicting out-of-tree drivers (sunxi-gmac, sunxi-ephy, sunxi-ac200)
that clash with the correct mainline AC200 stack already in place:
- sunxi-ac200.c conflicts with the mainline ac200.c (0201)
- sunxi-ephy.c conflicts with the mainline ac200-phy.c (0202)
- sunxi-gmac.c is an unnecessary BSP replacement for dwmac-sun8i
- removes of_gpio_flags enum from gpiolib-of.c, breaking other drivers
- depends on PWM_SUNXI_ENHANCE which doesn't exist in mainline

H6 internal EMAC is correctly handled by the mainline stack:
ac200.c + ac200-ephy-ctl.c (ac200-v3) + ac200-phy.c + DTS patches.
H618 EMAC is covered by dwmac-sun8i + drv-net-stmmac-dwmac-sun8i-
add-second-emac-clock patch.

Remove the patch from sunxi-6.12, 6.18 and 7.0, and drop the leftover
CONFIG_SUNXI_GMAC=m from the legacy kernel config. Also align
CONFIG_SUN4I_EMAC to =m (matching current/edge) in legacy config.

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 28, 2026

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: 23b5cce9-1abc-4b7f-9699-df4d32a9e7d8

📥 Commits

Reviewing files that changed from the base of the PR and between 64c2128 and e9c65a6.

📒 Files selected for processing (7)
  • config/kernel/linux-sunxi64-legacy.config
  • patch/kernel/archive/sunxi-6.12/patches.armbian/driver-allwinner-h618-emac.patch
  • patch/kernel/archive/sunxi-6.12/series.conf
  • patch/kernel/archive/sunxi-6.18/patches.armbian/0203-drv-net-stmmac-sun8i-add-h618-emac.patch
  • patch/kernel/archive/sunxi-6.18/series.conf
  • patch/kernel/archive/sunxi-7.0/patches.armbian/0203-drv-net-stmmac-sun8i-add-h618-emac.patch
  • patch/kernel/archive/sunxi-7.0/series.conf
💤 Files with no reviewable changes (3)
  • patch/kernel/archive/sunxi-6.18/series.conf
  • patch/kernel/archive/sunxi-6.12/series.conf
  • patch/kernel/archive/sunxi-7.0/series.conf

📝 Walkthrough

Walkthrough

Kernel configuration and patch series for Sunxi are modified: the SUN4I_EMAC driver switches from built-in to loadable module, the SUNXI_GMAC configuration is removed, and three EMAC-related patches are removed from patch series configurations for kernel versions 6.12, 6.18, and 7.0.

Changes

Cohort / File(s) Summary
Sunxi64 Legacy Kernel Config
config/kernel/linux-sunxi64-legacy.config
Changed SUN4I_EMAC from built-in module (=y) to loadable module (=m); removed explicit SUNXI_GMAC configuration entry.
Sunxi Kernel Patch Series
patch/kernel/archive/sunxi-6.12/series.conf, patch/kernel/archive/sunxi-6.18/series.conf, patch/kernel/archive/sunxi-7.0/series.conf
Removed EMAC-related patch entries: H618 EMAC driver patch removed from 6.12, 6.18, and 7.0 patch series configurations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A carrot-munching fix so light,
We modularize with all our might,
Those EMAC patches hop away,
Config changes save the day! 🥕✨

🚥 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 accurately summarizes the main objective of the PR: removing a BSP patch that breaks H6 internal EMAC by conflicting with mainline drivers.
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
  • Commit unit tests in branch sunxi-fix-h6-emac-ac200

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 Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... 05 Milestone: Second quarter release size/large PR with 250 lines or more labels Mar 28, 2026
@igorpecovnik igorpecovnik merged commit b993528 into main Mar 28, 2026
1 check passed
@igorpecovnik igorpecovnik deleted the sunxi-fix-h6-emac-ac200 branch March 28, 2026 21:01
@EvilOlaf
Copy link
Copy Markdown
Member

The H618 test wasn't done and exactly this breakage seem to have happened. Needs another round of testing on other devices if this correction works for everything: #9815

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