Skip to content

Conversation

@EvilOlaf
Copy link
Member

@EvilOlaf EvilOlaf commented Dec 16, 2025

Description

copy patches
rewrite patches
???
profit!

How Has This Been Tested?

  • build

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 kernel audio device support for Apple devices
    • Introduced GPU switching capability for Apple laptops
    • Added trackpad and input device support for Apple T2 Macs
    • Implemented battery charge limit control and enhanced fan management
  • Bug Fixes

    • Fixed camera freezing issue on Apple devices
    • Corrected display initialization for high-resolution panels
    • Fixed trackpad compatibility regression
  • Improvements

    • Updated kernel versions across multiple branches (6.12→6.18, 6.6→6.12, 6.18→6.19)
    • Enhanced Apple device support with dynamic hardware detection
    • Added USB support for ARM64 devices

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

📝 Walkthrough

Walkthrough

This PR updates kernel versions across UEFI architecture branches and introduces a comprehensive series of kernel patches for Linux 6.19, comprising Apple device support enhancements (SMC driver architectural migration, HID trackpad handling, GPU quirks), ARM64 USB configuration, and GPU framebuffer fixes.

Changes

Cohort / File(s) Summary
Kernel Version Configuration
config/sources/families/include/uefi_common.inc, config/sources/families/uefi-loong64.conf
Updated KERNEL_MAJOR_MINOR across multiple branches (cloud: 6.12→6.18, legacy: 6.6→6.12, current: 6.12→6.18, edge: 6.18→6.19); added loong64 edge-branch override to kernel 6.18 and patch directory.
Apple BCE Driver (Staging)
patch/kernel/archive/uefi-x86-6.19/1002-*.patch
Added new driver framework files for Apple BCE in drivers/staging/apple-bce (Kconfig, Makefile) with corresponding build system integration in drivers/staging.
Apple BCE VHCI Transfer Fix
patch/kernel/archive/uefi-x86-6.19/1003-*.patch
Introduced CANCELLED state to bce_vhci_urb_state enum and refactored cancellation logic in transfer.c to preserve URB state snapshot and prevent double-cancellation.
Intel i915 Display Quirks
patch/kernel/archive/uefi-x86-6.19/2008-*.patch
Added DDI A 4-lane force quirk for MacBookPro15,1 via new quirk handler and enum extension in intel_quirks; wired quirk check into intel_ddi.c.
Apple GMUX Probe Deferral & iGPU Switching
patch/kernel/archive/uefi-x86-6.19/2009-*.patch
Introduced probe deferral mechanism in amdgpu_drv.c; simplified deferral condition in vga_switcheroo.c; exported vga_set_default_device symbol; added force_igd module parameter to apple-gmux.c for runtime iGPU selection.
AppleSMC Core Refactoring (Parts 1-2)
patch/kernel/archive/uefi-x86-6.19/3001-*.patch, patch/kernel/archive/uefi-x86-6.19/3002-*.patch
Migrated applesmc driver from global static state to per-device structure (applesmc_device); made I/O port base address dynamic and configurable via smc→port_base field.
AppleSMC ACPI Migration (Parts 3-4)
patch/kernel/archive/uefi-x86-6.19/3003-*.patch, patch/kernel/archive/uefi-x86-6.19/3004-*.patch
Transitioned driver from platform_device to acpi_device; added ACPI resource discovery via CRS walk; introduced port_-prefixed wrapper functions for specialized hardware handling paths.
AppleSMC MMIO & Fan Support (Parts 5-6)
patch/kernel/archive/uefi-x86-6.19/3005-*.patch, patch/kernel/archive/uefi-x86-6.19/3006-*.patch
Implemented MMIO-based communication path as fallback from legacy port I/O; added float-type fan value support and per-fan manual control keys for T2 Macs.
AppleSMC Whitelist, Lifecycle & Battery (Parts 7-9)
patch/kernel/archive/uefi-x86-6.19/3007-*.patch, patch/kernel/archive/uefi-x86-6.19/3008-*.patch, patch/kernel/archive/uefi-x86-6.19/3009-*.patch
Added iMacPro to DMI whitelist; changed remove function signature to void for Linux 6.2 compatibility; added BCLM sysfs interface for battery charge limit control.
HID Apple T2 Trackpad Handling
patch/kernel/archive/uefi-x86-6.19/4003-*.patch, patch/kernel/archive/uefi-x86-6.19/4004-*.patch
Introduced APPLE_IGNORE_MOUSE quirk to skip T2 trackpads in hid-apple; extended hid-magicmouse with T2-specific touchpad handling paths, device configurations, and raw event processing for multiple WellSpring T2 variants.
HID Magic Mouse Regression Fix
patch/kernel/archive/uefi-x86-6.19/4005-*.patch
Consolidated HID_ANY_ID handling with default path to ensure report registration for Magic Trackpad 1, fixing regression from prior refactoring.
Intel i915 FBDev Safety Check
patch/kernel/archive/uefi-x86-6.19/7001-*.patch
Enhanced BIOS framebuffer validation to discard any non-matching dimensions (not just oversized), preventing display corruption on high-resolution panels.
ARM64 HiKey960 USB Configuration
patch/kernel/archive/uefi-arm64-6.19/board-hikey960-usb.patch
Added USB hub regulator node and hub/port configuration in device tree; updated endpoint remote-endpoint mappings to new hikey_usb_ep nodes.

Sequence Diagram(s)

