Skip to content

patch maintenance: rewrite various patch sets against their current major.minor.patch release - #10329

Open
EvilOlaf wants to merge 7 commits into
armbian:mainfrom
EvilOlaf:patch-maint
Open

patch maintenance: rewrite various patch sets against their current major.minor.patch release#10329
EvilOlaf wants to merge 7 commits into
armbian:mainfrom
EvilOlaf:patch-maint

Conversation

@EvilOlaf

@EvilOlaf EvilOlaf commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

rewrite various patch sets to bring them back in shape

How Has This Been Tested?

  • no further tests

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 remote support for the Sunvell T95Z Plus.
    • Added TM16xx LED displays, seven-segment output, and optional keypad support.
    • Added new display panels, SPI MCU joypads, battery gauges, chargers, CAN-FD, cryptography, and hardware RNG support.
    • Added video decoding improvements for Rockchip and Allwinner platforms.
    • Added board support and peripheral enablement for multiple Orange Pi, BigTreeTech, and Rockchip devices.
  • Bug Fixes

    • Improved Bluetooth, USB-C, HDMI, Ethernet, storage, audio, graphics, touchscreen, wireless, and DMA reliability.
    • Improved power management, clock handling, GPIO interrupts, and thermal monitoring.

@github-actions github-actions Bot added the size/large PR with 250 lines or more label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates Meson, Rockchip, and Allwinner kernel patch archives. It adds hardware drivers and device-tree support, adjusts USB, PCIe, GPU, media, power, and networking behavior, and refreshes patches for kernel 6.18 and 7.1.

Changes

Meson platform patches

Layer / File(s) Summary
Meson drivers and board support
patch/kernel/archive/meson64-*/*
Adds the Sunvell T95Z Plus keymap, Meson GPIO IRQ mapping, HDMI codec control updates, and PCIe Root Port MPS handling.

Rockchip platform patches

Layer / File(s) Summary
Rockchip driver and display support
patch/kernel/archive/rockchip64-*/*
Adds TM16xx displays, SPI MCU joypads, battery and charger drivers, DRM panels, RK3588 CAN-FD support, GPU clock handling, crypto/TRNG support, and USB/Type-C changes.
Rockchip board and controller updates
patch/kernel/archive/rockchip64-*/*
Updates board device trees and adjusts HDMI, MMC, DMA, Bluetooth, networking, VOP2, PHY, and clock behavior.

Allwinner platform patches

Layer / File(s) Summary
Allwinner device-tree and driver support
patch/kernel/archive/sunxi-*/*
Adds A523 peripheral nodes, H616 Ethernet and video support, H618 regulator timing, board support, MMC updates, runtime-PM changes, touchscreen power handling, and TCPM fixes.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: johnthecoolingfan, pyavitz, schwar3kat

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the patch-set maintenance and rewrites against updated kernel releases.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Aug 4, 2026
@EvilOlaf EvilOlaf changed the title Patch maint patch maintenance: rewrite various patch sets against their current major.minor.patch release Aug 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (44)
patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch (1)

81-85: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Release the pc->of_irq reference in both driver variants.

Both patches store of_find_compatible_node() results in pc->of_irq but do not run of_node_put() or a device-managed OF cleanup in probe failure or remove paths, so the node reference remains leaked.

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

In
`@patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch`
around lines 81 - 85, Release the OF node reference stored in pc->of_irq for
both driver variants by adding cleanup in probe-failure and remove paths, or
using device-managed OF cleanup consistently. Apply the corresponding fix in
patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch
at lines 81-85 and
patch/kernel/archive/meson64-7.1/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch
at lines 81-85, covering both amlogic,meson-gpio-intc and
amlogic,meson-gpio-intc-ext lookup results.
patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch (3)

210-215: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the MCP2515 SPI clock at or below 10 MHz.

spi-max-frequency = <12500000> exceeds the MCP2515 10 MHz SPI clock limit. Use 10000000 or a lower value.

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

In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch`
around lines 210 - 215, Update the MCP2515 device node’s spi-max-frequency
property to 10000000 or a lower value, ensuring the configured SPI clock does
not exceed the MCP2515’s 10 MHz limit.

Source: MCP tools


196-220: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Declare the MCP2515 interrupt.

Add interrupts to the can node so the SPI GPIO interrupt has a defined source and trigger type, as required by the MCP2515 device-tree binding. If can0_pin_irq configures that GPIO, add its concrete pin selector too.

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

In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch`
around lines 196 - 220, Add the required interrupt declaration to the MCP2515
`can` node, using the GPIO controller and trigger configuration represented by
`can0_pin_irq`; include the concrete pin selector if that pinctrl entry does not
already define it. Keep the existing `interrupt-parent` and MCP2515 node
configuration unchanged.

Source: MCP tools


146-150: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Use a hyphen in the node name.

mcp2515_clock is used as the node name, but labels may keep underscores while DTS node names should use only lowercase letters, digits, and dashes. Rename the node to mcp2515-clock; references to the label &mcp2515_clock do not need to change.

