Skip to content

rockchip64: rewrite patches of current and edge#9829

Merged
igorpecovnik merged 2 commits into
armbian:mainfrom
EvilOlaf:rockchip64-maint2
May 15, 2026
Merged

rockchip64: rewrite patches of current and edge#9829
igorpecovnik merged 2 commits into
armbian:mainfrom
EvilOlaf:rockchip64-maint2

Conversation

@EvilOlaf

@EvilOlaf EvilOlaf commented May 15, 2026

Copy link
Copy Markdown
Member

as per title
rewrite for latest upstream patch version
no further tests, rewrite only

Summary by CodeRabbit

  • New Features

    • Added virtual Type-C Power Delivery extcon driver support
    • RK808 RTC device can now be disabled via device tree configuration
  • Bug Fixes

    • Fixed USB Type-C PD capability registration to prevent duplicate entries and allow recovery from failures
    • Corrected serial SYSRQ break command handling for UART controllers
    • Made DMA reset errors non-fatal to allow device initialization with reduced throughput
  • Revert

    • Reverted automatic unregistration of USB Type-C PD source capabilities

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR updates the Armbian build system with kernel patches for RK3399 Type-C and device drivers across kernel versions 6.18 and 7.0. It introduces a virtual Type-C PD extcon driver, fixes USB power delivery capability registration to prevent duplicates, and applies targeted adjustments to network driver MTU validation, RTC disabling, DMA error handling, and serial UART SysRq functionality.

Changes

Type-C USB Power Delivery: Virtual PD Extcon and TCPM Fixes

Layer / File(s) Summary
Virtual Type-C PD Extcon Driver (6.18)
patch/kernel/archive/rockchip64-6.18/general-add-miniDP-virtual-extcon.patch
New extcon platform driver (extcon-usbc-virtual-pd) added via Kconfig, Makefile wiring, and driver implementation. Reads DT properties for Type-C polarity, super-speed, and role; acquires GPIO "det", converts to IRQ, and updates EXTCON_USB/EXTCON_USB_HOST/EXTCON_DISP_DP states via delayed work with capability properties and sync.
TCPM Capability Registration Cleanup (6.18)
patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-tcpm-Fix-PD-devices-capabilities-registrat.patch, rk3399-usbc-usb-typec-tcpm-Unregister-altmodes-before-registerin.patch, rk3399-usbc-Revert-usb-typec-tcpm-unregister-existing-source-cap.patch
tcpm_register_source_caps() and tcpm_register_sink_caps() now unregister previously-registered capabilities and clear pointers before re-registering; tcpm_register_partner_altmodes() unregisters existing altmodes before new registration; tcpm_port_register_pd() clears failed PD instances and cleans up associated capabilities.
Virtual Type-C PD Extcon Driver (7.0)
patch/kernel/archive/rockchip64-7.0/general-add-miniDP-virtual-extcon.patch
Parallel implementation of virtual Type-C PD extcon driver for kernel 7.0 with equivalent GPIO-driven state management and device tree property parsing.
TCPM Capability Registration Cleanup (7.0)
patch/kernel/archive/rockchip64-7.0/rk3399-usbc-usb-typec-tcpm-Fix-PD-devices-capabilities-registrat.patch, rk3399-usbc-usb-typec-tcpm-Unregister-altmodes-before-registerin.patch, rk3399-usbc-Revert-usb-typec-tcpm-unregister-existing-source-cap.patch
Applies the same capability registration cleanup and altmode unregistration logic to kernel 7.0 TCPM implementation.

Network Device and Core Driver Adjustments

Layer / File(s) Summary
MTU Validation and RK808 RTC Disable (6.18)
patch/kernel/archive/rockchip64-6.18/general-disable-mtu-validation.patch, general-possibility-of-disabling-rk808-rtc.patch
stmmac_change_mtu() no longer performs FIFO-size and BUF_SIZE_16KiB validation; retains XDP jumbo-frame check. rk808-rtc MFD cell now declares of_compatible to respect device-tree status = "disabled". Log level for missing of_node downgraded from warning to debug.
DMA Reset Failure Workaround (6.18)
patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch
stmmac_init_dma_engine() treats DMA reset failures as non-fatal by logging a warning and clearing the error to allow device initialization despite potential reduced throughput.
MTU Validation and RK808 RTC Disable (7.0)
patch/kernel/archive/rockchip64-7.0/general-disable-mtu-validation.patch, general-possibility-of-disabling-rk808-rtc.patch
Applies the same MTU validation removal and RK808 RTC device-tree disable support to kernel 7.0.
Serial UART SysRq Regression Fix (7.0)
patch/kernel/archive/rockchip64-7.0/general-serial-8250-fix-sysrq-break-dw-apb.patch
dw8250_handle_irq() and serial8250_handle_irq() replaced scoped guard(uart_port_lock_irqsave) with explicit uart_port_lock_irqsave()/uart_unlock_and_check_sysrq_irqrestore() calls to restore SysRq-via-BREAK handling on early-exit and normal unlock paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • joekhoobyar
  • brentr
  • prahal
  • rpardini
  • krachlatte
  • lanefu
  • iav
  • igorpecovnik
  • paolosabatino
  • TheSnowfield
  • SuperKali
  • HeyMeco