sequenceDiagram
    participant amdgpu as AMD GPU Driver
    participant gmux as Apple GMUX
    participant vga as VGA Switcheroo
    participant vgaarb as VGA ARB
    
    rect rgb(230, 245, 255)
    Note over amdgpu,vgaarb: Probe with Force iGPU Path
    amdgpu->>vga: vga_switcheroo_client_probe_defer(pdev)
    alt GMUX Present & Handler Not Set
        vga->>gmux: Check apple_gmux presence
        vga-->>amdgpu: return -EPROBE_DEFER
        Note over amdgpu: Defer probe, retry later
    else GMUX Ready
        vga-->>amdgpu: continue probe
    end
    end
    
    rect rgb(240, 255, 240)
    Note over gmux: Force iGPU Mode (if enabled)
    gmux->>gmux: force_igd module param check
    alt force_igd enabled
        gmux->>gmux: Locate iGPU at 00:02.0
        gmux->>gmux: gmux_switchto(IGD)
        gmux->>vgaarb: vga_set_default_device(iGPU)
        Note over vgaarb: Set default VGA device
    else force_igd disabled
        Note over gmux: Normal operation
    end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • igorpecovnik

🐰 Hops through kernel patches with glee,
From six-point-six up to six-nineteen!
SMC refactored, ACPI's the way,
T2 trackpads dancing, hooray, hooray!
Apple hardware blooms on UEFI's bright tree! 🌳✨

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 summarizes the main change: kernel version bumps across multiple branches (edge to 6.19, legacy 6.6→6.12, current/cloud 6.12→6.18), with an explicit exception for loong64.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 36dfe31 and 3b7bcf8.

📒 Files selected for processing (2)
  • config/sources/families/include/uefi_common.inc
  • config/sources/families/uefi-loong64.conf
🧰 Additional context used
🧠 Learnings (17)
📓 Common learnings
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-12-19T13:56:45.124Z
Learning: When reviewing kernel or u-boot version bump PRs in the Armbian build system, check if patches existed in previous kernel version directories (e.g., sunxi-6.12, sunxi-6.13) before describing them as new features. If a patch and the majority of its contents existed previously with no major functionality changes, focus the review on the actual changes: the version bump itself and patch compatibility adjustments. Don't describe existing patches being ported/maintained across versions as new features or drivers—this is misleading. The patches are existing code being re-aligned to work with the new upstream version.
Learnt from: EvilOlaf
Repo: armbian/build PR: 9086
File: patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled:625-633
Timestamp: 2025-12-21T10:28:48.455Z
Learning: The patch "net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch" in patch/kernel/archive/uefi-arm64-6.19/ is known to break compilation on kernel 6.19 and is therefore disabled (has .disabled extension).
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-12-17T05:09:02.306Z
Learning: In the Armbian build system, kernel patches (e.g., in patch/kernel/archive/sunxi-6.18/patches.armbian/) contain device tree overlays and other code that have existed for years and are maintained/ported across kernel versions. When reviewing PRs that modify these patch files, focus on the actual changes being made (e.g., Makefile fixes, new additions) rather than reviewing the entire existing content within the patch as if it were new code. The patch file contents are existing, stable code unless explicitly modified in the PR diff.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
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: 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/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: 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.
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.
Learnt from: EvilOlaf
Repo: armbian/build PR: 9096
File: patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-add-overlays.patch:4-5
Timestamp: 2025-12-17T15:46:22.709Z
Learning: In Armbian kernel patches, when patches are renamed or reorganized, the old Subject line may be intentionally preserved in the patch header (as a second Subject line) for archival/historical purposes to document the previous patch name. This is an Armbian-specific practice for tracking patch evolution and should not be flagged as an error when the maintainer has intentionally included it for documentation.
📚 Learning: 2025-11-06T15:36:04.682Z
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.

Applied to files:

  • config/sources/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-12-12T23:09:56.813Z
Learnt from: tabrisnet
Repo: armbian/build PR: 9058
File: config/sources/families/spacemit.conf:39-45
Timestamp: 2025-12-12T23:09:56.813Z
Learning: In Armbian build configs for vendor kernel sources, prefer the following branch naming conventions: use 'vendor' or 'vendor-rt' for stable vendor releases, and 'vendor-edge' for bleeding-edge/pre-release vendor versions. The 'edge' naming without the 'vendor-' prefix is reserved for mainline kernel branches. Apply this pattern to family config files under config/sources/families (e.g., spacemit.conf) to ensure consistent vendor kernel sourcing naming across the repository.

Applied to files:

  • config/sources/families/uefi-loong64.conf
📚 Learning: 2025-12-17T05:09:02.306Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-12-17T05:09:02.306Z
Learning: In the Armbian build system, kernel patches (e.g., in patch/kernel/archive/sunxi-6.18/patches.armbian/) contain device tree overlays and other code that have existed for years and are maintained/ported across kernel versions. When reviewing PRs that modify these patch files, focus on the actual changes being made (e.g., Makefile fixes, new additions) rather than reviewing the entire existing content within the patch as if it were new code. The patch file contents are existing, stable code unless explicitly modified in the PR diff.

Applied to files:

  • config/sources/families/uefi-loong64.conf
📚 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/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 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/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-10-26T10:41:35.118Z
Learnt from: HackingGate
Repo: armbian/build PR: 8665
File: config/boards/photonicat2.csc:4-4
Timestamp: 2025-10-26T10:41:35.118Z
Learning: In the Armbian build system, rk3576 boards consistently use BOARDFAMILY="rk35xx" for both vendor and edge kernel targets. The rk35xx family configuration sources rockchip64_common.inc, which provides edge and current kernel branch definitions, making these branches available even though they're not defined directly in rk35xx.conf.

Applied to files:

  • config/sources/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-12-19T13:56:45.124Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-12-19T13:56:45.124Z
