WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@EvilOlaf
Copy link
Member

@EvilOlaf EvilOlaf commented Dec 1, 2025

Description

  • roll-over mainline tag to 6.19-rc1
  • rockchip64: rewrite patches. minor changes
  • meson64: rewrite patches. no changes
  • uefi-arm64: rewrite patches. no changes

How Has This Been Tested?

  • build orangepi5 kernel for rockchip64
  • build odroidn2 kernel for meson64

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
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Added Realtek network adapter LED configuration support
    • Improved USB3 power management efficiency
    • Enhanced USB-C device compatibility for RK3399
  • Chores

    • Updated kernel version to 6.19

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions github-actions bot added 02 Milestone: First quarter release size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Dec 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Update kernel version target to 6.19-rc1, add device tree LED configuration support for RTL8169 Ethernet driver, introduce USB3 PHY power state tracking and disconnected device state handling for RK3399 USB3 controller.

Changes

Cohort / File(s) Summary
Kernel Configuration
config/sources/mainline-kernel.conf.sh
Bumped upstream release-candidate selection from kernel 6.18-rc7 to 6.19-rc1; conditional now checks for KERNEL_MAJOR_MINOR "6.19" and assigns KERNELBRANCH to "tag:v6.19-rc1".
Network Driver: RTL8169 LED Support
patch/kernel/archive/rockchip64-6.18/net-ethernet-realtek-add-r8169-LED-configuration-from-OF.patch
Added rtl8168_led_of_init() helper to read LED configuration from device tree (realtek,led-data property) and apply to LED_CTRL register during RTL8168H initialization; includes linux/of.h header.
USB Controller: RK3399 PHY State Tracking
patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-dwc3-Track-the-power-state-of-usb3_generic_phy.patch
Introduced usb3_phy_powered boolean field in struct dwc3 to track USB3 PHY power state; guards power-off sequence and ensures balanced on/off behavior across driver calls.
USB Controller: RK3399 Disconnected Device State
patch/kernel/archive/rockchip64-6.18/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch
Added DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED macro and usb3_phy_reset_quirk flag to struct dwc3; extended mode-transition logic (set_mode, suspend, resume) to handle disconnected state and enable controlled PHY power-cycle fallback for old device trees; replaced direct extcon notification with notifier registration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • USB controller patches (particularly rk3399-usbc-phy-rockchip-naneng): Review the new disconnected device state handling across multiple mode-transition paths and verify correct extcon notifier wiring and PHY power-cycle sequencing.
  • Power state tracking logic (rk3399-usbc-usb-dwc3): Verify that the new guard condition in dwc3_phy_power_off prevents unbalanced power-off calls and doesn't break existing runtime PM or probe/remove flows.
  • Kernel version bump: Confirm the 6.18→6.19 transition and validate that the conditional threshold and tag assignments are consistent with other version-selection logic in the file.

Possibly related PRs

Suggested labels

size/large

Suggested reviewers

  • paolosabatino
  • rpardini
  • igorpecovnik
  • HeyMeco
  • SuperKali

Poem

🐰 Whiskers twitch with glee!
Kernel bumps to 6.19 free,
LEDs glow on Realtek streams,
USB3 power dreams,
Device tree tales now complete!

Pre-merge checks and finishing touches

✅ 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 describes the main changes: updating kernel to 6.18 stable (specifically 6.19-rc1) and rewriting patches across multiple architectures.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 the Ready to merge Reviewed, tested and ready for merge label Dec 1, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

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

@github-actions github-actions bot removed the Needs review Seeking for review label Dec 1, 2025
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: 0

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/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch (1)

70-76: Fix error handling logic and remove unprofessional comment.

Two issues:

  1. Critical: Line 74 has broken error handling. The expression ret >= 0 evaluates to true for success and false for error, but this is backwards from the intended flag semantics. This means usb3_phy_powered will be set to false on success and true on error.

  2. Minor: The //XXX: bleh comment at line 74 is unprofessional and should be replaced with a meaningful explanation or removed.

