Skip to content

k3-beagle: fix malformed csi0-imx219 overlay patch (bad hunk count)#10136

Merged
igorpecovnik merged 1 commit into
mainfrom
fix/beagley-ai-csi0-imx219-overlay-patch
Jul 7, 2026
Merged

k3-beagle: fix malformed csi0-imx219 overlay patch (bad hunk count)#10136
igorpecovnik merged 1 commit into
mainfrom
fix/beagley-ai-csi0-imx219-overlay-patch

Conversation

@igorpecovnik

@igorpecovnik igorpecovnik commented Jul 7, 2026

Copy link
Copy Markdown
Member

Problem

The BeagleY-AI CSI0 IMX219 overlay patch fails to apply on edge / linux-6.18.y kernel builds (board beagley-ai, family k3-beagle), breaking the kernel artifact:

patch: **** malformed patch at line 152: --
Failed to parse unidiff ... 'Hunk is longer than expected'
Summary: 5 total patches; 4 applied; 1 invalid_diff; 1 failed_apply
Exception: Failed to apply 1 patches.

Root cause

In 0003-arm64-dts-ti-add-beagley-ai-csi0-imx219-overlay.patch, the new-file hunk header declared @@ -0,0 +1,130 @@ but the body contains only 128 added lines. patch(1) therefore ran past the hunk and consumed the -- / 2.43.0 git signature footer as diff body. The footer's trailing space had also been stripped (-- instead of -- ).

Fix

  • Hunk count +1,130+1,128
  • Diffstat aligned (128 / 129 insertions(+))
  • Restored the -- signature separator

The overlay content is unchanged and complete (brace/bracket balanced — 21/21 {}, 36/36 <>).

Verification

Both tools that failed in the build now pass against a matching Makefile context:

  • git apply --check → exit 0
  • patch -p1 --dry-run → exit 0

Note: this fixes the patch envelope only. Ideally the same correction lands at the source (original patch author) so it doesn't regress on the next import.

Summary by CodeRabbit

  • New Features
    • Added support for the Raspberry Pi Camera V2.1 (Sony IMX219) on BeagleY-AI CSI0.
    • Expanded the BeagleY-AI overlay list so the new camera overlay is available in builds.
    • Enabled camera-related hardware configuration, including I2C, CSI-2, clock, and power setup, for improved plug-and-play camera use.

The BeagleY-AI CSI0 IMX219 overlay patch failed to apply on edge/6.18
kernel builds:

  patch: **** malformed patch at line 152: --
  Failed to parse unidiff ... 'Hunk is longer than expected'

The new-file hunk header declared "@@ -0,0 +1,130 @@" but the body
contains only 128 added lines, so patch(1) ran past the hunk and
consumed the "--"/"2.43.0" git signature footer. The footer's trailing
space had also been stripped ("--" instead of "-- ").

Correct the hunk count to 128, align the diffstat (128/129 insertions),
and restore the "-- " signature separator. The overlay content is
unchanged and complete (brace/bracket balanced). Verified with both
`git apply --check` and `patch -p1 --dry-run` (exit 0).

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@igorpecovnik igorpecovnik requested a review from Grippy98 as a code owner July 7, 2026 09:29
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5e17a5d0-6a1e-4921-9f9d-e5b811f3d13e

📥 Commits

Reviewing files that changed from the base of the PR and between 37032d1 and 583964b.

📒 Files selected for processing (1)
  • patch/kernel/archive/k3-beagle-6.18/0003-arm64-dts-ti-add-beagley-ai-csi0-imx219-overlay.patch

Disabled knowledge base sources:

  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Walkthrough

Adds a kernel DT overlay patch for BeagleY-AI that enables an IMX219 camera on CSI0, including power, reset, I2C, and CSI-2 endpoint configuration, and registers the overlay in the K3 build list.

Changes

IMX219 CSI0 Overlay

Layer / File(s) Summary
Build list registration
patch/kernel/archive/k3-beagle-6.18/0003-arm64-dts-ti-add-beagley-ai-csi0-imx219-overlay.patch
Adds k3-am67a-beagley-ai-csi0-imx219.dtbo to the TI K3 BeagleY-AI device-tree build list.
IMX219 overlay device-tree definition
patch/kernel/archive/k3-beagle-6.18/0003-arm64-dts-ti-add-beagley-ai-csi0-imx219-overlay.patch
Introduces the overlay source and defines fixed clock/regulators, MCU pinctrl and reset wiring, main_i2c2 setup, the IMX219 sensor node at 0x10, CSI-2 endpoint links, and enables cdns_csi2rx0, ti_csi2rx0, and dphy0.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: jonaswood01

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/beagley-ai-csi0-imx219-overlay-patch

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.

@github-actions github-actions Bot added 08 Milestone: Third 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 Jul 7, 2026
@igorpecovnik igorpecovnik merged commit d0e92d1 into main Jul 7, 2026
11 of 12 checks passed
@igorpecovnik igorpecovnik deleted the fix/beagley-ai-csi0-imx219-overlay-patch branch July 7, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

1 participant