Proposed fix
-mcp2515_clock: mcp2515_clock {
+mcp2515_clock: mcp2515-clock {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch`
around lines 146 - 150, Rename the fixed-clock node declared alongside the
mcp2515_clock label from mcp2515_clock to mcp2515-clock, while preserving the
mcp2515_clock label and all references to it.

Source: MCP tools

patch/kernel/archive/sunxi-6.18/patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch (1)

19-38: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Associate H616 with sun50i_h616_cedrus_variant.

The patch defines an H616-specific variant with a 600 MHz module rate, but Line 37 selects sun50i_h6_cedrus_variant. H616 therefore uses the wrong variant data and the new definition is unused.

Proposed fix
 	{
 		.compatible = "allwinner,sun50i-h616-video-engine",
-		.data = &sun50i_h6_cedrus_variant,
+		.data = &sun50i_h616_cedrus_variant,
 	},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch`
around lines 19 - 38, Update the H616 entry in cedrus_dt_match to reference the
newly defined sun50i_h616_cedrus_variant instead of sun50i_h6_cedrus_variant,
ensuring H616 uses its 600 MHz variant data.
patch/kernel/archive/sunxi-7.0/patches.armbian/0997-i2c-mv64xxx-pin-runtime-pm.patch (1)

48-51: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Propagate failed runtime resumes out of both probes.

The I2C and MMC patches call pm_runtime_resume_and_get() and then continue after a negative return value. Return the probe error path instead so device probe does not proceed when runtime resume cannot activate the controller; apply the same behavior to both 0997-i2c-mv64xxx-pin-runtime-pm.patch and 0998-sunxi-mmc-pin-runtime-pm.patch.

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

In
`@patch/kernel/archive/sunxi-7.0/patches.armbian/0997-i2c-mv64xxx-pin-runtime-pm.patch`
around lines 48 - 51, Update the probe paths calling pm_runtime_resume_and_get()
to return the negative error immediately instead of only warning and continuing.
Apply this in
patch/kernel/archive/sunxi-7.0/patches.armbian/0997-i2c-mv64xxx-pin-runtime-pm.patch
lines 48-51 and
patch/kernel/archive/sunxi-7.0/patches.armbian/0998-sunxi-mmc-pin-runtime-pm.patch
lines 48-51, preserving successful probe behavior when the resume succeeds.
patch/kernel/archive/sunxi-6.18/patches.armbian/drv-staging-rtl8723bs-AP-bugfix.patch (1)

14-22: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Initialize the complete station_info structure before calling cfg80211_new_sta().

struct station_info contains pointer fields such as pertid and generation; since sinfo is stack allocated, cfg80211_new_sta() can read uninitialized values. Initialize the whole structure instead of clearing only pertid. The same uninitialized sinfo pattern should be applied to both sunxi-6.18 and sunxi-7.0 copies of this patch.

Proposed fix
-	struct station_info sinfo;
+	struct station_info sinfo = {};
...
-		sinfo.pertid = 0;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/drv-staging-rtl8723bs-AP-bugfix.patch`
around lines 14 - 22, In rtw_cfg80211_indicate_sta_assoc, zero-initialize the
entire stack-allocated station_info structure before assigning its fields and
calling cfg80211_new_sta(), rather than initializing only pertid. Apply the same
correction to both the sunxi-6.18 and sunxi-7.0 copies of this patch.
patch/kernel/archive/sunxi-6.18/patches.armbian/drv-bluetooth-hci-sprd-broken-park-link-quirk-v6.16-plus.patch (1)

22-26: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Qualify the ttyBT match to Spreadtrum hardware.

hdev->manufacturer == 0xffff can apply to other UART HCI devices that do not report a specific manufacturer, and this condition does not exclude a non-sprd BT driver from the scope of the broken Park link quirk. Tighten the match to the known SPRD Uwe5622/sprd path before applying the quirk.

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

In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/drv-bluetooth-hci-sprd-broken-park-link-quirk-v6.16-plus.patch`
around lines 22 - 26, The condition applying HCI_QUIRK_BROKEN_PARK_LINK_STATUS
must restrict the ttyBT match to the known Spreadtrum Uwe5622/sprd driver path,
not merely manufacturer 0xffff. Update the quirk logic around hci_set_quirk to
validate the appropriate SPRD driver identifier before applying it, while
preserving the existing quirk behavior for matching Spreadtrum devices.
patch/kernel/archive/sunxi-7.0/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch (1)

196-221: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add the MCP2515 interrupt binding.

Line 197 defines can0_pin_irq without pins, so it cannot configure an IRQ pin. Lines 210-221 define mcp2515@0 without an interrupts property. When a board enables this node, the driver cannot request its IRQ and cannot operate.

Set the actual GPIO in can0_pin_irq. Add matching interrupt-parent and interrupts properties to mcp2515@0.

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

In
`@patch/kernel/archive/sunxi-7.0/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1.patch`
around lines 196 - 221, Update the can0_pin_irq pinctrl node to specify the
actual GPIO through its pins property, then update the mcp2515@0 node to declare
the matching interrupt-parent and interrupts properties so the MCP2515 driver
can request the configured IRQ.
patch/kernel/archive/sunxi-7.0/patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch (1)

35-38: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Bind H616 to its declared Cedrus variant.

Line 37 maps allwinner,sun50i-h616-video-engine to sun50i_h6_cedrus_variant. This leaves sun50i_h616_cedrus_variant unreachable. H616 then receives the H6 capability set and, after the H6 clock-rate patch, a 648 MHz module rate instead of its declared 600 MHz rate.

Change .data to &sun50i_h616_cedrus_variant.

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

In
`@patch/kernel/archive/sunxi-7.0/patches.armbian/drv-staging-media-sunxi-cedrus-add-H616-variant.patch`
around lines 35 - 38, Update the compatible entry for
allwinner,sun50i-h616-video-engine to reference sun50i_h616_cedrus_variant via
its .data field instead of sun50i_h6_cedrus_variant, ensuring H616 uses its
declared capabilities and clock rate.
patch/kernel/archive/sunxi-6.18/patches.megous/goodix-6.18/0002-Input-goodix-Add-option-to-power-off-the-controller-.patch (1)

58-81: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Restore regulator state on resume failure.

If vddio enable, goodix_reset(), or goodix_request_irq() fails, this path returns with avdd28 enabled. The later failure paths can also leave both regulators enabled.

Add cleanup labels that disable the regulators enabled by this resume attempt before returning the error. This keeps the failure state consistent with the power-off suspend state.

Proposed fix
 	error = regulator_enable(ts->vddio);
 	if (error) {
 		dev_err(dev, "Regulator vddio enable failed.\n");
-		return error;
+		goto disable_avdd28;
 	}
 
 	error = goodix_reset(ts);
 	if (error) {
 		dev_err(dev, "Controller reset failed.\n");
-		return error;
+		goto disable_regulators;
 	}
 
 	error = goodix_request_irq(ts);
 	if (error)
-		return error;
+		goto disable_regulators;
 
 	return 0;
+
+disable_regulators:
+	regulator_disable(ts->vddio);
+disable_avdd28:
+	regulator_disable(ts->avdd28);
+	return error;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/sunxi-6.18/patches.megous/goodix-6.18/0002-Input-goodix-Add-option-to-power-off-the-controller-.patch`
around lines 58 - 81, Update the poweroff-on-resume branch around goodix_reset()
and goodix_request_irq() to unwind regulators on every failure: disable vddio
when its subsequent operations fail, and disable avdd28 as well when vddio
enable or later steps fail. Use cleanup labels that preserve and return the
original error, while keeping the successful path unchanged.
patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-02-core.patch (3)

307-314: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore the user's LED switch state after resume.

mcu_joypad_leds_suspend() sets led_switch to zero, but resume unconditionally sets it to one. A user who disabled the LEDs will have them enabled after resume.

Save the pre-suspend value and restore it during resume.

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

In
`@patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-02-core.patch`
around lines 307 - 314, Update the MCU joypad suspend/resume flow around
mcu_joypad_leds_suspend() and the shown resume block to save the pre-suspend
led_switch value before clearing it, then restore that saved value during resume
instead of unconditionally assigning one; keep led_dirty set so the restored
state is transmitted.

99-116: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Honor each ring's brightness setting.

mcu_joypad_encode_leds() reads brightness only from mc_leds[0] and uses it to scale both rings. The registration code creates two independent multicolor LEDs (left::joystick-left and right::joystick-right), and setting either ring's brightness triggers mcu_led_mc_set() without storing the caller-supplied value.

Encode per-ring brightness if the MCU protocol supports it. Otherwise use one shared brightness control for both rings.

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

In
`@patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-02-core.patch`
around lines 99 - 116, Update mcu_led_mc_set() and mcu_joypad_encode_leds() so
brightness changes are stored and applied independently for each registered
ring, using each ring’s led_cdev.brightness when scaling its RGB components. If
the MCU protocol only supports a single brightness value, replace the
independent controls with one shared brightness control and ensure both rings
use it consistently.

251-254: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Reject zero or too-small polling intervals.

poll-interval-ms = 0 becomes a zero-delay workqueue item; because mcu_joypad_poll() reschedules itself after each transfer, this can create tight polling. The same value also controls the calibration msleep() delays. Validate the property before storing it: reject 0, enforce a reasonable minimum, and apply an upper bound if the protocol requires it.

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

In
`@patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-02-core.patch`
around lines 251 - 254, Validate the poll-interval-ms value in the
initialization flow before assigning it to mjp->poll_interval_ms: reject zero
and values below the driver’s reasonable minimum, and cap values at the
protocol’s required maximum if one exists. Preserve MCU_DEFAULT_POLL_MS when the
property is absent or invalid, and ensure the validated value is used for both
polling and calibration delays.
patch/kernel/archive/rockchip64-6.18/general-driver-tm16xx-led-driver.patch (3)

541-585: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Free all direct-attach state on failure.

linedisp_attach() can allocate linedisp->map and linedisp->message, but out_free_buf frees only linedisp->buf. A failed create_attachment(), linedisp_display(), or device_add_groups() therefore leaks state.

Use the same cleanup as linedisp_detach() on every failure path.

Proposed cleanup
 out_free_buf:
+	kfree(linedisp->map);
+	kfree(linedisp->message);
 	kfree(linedisp->buf);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patch/kernel/archive/rockchip64-6.18/general-driver-tm16xx-led-driver.patch`
around lines 541 - 585, Update the failure cleanup in linedisp_attach() to
perform the same direct-attach state cleanup as linedisp_detach(), including
freeing linedisp->map and linedisp->message along with linedisp->buf. Ensure
every failure path through out_del_attach, out_del_timer, and out_free_buf
releases all allocated state without duplicating or skipping cleanup.

594-608: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Preserve attachment lifetime until all consumers release.

Both cleanup paths free the linedisp_attachment while sysfs/release paths still need it.

  • linedisp_detach(): remove linedisp_groups before calling delete_attachment(), so sysfs callbacks can still lookup linedisp while group removal is in flight.
  • linedisp_unregister(): do not remove the false direct attachment before the last device_put() runs. Either keep the mapping until release, or use container_of() in linedisp_release() and attribute callbacks for child devices.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patch/kernel/archive/rockchip64-6.18/general-driver-tm16xx-led-driver.patch`
around lines 594 - 608, Update linedisp_detach() to remove linedisp_groups
before calling delete_attachment(), keeping the linedisp mapping available while
sysfs callbacks complete. In linedisp_unregister() at
patch/kernel/archive/rockchip64-6.18/general-driver-tm16xx-led-driver.patch:656-661,
retain the false direct attachment until the final device_put() invokes
linedisp_release(), or instead make linedisp_release() and child-device
attribute callbacks obtain the object with container_of(); do not free the
attachment while those consumers may still access it.

1788-1808: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use reg[0] as the digit array index.

tm16xx_display_value() writes buf[i] to display->digits[i], while parsing stores digit nodes in DT enumeration order and only reads their reg property. Nodes with non-sequential, out-of-order, missing, or duplicate reg values can cause characters to display on the wrong digits or be rejected instead of mapped correctly.

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

In `@patch/kernel/archive/rockchip64-6.18/general-driver-tm16xx-led-driver.patch`
around lines 1788 - 1808, The digit parsing loop around tm16xx_display_value
must index display->digits using each child’s parsed reg[0] value rather than
the enumeration counter i. Validate that the index is within the digit array
bounds and reject duplicate indices, while preserving the existing segment
mapping and hardware maximum calculations.
patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch (6)

1353-1357: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Check the chip-ID read error before masking it.

sgm4154x_hw_chipid_detect() returns either a register value or a negative errno, but probe applies SGM4154x_PN_MASK to both. For example, -ENODEV can produce the expected masked bits and allow probe to continue with an unusable device.

Return negative errors before comparing the part ID.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch`
around lines 1353 - 1357, Update the chip-ID handling after
sgm4154x_hw_chipid_detect() to return immediately when ret is negative, before
applying SGM4154x_PN_MASK; only mask and compare successful register values
against SGM4154x_PN_ID, preserving the existing -ENODEV path for mismatched IDs.

1073-1083: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Propagate initialization write failures.

The three regmap_update_bits() calls in this block ignore return values, so probe can succeed while charger interrupt and control configuration remain unmodified. Store each result and jump to err_out on failure.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch`
around lines 1073 - 1083, Update the initialization block containing the three
regmap_update_bits() calls to capture each return value and immediately jump to
err_out when any call fails, ensuring probe does not continue with incomplete
charger configuration.

1258-1279: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate OTG regulator registration failures.

sgm4154x_vbus_regulator_register() can return -ENXIO or devm_regulator_register() errors, but probe ignores the return value. A successful probe can then complete without exposing the regulator required by vbus5v0_typec consumers. Check the return value and call of_node_put(np) on the regulators node when registering the OTG regulator.

Also applies to line 1409.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch`
around lines 1258 - 1279, Update the probe path calling
sgm4154x_vbus_regulator_register() to check and propagate its return value,
preventing successful probe without the required OTG regulator; apply the same
handling at the additional call site near line 1409. In
sgm4154x_vbus_regulator_register(), call of_node_put(np) before returning after
the regulator registration attempt, including error paths, while preserving the
existing -ENXIO and devm_regulator_register() error codes.

892-923: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Serialize charger state and register updates.

s->lock only protects sgm4154x_charger_get_property(). sgm4154x_irq_handler_thread(), sgm_charger_work(), regulator callbacks, sgm4154x_charger_set_property(), and sgm4154x_hw_init() all read/write sgm->state or charger registers outside that lock. Wrap the full read-modify-write sequences with one defined lock to avoid overlapping charger enable/input-limiting/OTG register writes.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch`
around lines 892 - 923, Define one shared lock in the sgm4154x device and use it
to serialize all charger state and register access. Update
sgm4154x_irq_handler_thread, sgm_charger_work, regulator callbacks,
sgm4154x_charger_set_property, and sgm4154x_hw_init to hold the lock across each
complete read-modify-write sequence, while retaining protection in
sgm4154x_charger_get_property; ensure charger enable, input-current limiting,
and OTG updates cannot overlap.

859-862: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Remove or manage the manual registers sysfs attribute.

device_create_file() is not cleaned up by the driver, and sgm4154x_charger_remove() does not call device_remove_file(). The registers_show / registers_store callbacks still dereference the devm-freed sgm4154x_device, so driver unbind can leave a dangling sysfs access.

Use managed group creation, or add device_remove_file() to every failure/unbind/shutdown path. Also check the creation return value at the call sites.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch`
around lines 859 - 862, Replace the unmanaged device_create_file call in
sgm4154x_create_device_node with a managed sysfs attribute group, or explicitly
track and remove the attribute in every probe failure, sgm4154x_charger_remove,
and shutdown path. Propagate and handle creation errors at all call sites so
registers_show and registers_store cannot access a freed sgm4154x_device.

1361-1369: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Balance IRQ wake setup.

enable_irq_wake() is called inside the existing IRQ allocation block, so this does not add a new setup point at lines 1430-1437. Fix the current enable_irq_wake() call by checking its return value and calling disable_irq_wake() on failed probe or during remove/error cleanup.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-sgm41542.patch`
around lines 1361 - 1369, Update the IRQ setup and cleanup paths around
sgm4154x_irq_handler_thread to check and propagate enable_irq_wake() failures,
and balance successful wake enabling with disable_irq_wake() during probe error
cleanup and device removal. Ensure cleanup only disables wake when it was
successfully enabled.
patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-03-input.patch (2)

356-386: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Require a complete and valid calibration range.

has_dt_range becomes true when any one of the four properties is present. If a device tree supplies only abs-x-min, the missing endpoints remain zero but the code skips the default range.

Require all four endpoints before setting has_dt_range, and validate that each minimum is below its maximum.

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

In
`@patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-03-input.patch`
around lines 356 - 386, Update the calibration initialization around left_cal
and right_cal so has_dt_range is true only when all four corresponding device
properties are present and each minimum is strictly less than its maximum. If
any property is missing or any range is invalid, set has_dt_range false and
initialize all endpoints to MCU_RAW_MIN and MCU_RAW_MAX as the existing fallback
does.

76-81: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Rescale the radial deadzone to MCU_AXIS_MAX.

apply_radial_deadzone() maps [deadzone..max] to [0..max], so full calibrated stick deflection never reaches MCU_AXIS_MAX. For example, with a 3000 deadzone, 32767 maps to 29767. Scale the output with MCU_AXIS_MAX instead, and keep the deadzone == MCU_AXIS_MAX guard safe.

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

In
`@patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-03-input.patch`
around lines 76 - 81, Update apply_radial_deadzone() so the post-deadzone
magnitude is rescaled to MCU_AXIS_MAX rather than leaving the maximum at max
minus deadzone. Preserve the existing coordinate direction and integer
arithmetic, and ensure the deadzone == MCU_AXIS_MAX case remains safely guarded
against invalid division or negative scaling.
patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch (5)

848-851: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Do not report a fixed 10 Ah battery capacity.

POWER_SUPPLY_PROP_CHARGE_FULL reports 10 * 1000 * 1000 uAh for every battery. This makes capacity and energy calculations incorrect for boards with a different battery profile, including the stated Anbernic use case.

Read the capacity from battery information/profile data, or remove the unsupported property.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch`
around lines 848 - 851, Update the CW221X power-supply property handler for
POWER_SUPPLY_PROP_CHARGE_FULL and POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN to stop
returning the hardcoded 10 Ah value. Use the battery profile/configured capacity
data when available; otherwise remove or reject these unsupported properties
rather than reporting a fabricated capacity.

777-797: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make SoC notification state per device.

static int soc is shared by every CW221x instance and survives device removal. One gauge can suppress power_supply_changed() notifications for another gauge.

Store the previous SoC in struct cw_battery and initialize it per instance.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch`
around lines 777 - 797, Update cw_bat_work to use a previous-SoC field on struct
cw_battery instead of the shared static soc variable, and initialize that field
when each battery instance is created so its first comparison is well-defined.
Keep power_supply_changed notification behavior based on changes to that
per-device state.

858-865: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return the read error from power-supply get_property.

cw_get_voltage() and cw_get_current() already return negative values on I2C read failures, but cw_battery_get_property() discards them and returns success with stale cached values for POWER_SUPPLY_PROP_VOLTAGE_NOW and POWER_SUPPLY_PROP_CURRENT_NOW. Store the return value and return it for these cases.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch`
around lines 858 - 865, Update cw_battery_get_property() so the
POWER_SUPPLY_PROP_VOLTAGE_NOW and POWER_SUPPLY_PROP_CURRENT_NOW cases capture
the return values from cw_get_voltage() and cw_get_current(), respectively, and
immediately return any negative read error instead of using stale cached values;
retain the existing value conversion and successful return behavior.

561-574: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Serialize gauge I/O with cached property reads.

cw_battery_get_property() reads cw_bat fields directly, and properties like POWER_SUPPLY_PROP_VOLTAGE_NOW and POWER_SUPPLY_PROP_CURRENT_NOW also call refresh I/O while cw_update_data() does the same from delayed work. Add one per-device mutex that protects both cw_update_data() I/O/cache writes and property refresh reads, so the battery cannot expose a mixed partial state.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch`
around lines 561 - 574, Update the cw_battery synchronization by adding a
per-device mutex to struct cw_battery and using it to serialize all
cw_update_data() gauge I/O and cached-field writes with
cw_battery_get_property() refreshes and reads, including VOLTAGE_NOW and
CURRENT_NOW. Initialize and destroy the mutex with the device lifecycle, and
ensure every relevant access path locks and unlocks it without exposing a mixed
partial state.

969-985: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Wait for battery delayed work before suspend completes.

cw_bat_work() calls cw_update_data() and then requeues itself with queue_delayed_work(). cancel_delayed_work() does not wait for the current work execution, so I2C reads can continue after suspend starts. Use cancel_delayed_work_sync() and add a suspended state check in cw_bat_work() so it cannot requeue while suspended.

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

In `@patch/kernel/archive/rockchip64-7.1/general-power-supply-add-cw221x.patch`
around lines 969 - 985, Update cw_bat_suspend to use cancel_delayed_work_sync so
any running battery_delay_work completes before suspend returns, and add a
suspended-state guard in cw_bat_work that prevents requeueing while suspended.
Ensure the suspend/resume state is set consistently so cw_bat_resume can restart
the delayed work without allowing it to reschedule during suspension.
patch/kernel/archive/rockchip64-6.18/general-disable-mtu-validation.patch (1)

21-46: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Preserve the 16 KiB MTU ceiling.

This patch removes the independent BUF_SIZE_16KiB limit, so stmmac_change_mtu() can accept MTUs above the stmmac DMA hardware limit. Keep that upper bound in place, or make all affected kernel versions enforce the same ceiling elsewhere.

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

In `@patch/kernel/archive/rockchip64-6.18/general-disable-mtu-validation.patch`
around lines 21 - 46, Update stmmac_change_mtu() to retain the BUF_SIZE_16KiB
upper-bound validation while removing or bypassing only the FIFO-size check.
Ensure MTUs above the 16 KiB DMA limit still return -EINVAL, consistently across
all affected kernel versions.
patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-04-leds.patch (1)

217-224: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Handle suspend transfer failures.

spi_sync_transfer() can return a negative error code, and this path ignores it after mcu_joypad_encode_leds() marks the LED update as dirty. A failed suspend transfer can prevent the MCU from entering the LED-off suspend state, with no return value, retry, or diagnosis. Log or return the error, and keep led_dirty until the MCU update completes.

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

In
`@patch/kernel/archive/rockchip64-7.1/general-input-add-spi-mcu-joypad-04-leds.patch`
around lines 217 - 224, Update the suspend LED-off flow around
mcu_joypad_encode_leds and spi_sync_transfer to capture and handle the
transfer’s negative return value. Preserve led_dirty on failure so the update
can be retried, and provide appropriate error reporting since this path has no
return value; clear the dirty state only after a successful MCU update.
patch/kernel/archive/rockchip64-6.18/general-drm-panel-add-yixian-yx0345-panel.patch (1)

196-208: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return accumulated DSI initialization failures.

mipi_dsi_dcs_write_buffer_multi() writes failures into mctx.accum_err, so yixian_yx0345_prepare() can fail while the panel enable path is left active. Return mctx.accum_err at the end of the sequence.

Proposed fix
-	return 0;
+	return mctx.accum_err;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/rockchip64-6.18/general-drm-panel-add-yixian-yx0345-panel.patch`
around lines 196 - 208, Update yixian_yx0345_prepare() to return mctx.accum_err
after completing the initialization command loop and final delay, instead of
unconditionally returning 0. Preserve the existing command execution and delay
behavior.
patch/kernel/archive/rockchip64-7.1/rk3399-usbc-Revert-usb-typec-tcpm-unregister-existing-source-cap.patch (1)

16-36: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the partner source capability un-registration.

tcpm_register_source_caps() can run when source PDOs or negotiated revisions change. Keep the existing cap = port->partner_source_caps logic, unregister it with usb_power_delivery_unregister_capabilities(cap) when it is present, clear port->partner_source_caps, then assign the replacement from usb_power_delivery_register_capabilities(). The 6.18 and 7.2 archive patches keep the same lifecycle.

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

In
`@patch/kernel/archive/rockchip64-7.1/rk3399-usbc-Revert-usb-typec-tcpm-unregister-existing-source-cap.patch`
around lines 16 - 36, Restore the existing partner source capability lifecycle
in tcpm_register_source_caps(): initialize cap from port->partner_source_caps,
unregister it when present, and clear port->partner_source_caps before
registering the replacement. Keep assigning the result of
usb_power_delivery_register_capabilities() to cap and preserve its error
handling.

Source: MCP tools

patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch (6)

1564-1568: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Balance the devfreq event enable.

devfreq_event_enable_edev(data->edev) runs before rk3328_dmc_init() and rk3328_devfreq_init(). Later probe failures return directly, and rk3328_dmcfreq_remove() only calls rk3328_devfreq_fini(), so the event can remain enabled.

Disable data->edev on failed probe paths and in rk3328_dmcfreq_remove() to match the enable.

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

In `@patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch` around lines
1564 - 1568, Balance the enable in the probe flow by disabling data->edev on
every later failure path after devfreq_event_enable_edev succeeds, including
failures from rk3328_dmc_init() and rk3328_devfreq_init(). Also update
rk3328_dmcfreq_remove() to call devfreq_event_disable_edev(data->edev) alongside
rk3328_devfreq_fini(), while preserving the existing return handling.

355-363: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Enable the DMC timing phandle before adding board-side status.

Add ddr_timing = <&ddr_timing>; here too, or every enabled board override. of_get_rk3328_timings() reads that phandle and continues with firmware initialization even when it is missing or incomplete, so the generic DMC node can leave timing data unavailable for rockchip64-7.1 boards that enable DMC in DTS.

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

In `@patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch` around lines
355 - 363, Add the ddr_timing phandle to the rk3328 DMC device node alongside
operating-points-v2, referencing the existing ddr_timing node so
of_get_rk3328_timings() receives timing data when boards enable the generic DMC
node.

1560-1563: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Return the actual devfreq_event_get_edev_by_phandle() error.

devfreq_event_get_edev_by_phandle() can fail with permanent errors such as -EINVAL or -ENODEV, but this probe currently treats every failure as -EPROBE_DEFER. Return PTR_ERR(data->edev) and defer only when the error is -EPROBE_DEFER.

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

In `@patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch` around lines
1560 - 1563, Update the error handling after devfreq_event_get_edev_by_phandle()
in the probe path to capture PTR_ERR(data->edev), return -EPROBE_DEFER only when
that error matches -EPROBE_DEFER, and otherwise return the original error.

1500-1509: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Initialize rdev->rate with the selected OPP frequency.

rk3328_devfreq_init() selects cur_freq from the OPP table, but dmcfreq->rate is only assigned from *freq in rk3328_dmcfreq_target(). Since get_cur_freq() and get_dev_status() return that cached rate, expose the selected frequency before devfreq registration so active DMC frequency queries do not return zero.

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

In `@patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch` around lines
1500 - 1509, Update rk3328_devfreq_init() after devfreq_recommended_opp()
successfully selects cur_freq to initialize the DMC device's cached rate
(rdev->rate, or the corresponding dmcfreq rate field) with cur_freq before
devfreq registration. Preserve the existing OPP release and error handling, and
ensure get_cur_freq() and get_dev_status() observe the selected initial
frequency instead of zero.

461-468: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Validate every ioremap() result before use.

rockchip_ddrclk_data_init() sets inited_flag even if ioremap() returns NULL, so the v2 clock callbacks can dereference ddr_data.share_memory before the mapping exists. rk3328_dmc_init() also passes ddr_psci_param to of_get_rk3328_timings() immediately after mapping. Check each mapping, return -ENOMEM on failure, and unmap it on later initialization failure or in rk3328_dmcfreq_remove().

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

In `@patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch` around lines
461 - 468, Validate the ioremap result in rockchip_ddrclk_data_init before
assigning ddr_data.inited_flag, returning -ENOMEM when the mapping fails. In
rk3328_dmc_init, validate ddr_psci_param before passing it to
of_get_rk3328_timings, and unmap any successful mappings when later
initialization fails. Also release the mappings in rk3328_dmcfreq_remove.

659-668: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep unsupported DDR types as errors.

rockchip_dfi_ddrtype_to_ctrl() is shared by the existing Rockchip DFI path. Its default case now converts every unsupported dfi->ddr_type to controller register value 0 and returns success. Keep the upstream behavior and return -EOPNOTSUPP, or apply a fallback only in the RK3228/RK3328-specific init path.

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

In `@patch/kernel/archive/rockchip64-7.1/rk3328-add-dmc-driver.patch` around lines
659 - 668, Update rockchip_dfi_ddrtype_to_ctrl() so its default case continues
logging unsupported memory types and returning -EOPNOTSUPP instead of assigning
*ctrl = 0 and succeeding. If RK3228/RK3328 requires a fallback, implement it
only in that platform-specific initialization path.

Source: MCP tools

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

193-217: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve the detected host role.

At Line 214, the non-quirk branch assigns DWC3_GCTL_PRTCAP_DEVICE after the code has already selected DWC3_GCTL_PRTCAP_HOST. When usb3_phy_reset_quirk is false, every host notification is forced into device mode.

Set device mode only when mode is not already DWC3_GCTL_PRTCAP_HOST.

Proposed fix
-		} else {
+		} else if (mode != DWC3_GCTL_PRTCAP_HOST) {
 			mode = DWC3_GCTL_PRTCAP_DEVICE;
 		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/rockchip64-6.18/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch`
around lines 193 - 217, Update the non-quirk branch in the extcon handling
around dwc3_set_mode so it assigns DWC3_GCTL_PRTCAP_DEVICE only when mode is not
already DWC3_GCTL_PRTCAP_HOST. Preserve the host mode selected from
EXTCON_USB_HOST and keep the existing quirk-specific USB state handling
unchanged.

70-75: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Handle USB3 PHY power-on failures before continuing.

At Line 72, phy_power_on() failures are stored only in usb3_phy_powered; the mode transition continues. A failed power-on can leave DWC3 configured for a role with an unpowered PHY.

With multiple ports, the final assignment at Line 74 also hides earlier failures. The paired rk3399-usbc-usb-dwc3-Track-the-power-state-of-usb3_generic_phy.patch uses this flag to decide whether to power off all USB3 PHYs. Roll back partial activation, abort the transition on failure, and set the flag only after all ports succeed.

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

In
`@patch/kernel/archive/rockchip64-6.18/rk3399-usbc-phy-rockchip-naneng-Add-fallback-for-old-DTs.patch`
around lines 70 - 75, The USB3 PHY activation loop in the usb3_phy_reset_quirk
path must handle partial failures instead of continuing with an unpowered PHY.
Update the phy_power_on flow to abort immediately on any failure, power off
previously activated ports, leave usb3_phy_powered unset, and set it only after
every port powers on successfully.
patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch (1)

20-28: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Do not convert DMA-reset failure into success.

Both patches continue DMA initialization after stmmac_reset() fails. A failed reset does not establish that the DMA engine can safely process descriptors.

  • patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch#L20-L28: Restore the error return, or add a tested, Rockchip-specific false-failure condition before continuing.
  • patch/kernel/archive/rockchip64-7.1/temporary-workaround-dma-reset.patch#L20-L28: Apply the same constrained error handling.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch`
around lines 20 - 28, In both
patch/kernel/archive/rockchip64-6.18/temporary-workaround-dma-reset.patch lines
20-28 and
patch/kernel/archive/rockchip64-7.1/temporary-workaround-dma-reset.patch lines
20-28, update stmmac_init_dma_engine so stmmac_reset failure is not converted to
success: restore returning ret, or continue only under a tested
Rockchip-specific false-failure condition with constrained handling.
patch/kernel/archive/rockchip64-7.1/general-drm-panel-add-rocknix-generic-dsi.patch (1)

556-616: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Return the actual mode count from generic_panel_get_modes.

The function always returns 1 at line 615, regardless of how many modes were added by drm_mode_probed_add() in the preceding loop. drm_panel_funcs.get_modes must return the number of modes added.

If ctx->modes is empty, this reports a mode when none exists. If multiple modes were parsed, this undercounts them. Track and return the actual count.

🐛 Proposed fix to return the actual mode count
     struct generic_panel *ctx = panel_to_generic_panel(panel);
     struct drm_display_mode mode_tmp;
     struct drm_display_mode *mode;
     struct generic_panel_mode *genmode = ctx->modes;
+    int count = 0;
 
     while (genmode) {
         ...
         drm_mode_probed_add(connector, mode);
 
+        count++;
         genmode = genmode->prev;
     }
 
     connector->display_info.width_mm = ctx->size.width;
     connector->display_info.height_mm = ctx->size.height;
 
     drm_connector_set_panel_orientation(connector, ctx->orientation);
 
-    return 1;
+    return count;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/rockchip64-7.1/general-drm-panel-add-rocknix-generic-dsi.patch`
around lines 556 - 616, Update generic_panel_get_modes to initialize a mode
counter, increment it only after each successful drm_mode_probed_add call, and
return that counter instead of the unconditional 1. Preserve the existing
-ENOMEM error path so failed mode duplication does not increase the count, and
return zero when ctx->modes is empty.
🧹 Nitpick comments (1)
patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch (1)

52-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the unconditional GPIO IRQ trace from both patch variants.

printk() runs during normal GPIO IRQ mapping and adds default-level log noise.

  • patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch#L52-L52: replace printk() with dev_dbg() or remove it.
  • patch/kernel/archive/meson64-7.1/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch#L52-L52: apply the same logging change.
Proposed change
-	printk("gpio irq setup: hwirq: 0x%X irqfirst: 0x%X irqlast: 0x%X pin[%d]\n", hwirq, bank->irq_first, bank->irq_last, gpio);
+	dev_dbg(pc->dev, "gpio irq setup: hwirq: 0x%X irqfirst: 0x%X irqlast: 0x%X pin[%d]\n", hwirq, bank->irq_first, bank->irq_last, gpio);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch`
at line 52, Remove the unconditional GPIO IRQ printk trace at both affected
sites:
patch/kernel/archive/meson64-6.18/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch
line 52 and
patch/kernel/archive/meson64-7.1/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch
line 52. Either delete the trace or replace it with debug-level logging such as
dev_dbg(), preserving the surrounding GPIO IRQ mapping logic.

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/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

1 participant