Learning: When reviewing kernel or u-boot version bump PRs in the Armbian build system, check if patches existed in previous kernel version directories (e.g., sunxi-6.12, sunxi-6.13) before describing them as new features. If a patch and the majority of its contents existed previously with no major functionality changes, focus the review on the actual changes: the version bump itself and patch compatibility adjustments. Don't describe existing patches being ported/maintained across versions as new features or drivers—this is misleading. The patches are existing code being re-aligned to work with the new upstream version.

Applied to files:

  • config/sources/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-06-25T03:40:52.109Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Applied to files:

  • config/sources/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-10-14T05:08:11.785Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8754
File: config/boards/bestv-r3300-l.csc:14-16
Timestamp: 2025-10-14T05:08:11.785Z
Learning: In the Armbian build system, BOOTBRANCH_BOARD is a valid framework variable used as a fallback when BOOTBRANCH is unset. The framework checks BOOTBRANCH_BOARD before applying the default bootloader branch value (see config/sources/common.conf). Board configuration files can use BOOTBRANCH_BOARD to specify the bootloader branch.

Applied to files:

  • config/sources/families/uefi-loong64.conf
📚 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/families/uefi-loong64.conf
📚 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/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 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/families/uefi-loong64.conf
  • config/sources/families/include/uefi_common.inc
📚 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/families/include/uefi_common.inc
📚 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/families/include/uefi_common.inc
📚 Learning: 2025-09-10T01:24:50.833Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-09-10T01:24:50.833Z
Learning: In Armbian's kernel configuration, both kernel_config_set_string CONFIG_LOCALVERSION '""' and kernel_config_set_string CONFIG_LOCALVERSION "" produce identical results in the final .config file (CONFIG_LOCALVERSION=""). The scripts/config tool handles quoting appropriately regardless of input format.

Applied to files:

  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-08-21T08:10:59.502Z
Learnt from: leggewie
Repo: armbian/build PR: 8524
File: config/boards/orangepi2.csc:6-6
Timestamp: 2025-08-21T08:10:59.502Z
Learning: Not all Armbian boards support all kernel versions (legacy, current, edge). Some boards may only support specific kernel versions due to hardware limitations or lack of mainline support, which is why their KERNEL_TARGET contains only the supported options (e.g., just "legacy").

Applied to files:

  • config/sources/families/include/uefi_common.inc
🔇 Additional comments (2)
config/sources/families/uefi-loong64.conf (1)

17-24: LGTM! Temporary override for loong64 edge branch is appropriate.

The override keeping loong64 edge at kernel 6.18 while amazingfate reworks 6.19 support is correctly implemented. Both KERNEL_MAJOR_MINOR and KERNELPATCHDIR are properly overridden to maintain consistency. The TODO comment clearly documents the temporary nature of this change.

config/sources/families/include/uefi_common.inc (1)

25-25: The kernel version bumps are correctly structured. No action required on patch directories; they can be non-existent without affecting build functionality.


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 02 Milestone: First 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 Dec 16, 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: 9

🧹 Nitpick comments (6)
patch/kernel/archive/uefi-x86-6.19/4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch (1)

239-264: Consider simplifying return pattern.

Both magicmouse_setup_input_mtp and magicmouse_setup_input_spi have redundant return logic. The pattern if (ret) return ret; return 0; can be simplified to return ret;.

 static int magicmouse_setup_input_mtp(struct input_dev *input,
 				      struct hid_device *hdev)
 {
 	int ret = magicmouse_setup_input_int_tpd(input, hdev, J314_TP_MIN_X,
 						 J314_TP_MIN_Y, J314_TP_MAX_X,
 						 J314_TP_MAX_Y, J314_TP_RES_X,
 						 J314_TP_RES_Y, true);
-	if (ret)
-		return ret;
-
-	return 0;
+	return ret;
 }

 static int magicmouse_setup_input_spi(struct input_dev *input,
 				      struct hid_device *hdev)
 {
 	int ret = magicmouse_setup_input_int_tpd(input, hdev, J314_TP_MIN_X,
 						 J314_TP_MIN_Y, J314_TP_MAX_X,
 						 J314_TP_MAX_Y, J314_TP_RES_X,
 						 J314_TP_RES_Y, true);
-	if (ret)
-		return ret;
-
-	return 0;
+	return ret;
 }
patch/kernel/archive/uefi-x86-6.19/3008-applesmc-make-applesmc_remove-void.patch (1)

19-30: Optional: Remove redundant bare return statement.

The change to void return type is correct for kernel 6.2+ ACPI driver compatibility. However, the bare return; at the end of a void function is redundant and can be removed entirely.

-	return;
 }
patch/kernel/archive/uefi-x86-6.19/3005-applesmc-basic-mmio-interface-implementation.patch (2)

97-106: Potential strict-aliasing violation with pointer cast.

Casting const char *key directly to u32 * and dereferencing may violate strict aliasing rules, leading to undefined behavior on some compilers with aggressive optimizations. Consider using memcpy or get_unaligned_le32/get_unaligned_be32 for safe type punning.

-	u32 key_int = *((u32 *) key);
+	u32 key_int;
+	memcpy(&key_int, key, sizeof(key_int));

The same pattern appears in iomem_get_smc_key_type (line 144) and iomem_write_smc (line 174).


133-136: Unconditional print_hex_dump_bytes may cause log spam.

print_hex_dump_bytes always prints to the kernel log regardless of debug level. This could cause significant log noise on every SMC read/write. Consider making these conditional on the dynamic debug flag or removing them for production.

This also applies to lines 189 and 194 in iomem_write_smc.

patch/kernel/archive/uefi-x86-6.19/3006-applesmc-fan-support-on-T2-Macs.patch (1)

51-61: Potential undefined behavior with negative shift amount.