Poem

🐰 A rabbit's tale of patches fine,
Type-C PD and drivers align,
From 6.18 to 7.0 we go,
SysRq fixed and extcons aglow!

🚥 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 'rockchip64: rewrite patches of current and edge' accurately reflects the core change: rewriting kernel patches across multiple Armbian kernel targets (6.18 and 7.0 series), matching the commit messages and file changes.
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 size/medium PR with more then 50 and less then 250 lines 05 Milestone: Second quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels May 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch (1)

24-27: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Don’t suppress DMA reset failures globally.

Forcing success after stmmac_reset() failure can continue init with undefined DMA state. Please gate this workaround behind a Rockchip-specific quirk/compatible check and keep fail-fast behavior for other platforms.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch`
around lines 24 - 27, The change currently converts a DMA reset error into a
warning unconditionally; instead, only suppress the failure for Rockchip
platforms: after the stmmac_reset() call and before converting the error to
success, check the device's platform/compatible (e.g., using priv->dev->of_node
with of_device_is_compatible(...) or the driver’s Rockchip-specific quirk/match
helper). If the device is Rockchip-compatible, log the warning with
netdev_warn(priv->dev, ...) and set ret = 0; otherwise keep the original
fail-fast behavior by leaving netdev_err(priv->dev, ...) and returning ret from
the function. Ensure the check references stmmac_reset(), priv->dev, and the
netdev_warn/netdev_err paths so only Rockchip devices get the workaround.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch`:
- Around line 24-27: The change currently converts a DMA reset error into a
warning unconditionally; instead, only suppress the failure for Rockchip
platforms: after the stmmac_reset() call and before converting the error to
success, check the device's platform/compatible (e.g., using priv->dev->of_node
with of_device_is_compatible(...) or the driver’s Rockchip-specific quirk/match
helper). If the device is Rockchip-compatible, log the warning with
netdev_warn(priv->dev, ...) and set ret = 0; otherwise keep the original
fail-fast behavior by leaving netdev_err(priv->dev, ...) and returning ret from
the function. Ensure the check references stmmac_reset(), priv->dev, and the
netdev_warn/netdev_err paths so only Rockchip devices get the workaround.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df3c3dc0-9f55-449a-b00f-ccb2d2418511

📥 Commits

Reviewing files that changed from the base of the PR and between f893547 and d44c7ea.

📒 Files selected for processing (14)
  • patch/kernel/archive/rockchip64-6.18/general-add-miniDP-virtual-extcon.patch
  • patch/kernel/archive/rockchip64-6.18/general-disable-mtu-validation.patch
  • patch/kernel/archive/rockchip64-6.18/general-possibility-of-disabling-rk808-rtc.patch
  • patch/kernel/archive/rockchip64-6.18/rk3399-usbc-Revert-usb-typec-tcpm-unregister-existing-source-cap.patch
  • patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-tcpm-Fix-PD-devices-capabilities-registrat.patch
  • patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-typec-tcpm-Unregister-altmodes-before-registerin.patch
  • patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch
  • patch/kernel/archive/rockchip64-7.0/general-add-miniDP-virtual-extcon.patch
  • patch/kernel/archive/rockchip64-7.0/general-disable-mtu-validation.patch
  • patch/kernel/archive/rockchip64-7.0/general-possibility-of-disabling-rk808-rtc.patch
  • patch/kernel/archive/rockchip64-7.0/general-serial-8250-fix-sysrq-break-dw-apb.patch
  • patch/kernel/archive/rockchip64-7.0/rk3399-usbc-Revert-usb-typec-tcpm-unregister-existing-source-cap.patch
  • patch/kernel/archive/rockchip64-7.0/rk3399-usbc-usb-typec-tcpm-Fix-PD-devices-capabilities-registrat.patch
  • patch/kernel/archive/rockchip64-7.0/rk3399-usbc-usb-typec-tcpm-Unregister-altmodes-before-registerin.patch

@igorpecovnik igorpecovnik merged commit 5e60c01 into armbian:main May 15, 2026
12 of 13 checks passed
@EvilOlaf EvilOlaf deleted the rockchip64-maint2 branch May 24, 2026 09:18
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/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

2 participants