Apply this diff to fix the error handling:

 		if (dwc->usb3_phy_reset_quirk) {
 			for (int j = 0; j < dwc->num_usb3_ports; j++) {
 				ret = phy_power_on(dwc->usb3_generic_phy[j]);
-				//XXX: bleh
-				dwc->usb3_phy_powered = ret >= 0;
+				if (ret < 0)
+					dev_err(dwc->dev, "failed to power on USB3 PHY: %d\n", ret);
 			}
+			dwc->usb3_phy_powered = (ret >= 0);
 		}

Alternatively, track success more robustly by checking all PHY power-on results rather than just the last one.

🧹 Nitpick comments (1)
patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-dwc3-Track-the-power-state-of-usb3_generic_phy.patch (1)

29-41: Verify unconditional clearing of usb3_phy_powered flag.

The usb3_phy_powered flag is set to false at line 38 even when the power-off loop doesn't execute (when dwc->usb3_phy_powered is initially false). While this provides defensive safety, it may mask logic errors where the flag state becomes inconsistent.

Consider whether the flag should only be cleared after actually powering off the PHYs:

 	if (dwc->usb3_phy_powered)
-		for (i = 0; i < dwc->num_usb3_ports; i++)
+		for (i = 0; i < dwc->num_usb3_ports; i++) {
 			phy_power_off(dwc->usb3_generic_phy[i]);
-	dwc->usb3_phy_powered = false;
+		}
+		dwc->usb3_phy_powered = false;
+	}

Alternatively, if unconditional clearing is intentional for defensive programming (e.g., to handle cases where the flag may be set incorrectly), document this behavior in a comment.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ede82db and 3a37810.