If exp exceeds 23 (which represents values ≥ 2^24 ≈ 16.7M), the expression (23 - exp) becomes negative, causing undefined behavior in the right shift. While fan speeds are unlikely to reach such values, adding a bounds check would be defensive.

 static inline u32 applesmc_float_to_u32(u32 d)
 {
 	u8 sign = (u8) ((d >> 31) & 1);
 	s32 exp = (s32) ((d >> 23) & 0xff) - 0x7f;
 	u32 fr = d & ((1u << 23) - 1);

-	if (sign || exp < 0)
+	if (sign || exp < 0 || exp > 23)
 		return 0;

 	return (u32) ((1u << exp) + (fr >> (23 - exp)));
 }
patch/kernel/archive/uefi-x86-6.19/3001-applesmc-convert-static-structures-to-drvdata.patch (1)

830-849: Static data_length persists across devices.

The data_length variable at line 833 remains static, meaning it's shared across all instances. If multiple AppleSMC devices with different light sensor data lengths exist, the first device's length would be used for all. This is pre-existing behavior but worth noting in a multi-device refactor.

Consider moving data_length into struct applesmc_device if multi-device support is intended:

 struct applesmc_device {
 	...
+	int light_sensor_data_length;
 };
📜 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 f2dd38e and e711d63.

📒 Files selected for processing (18)
  • config/sources/families/include/uefi_common.inc (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/1003-Fix-freezing-on-turning-off-camera.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/2008-i915-4-lane-quirk-for-mbp15-1.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/2009-apple-gmux-allow-switching-to-igpu-at-probe.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3001-applesmc-convert-static-structures-to-drvdata.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3002-applesmc-make-io-port-base-addr-dynamic.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3003-applesmc-switch-to-acpi_device-from-platform.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3004-applesmc-key-interface-wrappers.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3005-applesmc-basic-mmio-interface-implementation.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3006-applesmc-fan-support-on-T2-Macs.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3008-applesmc-make-applesmc_remove-void.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/3009-applesmc-battery-charge-limiter.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/4005-HID-magicmouse-fix-regression-breaking-support-for-M.patch (1 hunks)
  • patch/kernel/archive/uefi-x86-6.19/7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
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: 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: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
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: 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/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: 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: leggewie
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-29T18:44:47.732Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.
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.
📚 Learning: 2025-11-06T15:36:04.682Z
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.

Applied to files:

  • config/sources/families/include/uefi_common.inc
  • patch/kernel/archive/uefi-x86-6.19/4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch
  • patch/kernel/archive/uefi-x86-6.19/3006-applesmc-fan-support-on-T2-Macs.patch
  • patch/kernel/archive/uefi-x86-6.19/2008-i915-4-lane-quirk-for-mbp15-1.patch
  • patch/kernel/archive/uefi-x86-6.19/3005-applesmc-basic-mmio-interface-implementation.patch
  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch
  • patch/kernel/archive/uefi-x86-6.19/3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch
  • patch/kernel/archive/uefi-x86-6.19/3003-applesmc-switch-to-acpi_device-from-platform.patch
  • patch/kernel/archive/uefi-x86-6.19/4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch
  • patch/kernel/archive/uefi-x86-6.19/3002-applesmc-make-io-port-base-addr-dynamic.patch
📚 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/families/include/uefi_common.inc
📚 Learning: 2025-12-12T23:10:00.819Z
Learnt from: tabrisnet
Repo: armbian/build PR: 9058
File: config/sources/families/spacemit.conf:39-45
Timestamp: 2025-12-12T23:10:00.819Z
Learning: In the Armbian build system, vendor kernel forks can use "vendor-edge" branch naming for bleeding-edge or pre-release vendor kernels, as demonstrated in config/sources/families/k3.conf. The typical vendor branch naming pattern is: "vendor" or "vendor-rt" for stable vendor releases, and "vendor-edge" for bleeding-edge/pre-release vendor versions. The "edge" naming without "vendor-" prefix is reserved for mainline kernel branches.

Applied to files:

  • config/sources/families/include/uefi_common.inc
📚 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/families/include/uefi_common.inc
📚 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/families/include/uefi_common.inc
📚 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/families/include/uefi_common.inc
📚 Learning: 2025-06-25T03:40:52.109Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Applied to files:

  • config/sources/families/include/uefi_common.inc
📚 Learning: 2025-10-26T10:41:35.118Z
Learnt from: HackingGate
Repo: armbian/build PR: 8665
File: config/boards/photonicat2.csc:4-4
Timestamp: 2025-10-26T10:41:35.118Z
Learning: In the Armbian build system, rk3576 boards consistently use BOARDFAMILY="rk35xx" for both vendor and edge kernel targets. The rk35xx family configuration sources rockchip64_common.inc, which provides edge and current kernel branch definitions, making these branches available even though they're not defined directly in rk35xx.conf.

Applied to files:

  • config/sources/families/include/uefi_common.inc
📚 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/families/include/uefi_common.inc
📚 Learning: 2025-07-27T15:54:35.119Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:2168-2173
Timestamp: 2025-07-27T15:54:35.119Z
Learning: In the Armbian build system, staging 802.11 drivers like CONFIG_RTLLIB, CONFIG_RTL8192E, CONFIG_R8712U are kept enabled alongside upstream rtw88 drivers because rtw88 is still under development and suffers from reliability issues. The staging drivers serve as necessary fallbacks when upstream drivers are unstable, prioritizing working hardware over avoiding technical conflicts.

Applied to files:

  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch
🔇 Additional comments (34)
patch/kernel/archive/uefi-x86-6.19/2008-i915-4-lane-quirk-for-mbp15-1.patch (1)

1-76: Well-structured i915 quirk patch following kernel conventions.

This patch correctly implements the DDI A 4-lane forcing quirk for MacBookPro15,1:

  • The quirk handler function (quirk_ddi_a_force_4_lanes) follows the established pattern of other quirk handlers in the same file
  • The quirk check in intel_ddi_a_force_4_lanes() is correctly placed after the existing ddi_a_4_lanes check
  • The documentation comment clearly explains the dual-GPU Mac boot scenario
  • The PCI IDs (0x3e9b for Coffee Lake GT2, 0x106b for Apple, 0x0176 for MBP15,1 subsystem) are correctly formatted

This is consistent with the T2-specific patches from the linux-t2 project for the uefi-x86 edge kernel. Based on learnings, uefi-x86 edge branches are specifically configured for Apple T2-based x86 machines.

patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch (2)

68-73: LGTM!

The Makefile conversion from obj-m (out-of-tree) to obj-$(CONFIG_APPLE_BCE) (in-tree conditional) is correct for staging driver integration. The module object list is preserved properly.


32-39: Good placement strategy for Armbian compatibility.

Placing the obj-$(CONFIG_APPLE_BCE) entry near the top of the staging Makefile as documented in the patch header helps avoid merge conflicts with Armbian's WiFi driver patches. Based on learnings, this is a T2-specific driver for Apple hardware support.

config/sources/families/include/uefi_common.inc (1)

45-45: LGTM. Kernel version bump to 6.19 for edge branch is correct and follows the existing pattern. Linux 6.19-rc1 is available, and the patches directory at patch/kernel/archive/uefi-x86-6.19 exists with the required patches for Apple T2 hardware support.

patch/kernel/archive/uefi-x86-6.19/2009-apple-gmux-allow-switching-to-igpu-at-probe.patch (3)

20-34: LGTM: Probe deferral logic is correct.

The addition of the probe deferral check follows standard kernel patterns and properly coordinates with vga_switcheroo for GMUX-based GPU switching.


52-61: LGTM: Symbol export is appropriate.

Exporting vga_set_default_device with GPL licensing allows the apple-gmux module to programmatically set the default VGA device, which is necessary for the IGD switching functionality.


34-51: The behavioral change is intentional and documented. The commit message explicitly states this is a distribution-specific patch not meant for upstream, designed to allow both GPUs to probe at startup. The removed pdev != vga_default_device() check is by design—the patch includes complementary logic in apple-gmux.c with a force_igd module parameter to control GPU switching at probe time. The gmux driver then manages which GPU becomes the default device. This approach allows users to use the iGPU without requiring EFI variable configuration.

patch/kernel/archive/uefi-x86-6.19/1003-Fix-freezing-on-turning-off-camera.patch (5)

21-21: Good approach to preserve the original state.

Introducing the old_state variable is the correct solution for maintaining consistent logic flow. The state is captured before any modifications, which prevents the logic checks from being affected by the early state change to CANCELLED.

Also applies to: 30-30


32-36: Effective guard against double-cancellation.

The early return when the URB is already CANCELLED prevents redundant operations and potential race conditions. The spinlock protection ensures thread-safety. Returning 0 is appropriate since the cancellation is already in progress.


42-42: Correct usage of old_state for logic flow decisions.

Using old_state instead of vurb->state in these conditionals is essential because the state was set to CANCELLED earlier in the function. This preserves the original logic:

  • Line 42: Determines whether queue pause is needed based on whether the URB was already posted
  • Line 51: Decides whether to resume the queue based on the original state

Also applies to: 51-51


59-67: Appropriate addition of CANCELLED state to the enum.

The new BCE_VHCI_URB_CANCELLED state is correctly added to the enum. Placement at the end maintains ABI compatibility, and the formatting follows kernel coding conventions.


38-38: The early CANCELLED state transition is properly protected and intentionally designed.

The patch correctly prevents race conditions by:

  • Setting state early while holding the spinlock
  • Checking for double-cancellation using the saved old_state
  • Using old_state for all subsequent logic decisions (lines 42, 51)

This design ensures that concurrent code cannot observe a partially-cancelled URB state, and no code path depends on observing intermediate states during cancellation.

patch/kernel/archive/uefi-x86-6.19/4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch (2)

41-75: LGTM!

The APPLE_IGNORE_MOUSE flag is consistently added to all 9 WELLSPRINGT2 device entries, ensuring T2 trackpads are properly routed to the hid-magicmouse driver.


32-33: Operator precedence bug: add parentheses around bitwise AND.

The & operator has lower precedence than &&, so quirks & APPLE_IGNORE_MOUSE && hdev->type == HID_TYPE_USBMOUSE is parsed as quirks & (APPLE_IGNORE_MOUSE && hdev->type == HID_TYPE_USBMOUSE). This will produce incorrect results.

Apply this diff:

-	if (quirks & APPLE_IGNORE_MOUSE && hdev->type == HID_TYPE_USBMOUSE)
+	if ((quirks & APPLE_IGNORE_MOUSE) && hdev->type == HID_TYPE_USBMOUSE)

Likely an incorrect or invalid review comment.

patch/kernel/archive/uefi-x86-6.19/4005-HID-magicmouse-fix-regression-breaking-support-for-M.patch (1)

25-48: LGTM!

The fix correctly consolidates the HID_ANY_ID case into the default path, ensuring Magic Trackpad 1 devices receive proper report registration via the inner switch's default case.

patch/kernel/archive/uefi-x86-6.19/4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch (2)

23-121: LGTM!

The per-model touchpad dimension macros follow the existing pattern and correctly use float casts for resolution calculations.


314-417: LGTM!

The probe logic correctly handles T2 devices with appropriate bus/type checks, and the device ID table is complete for all 9 T2 Mac models. The structure aligns well with the related patch 4003 for hid-apple coordination. Based on learnings, this follows the established T2-specific patch pattern for the uefi-x86 family.

patch/kernel/archive/uefi-x86-6.19/7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch (2)

26-28: LGTM!

The message update from "too small" to "not valid" correctly reflects the broader condition check that now catches both undersized and oversized BIOS framebuffers.


21-25: Verify version targeting for this BIOS framebuffer fix patch.

The logic change from > to != correctly addresses display corruption on 4K panels by discarding any mismatched BIOS framebuffer, not just undersized ones. However, this patch is dated January 2022 and is being carried forward across kernel versions 6.12, 6.18, and 6.19 in armbian, suggesting it remains non-mainlined. Consider applying exact version matching (e.g., eq 6.19) rather than carrying it across multiple kernel releases, in case the fix is mainlined in a future release.

patch/kernel/archive/uefi-x86-6.19/3007-applesmc-Add-iMacPro-to-applesmc_whitelist.patch (1)

18-29: LGTM!

The DMI whitelist entry for iMacPro follows the established pattern used for other Apple hardware (Macmini, MacPro). The patch is well-formed with proper attribution.

patch/kernel/archive/uefi-x86-6.19/3005-applesmc-basic-mmio-interface-implementation.patch (1)

295-332: LGTM on MMIO initialization and cleanup logic.

The applesmc_try_enable_iomem function has proper error handling with clean goto-based cleanup, and the iomem_base_set flag correctly controls MMIO usage and cleanup. The LDKN version check (≥2) ensures MMIO is only enabled on compatible hardware.

patch/kernel/archive/uefi-x86-6.19/3006-applesmc-fan-support-on-T2-Macs.patch (2)

196-224: Control flow in legacy path is correct.

The legacy FANS_MANUAL path properly checks the read result before attempting the bit manipulation and write. Both the new per-fan key path and the legacy bitmask path correctly propagate errors to the common out: label.


84-114: LGTM on float type detection and conversion.

The implementation correctly detects FLOAT_TYPE entries and applies appropriate conversion. The soft-float implementation handles typical fan speed ranges appropriately.

Verify the float value endianness matches SMC hardware expectations on T2 Macs.

patch/kernel/archive/uefi-x86-6.19/3002-applesmc-make-io-port-base-addr-dynamic.patch (3)

36-44: Well-structured preparation for dynamic port base.

The refactor cleanly converts hardcoded port addresses to per-device offsets. The port_base field initialization is handled in subsequent patches (3003) where ACPI resources are parsed.


107-229: LGTM on I/O function refactoring.

All port I/O functions (send_command, send_byte, read_smc, write_smc, etc.) are consistently updated to use the per-device smc->port_base offset. The parameter threading is correct throughout the call chains.


283-307: Module init/exit correctly use the port base constant.

The request_region and release_region calls in module init/exit are updated to use APPLESMC_PORT_BASE consistently, maintaining the same I/O region management as before while allowing the per-device port_base to vary in ACPI scenarios.

patch/kernel/archive/uefi-x86-6.19/3009-applesmc-battery-charge-limiter.patch (2)

35-45: LGTM on the show function.

The applesmc_BCLM_show function correctly reads the BCLM key and formats it for sysfs output using sysfs_emit.


62-92: LGTM on module lifecycle integration.

The BCLM_group is correctly integrated into applesmc_create_modules with proper error handling and reverse-order cleanup in both the error path and applesmc_destroy_modules.

patch/kernel/archive/uefi-x86-6.19/3004-applesmc-key-interface-wrappers.patch (2)

263-295: LGTM on the entry-by-index refactoring.

The refactored applesmc_get_entry_by_index properly uses the new wrapper functions and maintains the same functionality with cleaner separation of concerns.


233-244: The return value check change from if (ret) to if (ret < 0) is correct and intentional. The read_smc wrapper only returns 0 on success or negative error codes—no positive values are possible. All underlying port-level functions (port_wait_status, port_send_command, etc.) follow the kernel convention of returning 0 for success and negative error codes (-EIO) for failures. This change makes the error checking semantically explicit and aligns with standard Linux kernel conventions; it does not mask errors.

patch/kernel/archive/uefi-x86-6.19/3003-applesmc-switch-to-acpi_device-from-platform.patch (2)

121-145: LGTM on ACPI resource walker.

The applesmc_walk_resources callback correctly handles ACPI resource enumeration: it validates IO resource length, sets port_base only once, and properly signals completion or failure at END_TAG.


174-201: LGTM on ACPI driver definition.

The ACPI driver structure correctly defines the device ID table (APP0001), ops callbacks, and PM operations. This follows standard kernel ACPI driver patterns.

patch/kernel/archive/uefi-x86-6.19/3001-applesmc-convert-static-structures-to-drvdata.patch (2)

421-467: LGTM on probe/remove lifecycle management.

The applesmc_probe function correctly allocates, initializes, and registers per-device state with proper error handling and cleanup paths. The applesmc_remove function properly tears down in reverse order with mutex destruction.


1006-1040: LGTM on per-device backlight handling.

The workqueue and LED classdev are properly initialized per-device. Using container_of in applesmc_backlight_set correctly retrieves the device context from the work struct.

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

🧹 Nitpick comments (1)
patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch (1)

62-63: Trailing whitespace on line 62.

Line 62 appears to contain only whitespace characters before the final help text line. While this may not cause functional issues, it's typically considered poor style in Kconfig files and some kernel checkpatch scripts may flag it.

-	 
-	  If "M" is selected, the module will be called apple-bce.
+	  If "M" is selected, the module will be called apple-bce.
📜 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 e711d63 and d774942.

📒 Files selected for processing (1)
  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
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: 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: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
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: 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/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: 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: leggewie
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-08-29T18:44:47.732Z
Learning: When creating GitHub issues for code improvements in the Armbian build project, include the relevant patches/diffs in the issue description or open a PR directly instead of just describing the changes. This makes it more efficient for the assignee to handle the improvements.
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.
📚 Learning: 2025-11-06T15:36:04.682Z
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.

Applied to files:

  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch
📚 Learning: 2025-09-25T18:37:00.330Z
Learnt from: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-199
Timestamp: 2025-09-25T18:37:00.330Z
Learning: In PR armbian/build#8661, line 235 of lib/functions/compilation/armbian-kernel.sh already contains the corrected comment "BPF link support for netfilter hooks" for NETFILTER_BPF_LINK, not the misleading "BPF_SYSCALL" comment that was flagged during review.

Applied to files:

  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch
📚 Learning: 2025-07-27T15:54:35.119Z
Learnt from: pyavitz
Repo: armbian/build PR: 8421
File: config/kernel/linux-sunxi64-edge.config:2168-2173
Timestamp: 2025-07-27T15:54:35.119Z
Learning: In the Armbian build system, staging 802.11 drivers like CONFIG_RTLLIB, CONFIG_RTL8192E, CONFIG_R8712U are kept enabled alongside upstream rtw88 drivers because rtw88 is still under development and suffers from reliability issues. The staging drivers serve as necessary fallbacks when upstream drivers are unstable, prioritizing working hardware over avoiding technical conflicts.

Applied to files:

  • patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch
🔇 Additional comments (1)
patch/kernel/archive/uefi-x86-6.19/1002-Put-apple-bce-in-drivers-staging.patch (1)

68-73: LGTM!

The Makefile change from obj-m to obj-$(CONFIG_APPLE_BCE) correctly integrates the module with the kernel's Kconfig system, allowing proper build control based on the configuration option.

@EvilOlaf EvilOlaf marked this pull request as draft December 17, 2025 16:04
@EvilOlaf
Copy link
Member Author

i just realized uefi-arm64 is affected by this too. converted to draft

@EvilOlaf
Copy link
Member Author

@rpardini the patch net: stmicro: stmmac: Phytium onboard ethernet drivers and ACPI glue breaks compilation.
https://paste.armbian.com/umepeviqaq line 22350

@EvilOlaf EvilOlaf marked this pull request as ready for review December 21, 2025 10:12
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: 4

🧹 Nitpick comments (2)
patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled (2)

316-322: Dead code in error path.

The error cleanup checks plat_dat->exit and plat_dat->bsp_priv, but neither is ever set in dwmac_phytium_parse_config_acpi(). This entire block is effectively dead code. Either remove it or properly initialize the exit callback if cleanup is needed.

 err_exit:
-	if (plat_dat->exit)
-		plat_dat->exit(pdev, plat_dat->bsp_priv);
-
 	return ret;
 }