📒 Files selected for processing (4)
  • config/sources/mainline-kernel.conf.sh (1 hunks)
  • patch/kernel/archive/rockchip64-6.18/net-ethernet-realtek-add-r8169-LED-configuration-from-OF.patch (2 hunks)
  • patch/kernel/archive/rockchip64-6.18/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch (5 hunks)
  • patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-dwc3-Track-the-power-state-of-usb3_generic_phy.patch (1 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.
Learnt from: rpardini
Repo: armbian/build PR: 8879
File: config/sources/families/uefi-x86.conf:0-0
Timestamp: 2025-11-06T15:36:04.682Z
Learning: As of PR #8879, the uefi-x86 family in the Armbian build system now includes kernel patches for the first time. The current and edge branches for uefi-x86 are specifically configured for Apple T2-based x86 machines, including T2-specific patches from the linux-t2 project and custom kernel configuration options for Apple hardware drivers.
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-07-21T04:12:02.439Z
Learning: In the Armbian build system, for recurring maintenance tasks like kernel version bumping, TODO comments should use generic version formats (e.g., "MAJOR.MINOR-rc1") rather than specific version numbers (e.g., "6.17-rc1") to avoid the need for frequent comment updates that would create unnecessary maintenance overhead.
Learnt from: tabrisnet
Repo: armbian/build PR: 8746
File: config/sources/families/filogic.conf:61-68
Timestamp: 2025-10-13T02:26:18.249Z
Learning: In the Armbian build system, the "edge" kernel branch is intended to be bleeding-edge and experimental. It does not require hardware testing or stability verification before merging, as it's expected to contain potentially unstable or untested code for early adopters and developers.
Learnt from: The-going
Repo: armbian/build PR: 8147
File: config/sources/families/include/sunxi64_common.inc:38-39
Timestamp: 2025-04-30T16:16:47.150Z
Learning: The Armbian build system references Linux kernel versions in the form "tag:v6.14.4" in the KERNELBRANCH variable, even when point release tags might not be directly visible in the upstream repository in the same form.
Learnt from: amazingfate
Repo: armbian/build PR: 8453
File: lib/functions/compilation/patch/drivers_network.sh:213-216
Timestamp: 2025-08-02T14:59:28.145Z
Learning: The wireless driver patches wireless-rtl8812au-Fix-6.16.patch, wireless-rtl8811cu-Fix-6.16.patch, and wireless-rtl88x2bu-Fix-6.16.patch in the Armbian build system are backward compatible and can be applied unconditionally without version checks, even though they're named for 6.16+ fixes.
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.
Learnt from: tabrisnet
Repo: armbian/build PR: 8746
File: config/kernel/linux-filogic-edge.config:344-470
Timestamp: 2025-10-11T19:52:54.648Z
Learning: The chainsx/linux-filogic kernel (legacy branch) for BPI-R4 uses out-of-tree proprietary drivers (CONFIG_NET_DSA_AN8855, CONFIG_AIROHA_EN8801SC_PHY, CONFIG_AIR_AN8855_PHY, CONFIG_MDIO_AN8855, CONFIG_MFD_AIROHA_AN8855). The frank-w/BPI-Router-Linux kernel (current and edge branches) uses mainline kernel drivers instead: CONFIG_NET_DSA_MT7530 for the DSA switch and CONFIG_MEDIATEK_2P5GE_PHY for PHY support. These provide equivalent functionality for BPI-R4 networking.
📚 Learning: 2025-04-30T16:16:47.150Z
Learnt from: The-going
Repo: armbian/build PR: 8147
File: config/sources/families/include/sunxi64_common.inc:38-39
Timestamp: 2025-04-30T16:16:47.150Z
Learning: The Armbian build system references Linux kernel versions in the form "tag:v6.14.4" in the KERNELBRANCH variable, even when point release tags might not be directly visible in the upstream repository in the same form.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-07-21T04:12:02.439Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-07-21T04:12:02.439Z
Learning: In the Armbian build system, for recurring maintenance tasks like kernel version bumping, TODO comments should use generic version formats (e.g., "MAJOR.MINOR-rc1") rather than specific version numbers (e.g., "6.17-rc1") to avoid the need for frequent comment updates that would create unnecessary maintenance overhead.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-11-10T22:05:40.490Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8913
File: config/sources/families/k3-beagle.conf:16-16
Timestamp: 2025-11-10T22:05:40.490Z
Learning: In the Armbian build system, kernel branches using non-mainline/vendor forks (like BeagleBoard's linux repository) should be named "vendor" or "vendor-rt" rather than "current" or "edge". The "current" and "edge" naming is reserved for mainline kernel branches. This affects both the case statement in family config files (e.g., `vendor | vendor-rt)` instead of `current | current-rt)`) and the corresponding KERNEL_TARGET declarations in board config files.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-09-09T07:30:22.419Z
Learnt from: amazingfate
Repo: armbian/build PR: 8595
File: lib/functions/compilation/patch/drivers_network.sh:0-0
Timestamp: 2025-09-09T07:30:22.419Z
Learning: RTW_WARN_LMT sed workaround in driver_rtl8852bs() function in lib/functions/compilation/patch/drivers_network.sh is necessary for kernel 6.1 compatibility, even when the upstream wifi-rtl8852bs driver has the macro defined for newer kernels. The workaround ensures cross-kernel compatibility from 6.1 to 6.16+.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
  • patch/kernel/archive/rockchip64-6.18/net-ethernet-realtek-add-r8169-LED-configuration-from-OF.patch
📚 Learning: 2025-06-25T03:42:09.086Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-09-11T06:06:52.328Z
Learnt from: SuperKali
Repo: armbian/build PR: 8608
File: lib/functions/compilation/patch/drivers_network.sh:361-363
Timestamp: 2025-09-11T06:06:52.328Z
Learning: For the RTW88 SDIO RF path detection fix patch (004-rtw88-sdio-rf-path-detection-fix.patch), SuperKali prefers using exact version matching (eq 6.1 || eq 6.16) rather than range checks, as the patch has only been tested on those specific kernel versions and may be mainstreamed soon.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-11-02T20:49:56.719Z
Learnt from: igorpecovnik
Repo: armbian/build PR: 8849
File: config/boards/radxa-e54c.csc:14-28
Timestamp: 2025-11-02T20:49:56.719Z
Learning: In Armbian board configuration files (config/boards/*.conf, *.csc, etc.), do not use kernel_config_set, kernel_config_set_m, kernel_config_set_y, or custom_kernel_config__* functions to modify kernel configuration. Kernel configuration is associated with LINUXFAMILY/BOARDFAMILY, not individual BOARD. Board-specific kernel modifications cause inconsistency in kernel packages published to the apt repository because boards within a family share the same kernel packages. Kernel configuration changes must be made in the appropriate kernel config file (e.g., config/kernel/linux-*-*.config) or in family configuration files (config/sources/families/*.conf, *.inc) instead.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-05-05T12:35:07.143Z
Learnt from: Grippy98
Repo: armbian/build PR: 8152
File: lib/functions/configuration/interactive.sh:209-266
Timestamp: 2025-05-05T12:35:07.143Z
Learning: For the interactive kernel selection in Armbian, KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION are parsed from family.conf but deliberately not set as environment variables to avoid potential interference with other parts of the build system.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-06-24T10:08:40.313Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-10-13T02:26:18.249Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8746
File: config/sources/families/filogic.conf:61-68
Timestamp: 2025-10-13T02:26:18.249Z
Learning: In the Armbian build system, the "edge" kernel branch is intended to be bleeding-edge and experimental. It does not require hardware testing or stability verification before merging, as it's expected to contain potentially unstable or untested code for early adopters and developers.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-03-31T22:20:48.475Z
Learnt from: rpardini
Repo: armbian/build PR: 8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Applied to files:

  • config/sources/mainline-kernel.conf.sh
📚 Learning: 2025-11-20T18:20:11.985Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8968
File: patch/u-boot/u-boot-sunxi/arm64-dts-sun50i-h6-orangepi.dtsi-Rollback-r_rsb-to-r_i2c.patch:36-36
Timestamp: 2025-11-20T18:20:11.985Z
Learning: The rewrite-patches tool (REWRITE_PATCHES=yes) in the Armbian build system can inadvertently introduce semantic changes when the u-boot/kernel git base revision differs from expected state. The tool applies patches, commits them, and re-exports them using git format-patch, which can cause the re-exported patch to reflect the base revision's state rather than preserving the original patch intent. This is particularly problematic for device tree changes like interrupt specifications. The tool currently lacks validation mechanisms to detect such semantic drift, and affected patches must be manually corrected after rewriting.

Applied to files:

  • patch/kernel/archive/rockchip64-6.18/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch
🧬 Code graph analysis (1)
config/sources/mainline-kernel.conf.sh (2)
config/sources/vendors/microsoft/wsl2.hooks.sh (2)
  • post_family_config_branch_current__wsl2 (14-19)
  • post_family_config_branch_edge__wsl2 (21-26)
lib/functions/configuration/interactive.sh (1)
  • get_kernel_info_for_branch (180-208)
🔇 Additional comments (8)
patch/kernel/archive/rockchip64-6.18/net-ethernet-realtek-add-r8169-LED-configuration-from-OF.patch (2)

27-34: LGTM with minor observation.

The LED configuration function correctly reads the device tree property and writes to the LED_CTRL register only when the property is present. The implementation uses of_property_read_u32 which handles missing properties gracefully by returning non-zero.

Note: This function is only called for RTL8168H variants. If other RTL8168 variants also support LED configuration from device tree, consider calling this function in their initialization paths as well.


1-49: This concern may not apply to the Armbian build workflow.

In the Armbian build system, patch directories are not strictly version-locked to their directory names. According to documented patterns, patch directories referenced in kernel patch configurations can be applied across multiple kernel versions without issue. The placement of this patch in the rockchip64-6.18 directory does not necessarily prevent it from being applied when building for 6.19-rc1, as the build system's patch application logic is more flexible than a strict version-matching requirement. Verify the PR's kernel configuration to confirm whether 6.18 patches are intentionally included in the 6.19-rc1 build, rather than assuming a directory mismatch indicates an error.

patch/kernel/archive/rockchip64-6.18/rk3399-usbc-usb-dwc3-Track-the-power-state-of-usb3_generic_phy.patch (1)

21-28: Consider error handling in power-on path.

The flag usb3_phy_powered = true is set after the USB2 PHY power-on at line 25, which happens after all USB3 PHYs are powered on. If USB2 PHY power-on fails (line 21-22), the function goes to err_power_off_usb3_phy, but the flag remains false.

Verify that this is the intended behavior: the flag should track whether USB3 PHYs were successfully powered on, and setting it after USB2 power-on appears correct since error paths will power off USB3 PHYs without the flag being set.

patch/kernel/archive/rockchip64-6.18/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch (4)

157-157: LGTM! Clever use of masking for DISCONNECTED state.

The DWC3_GCTL_PRTCAP_DEVICE_DISCONNECTED value (6) is designed to mask down to DWC3_GCTL_PRTCAP_DEVICE (2) when masked with DWC3_GCTL_PRTCAP_OTG (3), as shown in line 24. This allows the disconnected state to be tracked in current_dr_role while writing the correct register value.

The comment at lines 152-157 clearly explains this design choice.


236-241: Verify impact of broader extcon notifier registration.

The change from extcon_register_notifier(dwc->edev, EXTCON_USB_HOST, &dwc->edev_nb) to extcon_register_notifier_all(dwc->edev, &dwc->edev_nb) means the notifier will now fire for all extcon events (including EXTCON_USB), not just EXTCON_USB_HOST.

This is necessary for the quirk logic (lines 210-212) which checks EXTCON_USB state, but ensure:

  1. The dwc3_drd_notifier callback can handle all event types efficiently
  2. There are no performance implications from additional notifications
  3. All extcon event types are handled correctly in dwc3_drd_update

Since the quirk-specific logic relies on checking multiple extcon states, verify this change is required for correct operation.


62-65: Verify PHY power-off loop matches power-on loop structure.

The USB3 PHY power-off loop (lines 62-64) executes when dwc->usb3_phy_powered && dwc->usb3_phy_reset_quirk, but the subsequent power-on loop (lines 71-76) executes when just dwc->usb3_phy_reset_quirk is set.

This asymmetry means the power-on loop will execute even if the power-off loop didn't run (when usb3_phy_powered was false). Verify this is intentional—it could result in calling phy_power_on on already-powered PHYs or PHYs that were never powered off.

Consider whether both loops should have matching conditions:

-		if (dwc->usb3_phy_powered && dwc->usb3_phy_reset_quirk)
+		if (dwc->usb3_phy_reset_quirk && dwc->usb3_phy_powered)
 			for (int j = 0; j < dwc->num_usb3_ports; j++)
 				phy_power_off(dwc->usb3_generic_phy[j]);
 
 		reg = dwc3_readl(dwc->regs, DWC3_GCTL);
 		reg |= DWC3_GCTL_CORESOFTRESET;
 		dwc3_writel(dwc->regs, DWC3_GCTL, reg);
 
-		if (dwc->usb3_phy_reset_quirk) {
+		if (dwc->usb3_phy_reset_quirk && dwc->usb3_phy_powered) {

Or document why unconditional power-on is safe in this context.


189-218: Verify extcon state logic handles mode transitions safely.

The code correctly uses extcon_get_state() with proper return value checking (ret > 0) and calls dwc3_set_mode() via the driver's helper rather than direct register access. However, confirm that:

  • The dwc3_set_mode() call properly serializes mode changes with interrupt handlers, as dwc3 race conditions between PRTCAP switches and running gadget/host event handling are known to exist in the kernel driver.
  • When usb3_phy_reset_quirk is enabled, the logic correctly handles edge cases where both EXTCON_USB_HOST and EXTCON_USB states might be sampled across multiple extcon_get_state() calls, or where the extcon state changes between the two checks.
  • Runtime-PM state is correct before calling dwc3_set_mode(), as the controller may be runtime-suspended during mode transitions on some platforms.
config/sources/mainline-kernel.conf.sh (1)

10-13: LGTM! The kernel version bump from 6.18-rc7 to 6.19-rc1 follows the expected progression, and the TODO comment appropriately uses generic version format as per project conventions.

@HeyMeco
Copy link
Collaborator

HeyMeco commented Dec 1, 2025

For edge let’s check if qcs6490 family / radxa dragon-q6a also compiles fine. Else let’s pin that family config to 6.18 stable

Copy link
Member

@rpardini rpardini left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@igorpecovnik igorpecovnik merged commit dc5dcaf into armbian:main Dec 1, 2025
13 checks passed
@EvilOlaf EvilOlaf deleted the 6.18 branch December 2, 2025 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First 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/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

5 participants