441-458: Duplicate of kernel's fwnode_get_phy_mode().

This fw_get_phy_mode() function duplicates the kernel's existing fwnode_get_phy_mode() which is already used in dwmac-phytium.c at line 178. This inconsistency could lead to behavioral differences and maintenance burden.

Consider using fwnode_get_phy_mode() from <linux/of_net.h> or <linux/property.h> consistently throughout.

📜 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 d774942 and 36dfe31.

📒 Files selected for processing (2)
  • patch/kernel/archive/uefi-arm64-6.19/board-hikey960-usb.patch (1 hunks)
  • patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
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-12-19T13:56:45.124Z
Learning: When reviewing kernel or u-boot version bump PRs in the Armbian build system, check if patches existed in previous kernel version directories (e.g., sunxi-6.12, sunxi-6.13) before describing them as new features. If a patch and the majority of its contents existed previously with no major functionality changes, focus the review on the actual changes: the version bump itself and patch compatibility adjustments. Don't describe existing patches being ported/maintained across versions as new features or drivers—this is misleading. The patches are existing code being re-aligned to work with the new upstream version.
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-12-17T05:09:02.306Z
Learning: In the Armbian build system, kernel patches (e.g., in patch/kernel/archive/sunxi-6.18/patches.armbian/) contain device tree overlays and other code that have existed for years and are maintained/ported across kernel versions. When reviewing PRs that modify these patch files, focus on the actual changes being made (e.g., Makefile fixes, new additions) rather than reviewing the entire existing content within the patch as if it were new code. The patch file contents are existing, stable code unless explicitly modified in the PR diff.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub or the PR API to get the complete picture of what files are being added or modified.
Learnt from: EvilOlaf
Repo: armbian/build PR: 8428
File: config/boards/lckfb-taishanpi.csc:5-9
Timestamp: 2025-07-25T03:51:50.830Z
Learning: When reviewing PRs in the Armbian build system, U-Boot defconfig files and patches may be added as part of the PR changes but might not be visible in the current repository clone state during review. It's important to check the actual PR file changes directly via GitHub API (https://api.github.com/repos/armbian/build/pulls/{pr_number}/files) to get the complete picture of what files are being added or modified, especially for U-Boot patches that will be applied during the build process.
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: 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: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-199
Timestamp: 2025-09-25T18:37:00.330Z
Learning: In PR armbian/build#8661, line 235 of lib/functions/compilation/armbian-kernel.sh already contains the corrected comment "BPF link support for netfilter hooks" for NETFILTER_BPF_LINK, not the misleading "BPF_SYSCALL" comment that was flagged during review.
Learnt from: tabrisnet
Repo: armbian/build PR: 8661
File: lib/functions/compilation/armbian-kernel.sh:194-199
Timestamp: 2025-09-25T18:37:00.330Z
Learning: In PR armbian/build#8661, line 235 of lib/functions/compilation/armbian-kernel.sh already contains the corrected comment "BPF link support for netfilter hooks" for NETFILTER_BPF_LINK, not the misleading "BPF_SYSCALL" comment that was flagged during review.
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.
📚 Learning: 2025-12-17T15:46:22.709Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 9096
File: patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-add-overlays.patch:4-5
Timestamp: 2025-12-17T15:46:22.709Z
Learning: In Armbian kernel patches, when patches are renamed or reorganized, the old Subject line may be intentionally preserved in the patch header (as a second Subject line) for archival/historical purposes to document the previous patch name. This is an Armbian-specific practice for tracking patch evolution and should not be flagged as an error when the maintainer has intentionally included it for documentation.

Applied to files:

  • patch/kernel/archive/uefi-arm64-6.19/board-hikey960-usb.patch
  • patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled
📚 Learning: 2025-12-17T05:09:02.306Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-12-17T05:09:02.306Z
Learning: In the Armbian build system, kernel patches (e.g., in patch/kernel/archive/sunxi-6.18/patches.armbian/) contain device tree overlays and other code that have existed for years and are maintained/ported across kernel versions. When reviewing PRs that modify these patch files, focus on the actual changes being made (e.g., Makefile fixes, new additions) rather than reviewing the entire existing content within the patch as if it were new code. The patch file contents are existing, stable code unless explicitly modified in the PR diff.

Applied to files:

  • patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled
📚 Learning: 2025-12-19T13:56:45.124Z
Learnt from: EvilOlaf
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-12-19T13:56:45.124Z
Learning: When reviewing kernel or u-boot version bump PRs in the Armbian build system, check if patches existed in previous kernel version directories (e.g., sunxi-6.12, sunxi-6.13) before describing them as new features. If a patch and the majority of its contents existed previously with no major functionality changes, focus the review on the actual changes: the version bump itself and patch compatibility adjustments. Don't describe existing patches being ported/maintained across versions as new features or drivers—this is misleading. The patches are existing code being re-aligned to work with the new upstream version.

Applied to files:

  • patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled
📚 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/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled
📚 Learning: 2025-11-06T15:36:04.682Z
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.

Applied to files:

  • patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled
📚 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:

  • patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled
🔇 Additional comments (4)
patch/kernel/archive/uefi-arm64-6.19/board-hikey960-usb.patch (3)

1-11: Archeology header correctly documents patch origin.

The X-Git-Archeology header properly tracks the patch history from the original August 2023 commit, following Armbian conventions.


57-72: Endpoint remapping logic is correct.

The modifications properly establish the USB hub as an intermediary between the DWC3 USB controller and the Type-C port manager. The bidirectional endpoint references are correctly maintained, creating the topology: dwc3_role_switch ↔ hikey_usb_ep0 ↔ [usb-hub] ↔ hikey_usb_ep1 ↔ rt1711h_ep.


33-38: Compatible string "hisilicon,usbhub" is supported in kernel 6.19.

The hisi_hikey_usb driver in drivers/misc/hisi_hikey_usb.c provides support for the onboard USB GPIO hub on HiKey960, and the device tree syntax is correct. No breaking changes are present in kernel 6.19 relative to 6.18 for this compatible string.

patch/kernel/archive/uefi-arm64-6.19/net-stmicro-stmmac-Phytium-onboard-ethernet-drivers-and-ACPI-glue-for-6.x.patch.disabled (1)

1-6: Patch correctly disabled pending fixes.

The .disabled extension is appropriate given the reported compilation failure. Based on the review, the following should be addressed before re-enabling:

  1. Fix indentation (spaces → tabs) in stmmac_get_platform_resources changes
  2. Add error handling for clk_prepare_enable() and stmmac_acpi_clock_setup() calls
  3. Remove or update the duplicate fw_get_phy_mode() function
  4. Use proper error codes instead of -1 in stmmac_acpi_clock_setup()

The PR author already identified this patch as problematic - these notes may help when updating it for 6.19 compatibility.

@rpardini
Copy link
Member

loongarch64 is also affected by this, I think, and that might be more challenging.

@EvilOlaf
Copy link
Member Author

loongarch64 is also affected by this, I think, and that might be more challenging.

Ah yes, of course. Though I have no option in dealing with that.

@amazingfate
Copy link
Contributor

I will work on loongarch64.

@rpardini
Copy link
Member

Deal, i'll work on the stmmac Phytium ACPI glue patch then.

@rpardini
Copy link
Member

Reworking this a bit.

Never trust the rabbit: d774942 is wrong (patch won't apply without the quote, didn't investigate).

@rpardini rpardini changed the title uefi-x86: bump edge to 6.19-rc1 uefi-all: bump edge to 6.19 (except loong64); legacy 6.6 -> 6.12; current/cloud 6.12 -> 6.18 Dec 29, 2025
@rpardini
Copy link
Member

rpardini commented Dec 29, 2025

Reworked this a bit, reworded, reworked the Phytium stmmac ACPI patch (now multiple).

I will work on loongarch64.

@amazingfate: I've overwrote loong64 to keep it's edge on 6.18 so we can merge this and you can work separately; please revert uefi-loong64: *temporary* hold uefi-loong64 edge at 6.18 when you send it?

@EvilOlaf EvilOlaf merged commit 30389a6 into armbian:main Dec 29, 2025
11 checks passed
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, ... 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.

3 participants