Skip to content

Odin2: Now we can switch back to upstream sdhci-msm driver#9703

Open
kasimling wants to merge 3 commits intoarmbian:mainfrom
kasimling:odin2_fixes_sdhci_msm
Open

Odin2: Now we can switch back to upstream sdhci-msm driver#9703
kasimling wants to merge 3 commits intoarmbian:mainfrom
kasimling:odin2_fixes_sdhci_msm

Conversation

@kasimling
Copy link
Copy Markdown
Contributor

@kasimling kasimling commented Apr 20, 2026

Description

With some new patches from Rocknix, now we can switch back to upstream sdhci-msm driver

Summary by CodeRabbit

  • Bug Fixes

    • Removed patches related to downstream storage driver implementation to improve stability.
  • Chores

    • Enabled UHS-I SDR50/SDR104 SD card speed modes for enhanced performance on supported devices.
    • Updated kernel and board configuration settings.
    • Refined build source URL references.

Signed-off-by: Alex Ling <ling_kasim@hotmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dbd741d6-2eb0-4e9e-b161-43a469fffc75

📥 Commits

Reviewing files that changed from the base of the PR and between 4ce477a and fae29b6.

📒 Files selected for processing (5)
  • config/kernel/linux-sm8550-edge.config
  • patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
  • patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch
  • patch/kernel/archive/sm8550-6.18/v2_20260314_vladimir_zapolskiy_arm64_dts_qcom_sm8x50_enable_uhs_i_sdr50_and_sdr104_sd_card_modes.patch
💤 Files with no reviewable changes (4)
  • config/kernel/linux-sm8550-edge.config
  • patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
  • patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch

📝 Walkthrough

Walkthrough

The changes update SDHC driver configuration and patches for SM8550/Odin2 devices. The board configuration is updated to use a variable-based URL, a kernel config option is removed, three downstream SDHC-specific patches are deleted, and a new patch enables UHS-I SDR50/SDR104 modes while adjusting clock configurations.

Changes

Cohort / File(s) Summary
Build Configuration
config/boards/ayn-odin2.csc, config/kernel/linux-sm8550-edge.config
Updated download source to use ${GITHUB_SOURCE} variable; removed CONFIG_MMC_SDHCI_MSM_DOWNSTREAM=y kernel config option.
Removed Patches
patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-...patch, patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-...patch, patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-...patch
Deleted three patches: one removing sdhci_pltfm_free() calls from downstream SDHCI driver, one reverting clock ops changes for SDCC, and one switching Odin2 SDHC2 to downstream driver with associated DT node and OPP table definitions.
UHS-I Support Update
patch/kernel/archive/sm8550-6.18/v2_20260314_vladimir_zapolskiy_arm64_dts_qcom_sm8x50_enable_uhs_i_sdr50_and_sdr104_sd_card_modes.patch
New patch enabling UHS-I SDR50/SDR104 modes for SM8450/SM8550/SM8650 by removing capability restrictions; updates SM8550/SM8650 SDHC "xo" clock supply from &rpmhcc RPMH_CXO_CLK to &bi_tcxo_div2.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Out with the old downstream patches,
A cleaner path forward we hatch,
UHS modes bloom bright,
Clock signals take flight,
The Odin2 finds better match! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the primary change: switching the Odin2 device back to use the upstream sdhci-msm driver. It directly aligns with the commit messages and the file changes that remove downstream driver patches and configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@github-actions github-actions bot added 05 Milestone: Second 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 Apr 20, 2026
Copy link
Copy Markdown
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: 3

🧹 Nitpick comments (2)
patch/kernel/archive/sm8550-6.18/0500-ROCKNIX-set-boot-fanspeed.patch (1)

30-38: Hardcoded boot PWM value 70 — prefer a named constant or DT property, and double-check the behavioral change.

Two things worth addressing on this one-liner:

  1. Magic number: 70 has no symbolic meaning here (≈27% of MAX_PWM=255). A #define (e.g. PWM_FAN_BOOT_DUTY) or, better, a DT property (e.g. "fan-boot-pwm" with a fallback) would make intent explicit and avoid diverging from upstream for every board.
  2. Behavioral regression risk: the original code starts the fan at ctx->pwm_fan_cooling_levels[ctx->pwm_fan_max_state] when cooling-levels is provided (i.e., full cooling at boot until the thermal framework takes over), otherwise MAX_PWM. Unconditionally forcing 70 means every consumer of this kernel — not just Odin2 — will boot with a quieter-but-weaker fan, regardless of their DT cooling-levels. If the goal is Odin2-specific boot acoustics, gating this on a DT property is strongly preferred over patching the shared driver.

Suggested minimal refactor (keeps current behavior but makes it overridable and greppable):

♻️ Proposed diff
-	ret = set_pwm(ctx, 70);
+	/* Boot fan speed override; falls back to initial_pwm when not set in DT. */
+	if (device_property_read_u32(dev, "fan-boot-pwm", &initial_pwm))
+		initial_pwm = initial_pwm; /* keep computed value above */
+	ret = set_pwm(ctx, initial_pwm);

At minimum, if you want to keep the hardcoded value, please add a brief comment explaining why 70 was chosen and why it's safe for all boards built with this kernel flavor.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sm8550-6.18/0500-ROCKNIX-set-boot-fanspeed.patch` around
lines 30 - 38, Replace the hardcoded 70 in pwm_fan_probe when calling set_pwm
with a configurable value: read a DT property (e.g. "fan-boot-pwm") into a local
boot_pwm and if present use that; otherwise preserve the original behavior by
using ctx->pwm_fan_cooling_levels[ctx->pwm_fan_max_state] when cooling-levels
exist, falling back to MAX_PWM if not. Use a named constant (e.g.
PWM_FAN_BOOT_DUTY) only as a fallback default if you must hardcode, and add a
brief comment explaining the chosen default and why it’s safe for all boards;
update the call to set_pwm(ctx, boot_pwm) and ensure the DT read/validation
logic is placed near the top of pwm_fan_probe.
patch/kernel/archive/sm8550-6.18/0053-edt-ft5x06-add-no_regmap_bulk_read-option.patch (1)

40-48: Return immediately on non-transient read errors.

This currently retries every regmap_read() failure, even though only -ETIMEDOUT and -EAGAIN get backoff. In the IRQ data path, permanent errors should fail fast to avoid extra I2C traffic and latency.

Proposed adjustment
 		for (tries = 0; tries < 3; tries++) {
 			ret = regmap_read(map, start + off, &v);
 			if (!ret) {
 				dst[off] = (u8)v;
 				break;
 			}
-			if (ret == -ETIMEDOUT || ret == -EAGAIN)
-				usleep_range(2000, 4000);
+			if (ret != -ETIMEDOUT && ret != -EAGAIN)
+				return ret;
+
+			usleep_range(2000, 4000);
 		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@patch/kernel/archive/sm8550-6.18/0053-edt-ft5x06-add-no_regmap_bulk_read-option.patch`
around lines 40 - 48, The loop that calls regmap_read (using variables map,
start, off, dst, ret) currently retries on every error; change it to return
immediately for non-transient errors by checking if ret is not -ETIMEDOUT and
not -EAGAIN and then propagate that error (do not retry or sleep). Only
loop/retry when ret is -ETIMEDOUT or -EAGAIN (sleep with usleep_range(2000,
4000) and continue), and on success write dst[off] = (u8)v and break/return
success; ensure the function returns the regmap_read error code for permanent
failures so the IRQ path fails fast.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@patch/kernel/archive/sm8550-6.18/0053-battery-name.patch`:
- Around line 17-19: The patch accidentally adds a backup file
drivers/power/supply/qcom_battmgr.c.orig and its diffstat entry; remove that
added file section and its diffstat line from the patch so only the intended
change to drivers/power/supply/qcom_battmgr.c remains. Locate the diff header
and added-file hunk for drivers/power/supply/qcom_battmgr.c.orig in the patch
and delete the entire hunk (all lines from the file header for
qcom_battmgr.c.orig through its end) and remove the corresponding
"drivers/power/supply/qcom_battmgr.c.orig |" stat entry so the patch only
contains changes to drivers/power/supply/qcom_battmgr.c. Ensure the resulting
patch applies cleanly and does not reference the .orig filename anywhere.

In
`@patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch`:
- Around line 64-66: The patch adds qcs8550-ayaneo-pocketdmg.dts but forgot to
add the DTB to the QCOM Makefile; update the QCOM DTB build list by adding the
line "dtb-$(CONFIG_ARCH_QCOM) += qcs8550-ayaneo-pocketdmg.dtb" into the
arch/arm64/boot/dts/qcom/Makefile (or the Makefile.orig change used by companion
patches), placing it with the other dtb-$(CONFIG_ARCH_QCOM) entries and ensuring
no duplicate entries exist so the qcs8550-ayaneo-pocketdmg.dtb will be built.

In `@patch/kernel/archive/sm8550-6.18/0500-ROCKNIX-set-boot-fanspeed.patch`:
- Around line 39-44: The patch accidentally includes a 747-line backup file
drivers/hwmon/pwm-fan.c.orig that duplicates the upstream driver; remove this
file from the patch and regenerate the patch so only the intended one-line
change in drivers/hwmon/pwm-fan.c remains. Specifically, drop the new-file hunk
that adds drivers/hwmon/pwm-fan.c.orig and ensure the final patch contains only
the modification to pwm-fan.c (the single-line change that sets boot fan speed,
e.g., the edit around set_pwm()/initial_pwm usage) so no .orig artifact is
committed.

---

Outside diff comments:
In `@patch/kernel/archive/sm8550-6.18/0030-input-rmi4-add-reset-gpio.patch`:
- Around line 86-94: The reset sequence currently drives rmi_i2c->reset_gpio low
then high and leaves the controller asserted for active-low GPIOs; change the
sequence in the probe path to assert the reset briefly then release it so the
chip is released for probing: use gpiod_set_value_cansleep(rmi_i2c->reset_gpio,
1) to assert, usleep_range(10000,20000) for the pulse, then
gpiod_set_value_cansleep(rmi_i2c->reset_gpio, 0) to release and finally
msleep(rmi_i2c->reset_delay ?: DEFAULT_RESET_DELAY_MS); keep references to
rmi_i2c->reset_gpio, rmi_i2c->reset_delay, gpiod_set_value_cansleep and
DEFAULT_RESET_DELAY_MS to locate and update the code.

In
`@patch/kernel/archive/sm8550-6.18/0031_input--Add-driver-for-RSInput-Gamepad.patch`:
- Around line 183-204: handle_cmd_commod reads data[FRAME_POS_DATA_1] without
confirming payload contains that index (and handle_cmd_status accepts
payload_length >= 6 but later reads up to FRAME_POS_DATA_14), so add explicit
minimum-length checks using payload_length before any fixed-offset access: in
handle_cmd_commod verify payload_length > FRAME_POS_DATA_1 (or >= required bytes
for the subcommand and version string) before reading data[FRAME_POS_DATA_1] or
copying the version, and in handle_cmd_status require payload_length >
FRAME_POS_DATA_14 (or set the correct minimum bytes) before accessing up to
FRAME_POS_DATA_14; return or log an error (dev_err) on insufficient length and
avoid any out-of-bounds reads.
- Around line 415-473: After serdev_device_open succeeds, ensure the UART is
closed on any subsequent probe failure: add serdev_device_close(serdev) before
each early return that can occur after serdev_device_open (specifically error
paths after serdev_device_set_baudrate,
serdev_device_set_flow_control/devm_input_allocate_device failure,
input_register_device failure, and any other post-open errors) so that resources
opened by serdev_device_open are always unwound; keep
serdev_device_set_drvdata(serdev, drv) and the successful path unchanged and
only insert serdev_device_close(serdev) immediately before returning on those
error branches (also preserve the existing serdev_device_close call in the
rsinput_init_commands failure path).
- Around line 260-270: The code currently uses scale_trigger_signed_range()
which maps raw trigger values to a signed -32768..32767 range, but ABS_Z/ABS_RZ
are advertised as 0..1830; convert the clamped raw values (raw_l_clamped,
raw_r_clamped) into the device's advertised unsigned ABS range before calling
input_report_abs. Replace or wrap scale_trigger_signed_range(raw_...,
GAMEPAD_RAW_TRIGGER_MIN, GAMEPAD_RAW_TRIGGER_MAX) with a scaling function that
outputs 0..ADVERTISED_MAX (e.g., GAMEPAD_ABS_TRIGGER_MAX or 1830) or map the
signed result to unsigned by linear transformation, then call
input_report_abs(drv->input, ABS_Z, scaled_unsigned_z) and
input_report_abs(drv->input, ABS_RZ, scaled_unsigned_rz) so reported values stay
within the advertised 0..1830 range.
- Around line 478-482: The rsinput_remove function currently calls
input_unregister_device(drv->input) but drv->input was allocated with
devm_input_allocate_device(), so remove the manual input_unregister_device call
from rsinput_remove; keep the serdev_device_close(serdev) call and leave device
cleanup to the devm-managed lifecycle (references: rsinput_remove,
rsinput_driver, serdev_device_close, input_unregister_device,
devm_input_allocate_device).
- Around line 127-153: rsinput_send_command builds a framed packet into a fixed
256-byte buffer but lacks bounds checks and proper write handling; update
rsinput_send_command to (1) validate len against the remaining room (ensure
frame_len + len + 1 /*checksum*/ <= sizeof(frame)) and return -EINVAL on
overflow, (2) compute the checksum over the frame bytes before appending the
checksum (use compute_checksum(frame, frame_len) rather than frame_len + 1), and
(3) ensure the full frame is written by checking serdev_device_write_buf's
return and looping/accumulating writes until total == frame_len (or return an
appropriate -EIO/-EAGAIN on partial/fatal write failures) instead of treating a
short write as success; reference symbols: rsinput_send_command,
compute_checksum, serdev_device_write_buf, drv->sequence_number, frame
(uint8_t[256]).
- Around line 326-356: rsinput_rx currently overwrites drv->rx_buf and validates
whole callback as a single frame (MCU_PKT_SIZE_MIN check, compute_checksum
comparison, and rsinput_init_commands on failure); instead, change rsinput_rx to
append incoming bytes to a persistent buffer position (do not memcpy over the
whole drv->rx_buf), remove the MCU_PKT_SIZE_MIN check, remove checksum
validation and the rsinput_init_commands() call from this callback, and simply
call rsinput_process_data(drv, drv->rx_buf, current_length) so
rsinput_process_data can handle framing, partial frames and multi-frame
callbacks; ensure you adjust/guard the append logic to prevent buffer overflow
rather than rejecting any chunk larger than sizeof(drv->rx_buf).

In
`@patch/kernel/archive/sm8550-6.18/0033_leds--Add-driver-for-HEROIC-HTR3212.patch`:
- Line 368: The MODULE_AUTHOR metadata string is malformed (missing the closing
'>' in the email) causing incorrect modinfo output; update the MODULE_AUTHOR
invocation (the MODULE_AUTHOR("Teguh Sobirin <teguh@sobir.in"); line) to include
the closing '>' so the email is correctly formatted, e.g. change the argument to
"Teguh Sobirin <teguh@sobir.in>".
- Around line 297-322: After enabling vdd and asserting sdb, ensure probe
failure paths clean up power/GPIO before returning: after calling
regulator_enable(priv->vdd) and gpiod_set_value_cansleep(priv->sdb, 1), every
error return (e.g., after devm_regmap_init_i2c -> IS_ERR(priv->regmap), after
htr3212_init_regs, and after htr3212_parse_dt) must first deassert the sdb GPIO
(gpiod_set_value_cansleep(priv->sdb, 0)) and disable the regulator
(regulator_disable(priv->vdd)) or call the existing removal helper
(htr3212_remove or equivalent) so vdd is turned off and sdb is released before
returning the error.
- Around line 60-69: The patch is missing the regulator consumer header required
for struct regulator and the APIs devm_regulator_get(), regulator_enable(), and
regulator_disable(); add the appropriate include (<linux/regulator/consumer.h>)
to the top-of-file includes so the driver compiles—specifically ensure the
header is present alongside existing includes (near the block with
<linux/regmap.h>) so references to struct regulator, devm_regulator_get,
regulator_enable, and regulator_disable resolve.
- Around line 202-203: The code reads the "always-on" property from the parent
device (dev) instead of the LED child node, so per-LED settings are ignored;
change the device_property_read_bool call to read from the child node (use child
as the first argument) so the check for "always-on" uses the per-LED device node
and then conditionally sets cdev->flags |= LED_CORE_SUSPENDRESUME as before.
- Around line 287-289: The code only checks for PTR_ERR(priv->sdb) ==
-EPROBE_DEFER after calling devm_gpiod_get, leaving other error pointers in
priv->sdb that later get passed to gpiod_set_value_cansleep; change the check to
use IS_ERR(priv->sdb) and handle errors consistently (propagate probe-defer with
dev_err_probe for -EPROBE_DEFER and log/return other errors) similar to how
devm_regulator_get is validated so priv->sdb is never an error pointer when used
by gpiod_set_value_cansleep.
- Around line 278-283: The probe currently counts DT children with
of_get_available_child_count and allocates with struct_size for a fixed-size
array, allowing num_leds to exceed the defined HTR3212_CHANNELS and cause
out-of-bounds access on priv->leds; fix by bounding the counted children to
HTR3212_CHANNELS (e.g., num = min(count, HTR3212_CHANNELS)) before any indexing,
allocate priv using sizeof(*priv) (since leds is a fixed-size array) via
devm_kzalloc, and use priv->num_leds = bounded_value so subsequent accesses and
duplicate checks cannot index past the fixed leds array.

In
`@patch/kernel/archive/sm8550-6.18/0036_ASoC--qcom--sc8280xp-Add-support-for-Primary-I2S.patch`:
- Around line 35-55: sc8280xp_snd_startup currently ignores return values from
clk_prepare_enable and snd_soc_dai_set_fmt and can leak pdata->i2s_clk if
qcom_snd_sdw_startup fails; update sc8280xp_snd_startup to check and handle
errors from clk_prepare_enable and both snd_soc_dai_set_fmt calls, and if
qcom_snd_sdw_startup returns an error, ensure you undo the earlier
clk_prepare_enable by calling clk_disable_unprepare(pdata->i2s_clk) (and avoid
calling set_fmt on codec/cpu if clk_prepare_enable fails), returning the
appropriate error code from sc8280xp_snd_startup.

In
`@patch/kernel/archive/sm8550-6.18/0047_ASoC--codecs--aw88166--AYN-Odin2-Specific-modifica.patch`:
- Around line 47-59: The loop reads 16-bit words from the byte buffer `data`
unsafely via `cpu_to_be16p((u16 *)(data + i))` and can read past the end if
`len` is odd; to fix, validate `len` (ensure it's even or handle a trailing
byte) before the loop, replace the unaligned dereference with
`get_unaligned_be16(data + i)` when writing to `AW88166_DSPMDAT_REG` via
`regmap_write`, and add `#include <linux/unaligned.h>` to the file; keep the
existing mutex (`aw_dev->dsp_lock`) and error handling around `regmap_write` and
the initial `AW88166_DSPMADD_REG` write.

In
`@patch/kernel/archive/sm8550-6.18/0051-gpu-panel-add-Pocket-ACE-panel-driver.patch`:
- Around line 50-53: The patch contains generator placeholders: replace the
placeholder copyright and author info at the top comment (the "Copyright (c)
2025 FIXME" and the generator attribution lines) and the
MODULE_AUTHOR("linux-mdss-dsi-panel-driver-generator <fix@me>"); // FIXME with
real values: put the correct copyright holder(s) and year(s) in the header
comment, and set MODULE_AUTHOR to a real name and contact (or an appropriate
organization email) without FIXME; ensure the SPDX stays valid (GPL-2.0-only)
and that no "<fix@me>" or "FIXME" tokens remain anywhere in the file.

In
`@patch/kernel/archive/sm8550-6.18/0053-edt-ft5x06-add-no_regmap_bulk_read-option.patch`:
- Around line 82-83: The driver now reads the boolean property
no-regmap-bulk-read into tsdata->no_regmap_bulk_read (via
device_property_read_bool(&client->dev, "no-regmap-bulk-read")), so update the
edt-ft5x06 device-tree binding to document this property: add a new top-level
property entry named "no-regmap-bulk-read" with type "boolean" and a short
description (e.g., "Set to true to disable regmap bulk read for this touch
controller"), include any relevant status/usage notes and an example in the
binding YAML so dtbs_check will accept device trees that use this property.

In `@patch/kernel/archive/sm8550-6.18/0056_Xm-Plus-XM91080G-panel.patch`:
- Line 74: The patch introduces mixed space/tab indentation (kernel expects
tabs) in several places; replace the 4-space indents with tabs so checkpatch
doesn’t fail. Specifically, fix indentation for the declaration "enum
drm_panel_orientation orientation;", the regulator enable/disable blocks that
call "regulator_bulk_enable" and "regulator_bulk_disable", the reset/disable
statements in the error path, the "unprepare" function's regulator_bulk_disable
call, the ".get_orientation" entry in the "panel_funcs" table, and the block
that calls "of_drm_get_panel_orientation" so all these lines use tabs instead of
spaces.
- Around line 52-56: Add a single-line SPDX identifier as the very first line of
the new source file (for example "SPDX-License-Identifier: GPL-2.0-only") and
move the existing comment block (the "Xm-Plus XM91080G Driver IC panels driver"
copyright by Teguh Sobirin) below that SPDX line so the file begins with the
SPDX header; ensure this SPDX choice matches the MODULE_LICENSE("GPL") used
later in the file.

In `@patch/kernel/archive/sm8550-6.18/0057_Chipone-ICNA35XX-panel.patch`:
- Around line 480-486: The code clears dsi->mode_flags &= ~MIPI_DSI_MODE_LPM
before calling mipi_dsi_dcs_set_display_brightness_large but returns immediately
on error, leaving the flag cleared; ensure you restore dsi->mode_flags |=
MIPI_DSI_MODE_LPM before any early return on error (i.e., after checking ret <
0) so both the success and failure paths re-enable MIPI_DSI_MODE_LPM; apply the
same change to the other occurrence around lines handling
mipi_dsi_dcs_set_display_brightness_large (the second block using variables dsi,
brightness, and ret).
- Around line 118-128: The function icna35xx_get_current_mode dereferences
pinfo->connector too early; add a guard at the top to return 0 if
pinfo->connector is NULL (and keep the existing checks for connector->state and
connector->state->crtc), so the function returns the default mode when connector
info isn't populated yet instead of oopsing; update the null-check sequence in
icna35xx_get_current_mode to check pinfo->connector before accessing
connector->state (and apply the same guard pattern where connector is
dereferenced elsewhere, e.g., in icna35xx_get_modes-related code).
- Around line 584-586: The driver adds two new compatibles referenced by
icna35xx_of_match (chipone,icna3512 and chipone,icna3520) but you must add a
device-tree binding YAML at
Documentation/devicetree/bindings/display/panel/chipone,icna35xx.yaml; create
that file and document the compatible strings, required properties the driver
expects (e.g., preferred-mode, reset-gpios, power-supplies or vcc/avdd rails if
used, reg or i2c address if applicable, interrupt/gpios, backlight phandle if
supported), types, example fragments, and any optional properties so dtbs_check
passes; ensure the YAML matches the driver’s property names and constraints
(refer to icna35xx_of_match, icna3512_desc, icna3520_desc) and run dtbs_check to
validate.

In `@patch/kernel/archive/sm8550-6.18/0062_rsinput--regulator.patch`:
- Around line 44-60: The GPIO reset sequencing and msleep calls must be removed
from rsinput_init_commands() because that function is invoked from the RX
checksum-error path; instead move the GPIO/regulator initialization and the
boot/reset/enable toggling (the sequences touching drv->boot_gpio,
drv->reset_gpio, drv->enable_gpio and the msleep delays) into the driver's probe
routine or into a dedicated deferred recovery work (workqueue or delayed_work)
that can be scheduled from error paths; update rsinput_init_commands() to only
perform protocol/init commands (no gpiod_set_value_cansleep or msleep), and
implement a new helper (e.g., rsinput_hw_init or rsinput_recover_work) that
encapsulates the GPIO toggles and sleeps, invoked from probe or queued from the
checksum-error handler instead of running inline.
- Around line 67-76: The probe currently enables drv->vdd via regulator_enable()
but does not register a devm cleanup so failures after enabling leave the rail
on; change rsinput_probe to call devm_add_action_or_reset(&serdev->dev,
regulator_disable_action, drv->vdd) (or equivalent wrapper that calls
regulator_disable) immediately after successful regulator_enable(), so the
regulator is automatically disabled on probe failure, and remove the manual
regulator_disable in rsinput_remove() since devm will handle it; ensure error
handling still returns PTR_ERR(drv->vdd) when devm_regulator_get() fails and
keep regulator_enable() error returns as before.

In `@patch/kernel/archive/sm8550-6.18/0071-HACK-fix-usb-boot-hang.patch`:
- Around line 29-44: The change removed the unconditional wait for XHCI_STS_CNR
in quirk_usb_handoff_xhci(), which can affect all PCI xHCI controllers; restore
a platform/device-specific guard so the bypass runs only for the affected SM8550
controller: detect the target controller inside quirk_usb_handoff_xhci() (e.g.,
check PCI vendor/device IDs via pdev with pci_get_vendor()/pci_get_device() or
match the SoC/platform using existing platform/device identifiers or
of_match_node()), and only skip the handshake(op_reg_base + XHCI_STS_OFFSET,
XHCI_STS_CNR, ...) call when the check confirms the affected device; otherwise
retain the original timeout handshake and the dev_warn path that reads
XHCI_STS_OFFSET and logs via pdev to preserve behavior for other controllers.

In
`@patch/kernel/archive/sm8550-6.18/0200_arm64--dts--qcom--Add-AYN-QCS8550-Common.patch`:
- Around line 22-24: The common DTSI references KEY_VOLUMEUP (used in that file
around the key definitions) but does not include the input bindings header; add
the missing include for <dt-bindings/input/input.h> to the header list in the
common DTSI (alongside the existing includes like <dt-bindings/leds/common.h>
and <dt-bindings/regulator/qcom,rpmh-regulator.h> and the "qcs8550.dtsi"
include) so that the KEY_VOLUMEUP macro is defined during DTS preprocessing.

In
`@patch/kernel/archive/sm8550-6.18/0203_arm64--dts--qcom--Add-AYN-Odin2-Portal.patch`:
- Around line 214-219: The touchscreen node under &i2c4 (touchscreen@38,
compatible = "focaltech,ft5426") incorrectly declares bus address properties
(`#address-cells` and `#size-cells`) which are not allowed by the edt-ft5x06
FocalTech binding and will fail dtbs_check; remove the two lines setting
`#address-cells` and `#size-cells` from the touchscreen@38 node so it becomes a
simple device node with only compatible and reg (and any other valid properties)
and validate the DT with dtbs_check.

In `@patch/kernel/archive/sm8550-6.18/0204_arm64--dts--qcom--Add-AYN-Thor.patch`:
- Around line 279-284: Remove the invalid `#address-cells` and `#size-cells`
properties from the FocalTech touchscreen device nodes (e.g., the &i2c4
touchscreen@38 node and the other touchscreen@... FocalTech node referenced
later) because these are leaf devices and the edt-ft5x06 binding does not define
them; edit the device tree node definitions (touchscreen@38 and the other
focaltech touchscreen node) to delete the lines setting `#address-cells` and
`#size-cells` so the DTB will pass dtbs_check.

In
`@patch/kernel/archive/sm8550-6.18/0210_arm64--dts--qcom--Add-AYANEO-Pocket-Common.patch`:
- Around line 255-299: The cpuss1 thermal trip cpuss1_fan1 in the cpuss1-thermal
node has a typo ("ype" instead of "type") so the trip lacks a valid type; fix it
by changing the property name from ype to type for the cpuss1_fan1 trip-point
(search for cpuss1_fan1 inside cpuss1-thermal) so the entry reads type =
"active" like the other trip definitions.
- Around line 500-513: The pwm_fan node declares pinctrl-names = "default",
"sleep" but only defines pinctrl-0, which violates the device-tree convention;
either remove "sleep" from pinctrl-names or add a matching pinctrl-1 property.
Fix by editing the pwm_fan node: if no sleep pin configuration is needed, remove
"sleep" from pinctrl-names, otherwise add pinctrl-1 = <&fan_pwm_active>,
<&fan_int> (or the correct sleep phandle(s)) and ensure the referenced
phandle(s) (e.g., fan_pwm_active, fan_int) represent the intended sleep state.
- Around line 1149-1155: The pinctrl node fan_int / fan-int-state sets an
invalid pinconf property `bias-pull-pull`; replace it with the correct bias for
a falling-edge interrupt by changing that token to `bias-pull-up` so the pin
(gpio64) is pulled high by default; ensure other properties (pins = "gpio64",
function = "gpio", drive-strength = <2>, input-enable) remain unchanged.
- Around line 1065-1079: Replace the nonstandard property in the &sdhc_2 node:
change the sdhci-msm property name max-sd-hs-hz to the upstream-supported
max-frequency so the controller binding accepts the setting; update the
declaration in the &sdhc_2 node (where max-sd-hs-hz is set) and make the
identical change in the similar node in patch
0200_arm64--dts--qcom--Add-AYN-QCS8550-Common.patch to keep both patches
consistent.

In
`@patch/kernel/archive/sm8550-6.18/0211_arm64--dts--qcom--Add-AYANEO-Pocket-ACE.patch`:
- Around line 72-749: The patch writes changes to .orig backup files instead of
real sources so the new qcs8550-ayaneo-pocketace.dts never gets built and
critical sm8550 changes are lost/duplicated; update the patch to modify the real
files (remove the .orig suffixes) so the new qcs8550-ayaneo-pocketace.dts is
added to the real arch/arm64/boot/dts/qcom/Makefile (add the DTB target for
qcs8550-ayaneo-pocketace), restore/ensure the sm8550.dtsi edits
(capacity-dmips-mhz and dynamic-power-coefficient values, the GPU power-domains
block) are applied to the actual sm8550.dtsi, and remove the duplicate UART15
(serial@89c000 / uart15) and DDIC panel additions (DRM_PANEL_DDIC_CH13726A and
obj- line) from this patch so those changes remain only in their correct
patches.

In `@patch/kernel/archive/sm8550-6.18/0501-ROCKNIX-fix-wifi-and-bt-mac.patch`:
- Around line 99-100: The change added __maybe_unused to qca_check_bdaddr, but
qca_uart_setup currently returns early when qcom_serial_number is absent which
prevents falling back to qca_check_bdaddr and NVM-derived BDADDR; modify
qca_uart_setup to not fail/return when serial is missing (qcom_serial_number ==
0 or NULL) and instead continue to call qca_check_bdaddr() so boards without
socinfo or with late/short serial can use the NVM fallback; ensure you reference
qcom_serial_number handling in qca_uart_setup and keep qca_check_bdaddr (now
__maybe_unused) reachable as the fallback path.
- Around line 255-267: The generated MAC path currently writes the same base MAC
into ar->mac_addr via ath12k_reverse_mac(generated_macaddr.b) causing duplicates
across pdevs; update the serial-success branch (generate_macaddr_from_serial
return==0) to preserve per-pdev uniqueness by applying the same pdev offset as
the fallback: after calling ath12k_reverse_mac(ar->mac_addr,
generated_macaddr.b) increment ar->mac_addr[4] (or otherwise offset the MAC) by
ar->pdev_idx (matching the fallback logic that uses ar->pdev_idx), and keep the
existing log line ath12k_info(ab, "MAC_ADDR set to %pMR", generated_macaddr.b).
Ensure you still respect ar->ab->pdevs_macaddr_valid and ether_addr_copy usage
in the error path.
- Line 20: The patch exposes an unguarded extern qcom_serial_number and causes
build failures when BT_QCA or ATH12K are enabled on non-Qualcomm platforms;
either add Kconfig constraints so BT_QCA and ATH12K depend on QCOM_SOCINFO
(ensuring socinfo.c and qcom_serial_number are present) or add safe fallbacks:
remove the unguarded extern in btqca.c and ath12k/mac.c and instead reference
qcom_serial_number through an `#ifdef` CONFIG_QCOM_SOCINFO guard or a weak stub
accessor in socinfo.c (e.g., a qcom_serial_number_get() that returns NULL when
CONFIG_QCOM_SOCINFO is unset), and update Kconfig entries for BT_QCA and ATH12K
to depend on QCOM_SOCINFO if you choose the Kconfig route.

In
`@patch/kernel/archive/sm8550-6.18/9999-allow-aarch64-to-perform-32bit-syscalls.patch`:
- Around line 45-52: The compat path in input_ff_effect_from_user was
incorrectly gated by COMPAT_USE_64BIT_TIME; change the conditional to check for
the actual compat invocation (use if (current->compat_input ||
in_compat_syscall())) so ff_effect_compat handling is used for pointer/struct
layout conversion regardless of 64-bit time support—update the conditional in
input_ff_effect_from_user to remove the COMPAT_USE_64BIT_TIME check and rely on
current->compat_input or in_compat_syscall() so 32-bit force-feedback ioctls
work on architectures like aarch64.

---

Nitpick comments:
In
`@patch/kernel/archive/sm8550-6.18/0053-edt-ft5x06-add-no_regmap_bulk_read-option.patch`:
- Around line 40-48: The loop that calls regmap_read (using variables map,
start, off, dst, ret) currently retries on every error; change it to return
immediately for non-transient errors by checking if ret is not -ETIMEDOUT and
not -EAGAIN and then propagate that error (do not retry or sleep). Only
loop/retry when ret is -ETIMEDOUT or -EAGAIN (sleep with usleep_range(2000,
4000) and continue), and on success write dst[off] = (u8)v and break/return
success; ensure the function returns the regmap_read error code for permanent
failures so the IRQ path fails fast.

In `@patch/kernel/archive/sm8550-6.18/0500-ROCKNIX-set-boot-fanspeed.patch`:
- Around line 30-38: Replace the hardcoded 70 in pwm_fan_probe when calling
set_pwm with a configurable value: read a DT property (e.g. "fan-boot-pwm") into
a local boot_pwm and if present use that; otherwise preserve the original
behavior by using ctx->pwm_fan_cooling_levels[ctx->pwm_fan_max_state] when
cooling-levels exist, falling back to MAX_PWM if not. Use a named constant (e.g.
PWM_FAN_BOOT_DUTY) only as a fallback default if you must hardcode, and add a
brief comment explaining the chosen default and why it’s safe for all boards;
update the call to set_pwm(ctx, boot_pwm) and ensure the DT read/validation
logic is placed near the top of pwm_fan_probe.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8e2f5b87-f6e7-45d2-a2f6-32ef9a6b0a3d

📥 Commits

Reviewing files that changed from the base of the PR and between 3697435 and 4ce477a.

📒 Files selected for processing (57)
  • config/boards/ayn-odin2.csc
  • config/kernel/linux-sm8550-edge.config
  • patch/kernel/archive/sm8550-6.18/0001-msm-adreno-enable-A32.patch
  • patch/kernel/archive/sm8550-6.18/0002-qcom-dispcc-sm8550-Fix-disp_cc_mdss_mdp_clk_src.patch
  • patch/kernel/archive/sm8550-6.18/0030-input-rmi4-add-reset-gpio.patch
  • patch/kernel/archive/sm8550-6.18/0031_input--Add-driver-for-RSInput-Gamepad.patch
  • patch/kernel/archive/sm8550-6.18/0033_leds--Add-driver-for-HEROIC-HTR3212.patch
  • patch/kernel/archive/sm8550-6.18/0036_ASoC--qcom--sc8280xp-Add-support-for-Primary-I2S.patch
  • patch/kernel/archive/sm8550-6.18/0042_mmc--sdhci-msm--Toggle-the-FIFO-write-clock-after-.patch
  • patch/kernel/archive/sm8550-6.18/0047_ASoC--codecs--aw88166--AYN-Odin2-Specific-modifica.patch
  • patch/kernel/archive/sm8550-6.18/0050_pmk8550-pwm.patch
  • patch/kernel/archive/sm8550-6.18/0051-gpu-panel-add-Pocket-ACE-panel-driver.patch
  • patch/kernel/archive/sm8550-6.18/0052-gpu-panel-add-Pocket-DMG-panel-driver.patch
  • patch/kernel/archive/sm8550-6.18/0052_qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0053-add-hynitron-touchscreen.patch
  • patch/kernel/archive/sm8550-6.18/0053-battery-name.patch
  • patch/kernel/archive/sm8550-6.18/0053-edt-ft5x06-add-no_regmap_bulk_read-option.patch
  • patch/kernel/archive/sm8550-6.18/0053-gpu-panel-add-Pocket-DS-lower-panel-driver.patch
  • patch/kernel/archive/sm8550-6.18/0054_sn3112-pwm-driver.patch
  • patch/kernel/archive/sm8550-6.18/0055_Synaptics-TD4328-LCD-panel.patch
  • patch/kernel/archive/sm8550-6.18/0056_Xm-Plus-XM91080G-panel.patch
  • patch/kernel/archive/sm8550-6.18/0057_Chipone-ICNA35XX-panel.patch
  • patch/kernel/archive/sm8550-6.18/0057_DDIC-CH13726A-panel.patch
  • patch/kernel/archive/sm8550-6.18/0058_AYN-Odin2-Mini--backlight.patch
  • patch/kernel/archive/sm8550-6.18/0059_AYN-Odin2-Mini--hynitron--cstxxx.patch
  • patch/kernel/archive/sm8550-6.18/0060-Add-Silergy-SY7758-backlight-driver.patch
  • patch/kernel/archive/sm8550-6.18/0061-regulator-add-sgm3804-i2c-regulator-for-panel-power-.patch
  • patch/kernel/archive/sm8550-6.18/0062_rsinput--regulator.patch
  • patch/kernel/archive/sm8550-6.18/0070-drm-msm-remove-DRIVER_SYNCOBJ_TIMELINE.patch
  • patch/kernel/archive/sm8550-6.18/0071-HACK-fix-usb-boot-hang.patch
  • patch/kernel/archive/sm8550-6.18/0100-SM8550-Fix-L2-cache-for-CPU2-and-add-cache-sizes.patch
  • patch/kernel/archive/sm8550-6.18/0101-SM8550-Add-DDR-LLCC-L3-CPU-bandwidth-scaling.patch
  • patch/kernel/archive/sm8550-6.18/0102-20240424_wuxilin123_ayn_odin_2_support.patch
  • patch/kernel/archive/sm8550-6.18/0103_arm64--dts--qcom--sm8550--add-UART15.patch
  • patch/kernel/archive/sm8550-6.18/0104-drm-panel-Add-Retroid-Pocket-6-panel.patch
  • patch/kernel/archive/sm8550-6.18/0120-20250728_konradybcio_gpu_cc_power_requirements_reality_check.patch
  • patch/kernel/archive/sm8550-6.18/0122-interconnect__qcom__sm8550__Enable_QoS_configuration.patch
  • patch/kernel/archive/sm8550-6.18/0154-dts-qcom-sm8550-add-opp-acd-level.patch
  • patch/kernel/archive/sm8550-6.18/0200_arm64--dts--qcom--Add-AYN-QCS8550-Common.patch
  • patch/kernel/archive/sm8550-6.18/0201_arm64--dts--qcom--Add-AYN-Odin2.patch
  • patch/kernel/archive/sm8550-6.18/0202_arm64--dts--qcom--Add-AYN-Odin2-Mini.patch
  • patch/kernel/archive/sm8550-6.18/0203_arm64--dts--qcom--Add-AYN-Odin2-Portal.patch
  • patch/kernel/archive/sm8550-6.18/0204_arm64--dts--qcom--Add-AYN-Thor.patch
  • patch/kernel/archive/sm8550-6.18/0210_arm64--dts--qcom--Add-AYANEO-Pocket-Common.patch
  • patch/kernel/archive/sm8550-6.18/0211_arm64--dts--qcom--Add-AYANEO-Pocket-ACE.patch
  • patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch
  • patch/kernel/archive/sm8550-6.18/0213_arm64--dts--qcom--Add-AYANEO-Pocket-EVO.patch
  • patch/kernel/archive/sm8550-6.18/0214_arm64--dts--qcom--Add-AYANEO-Pocket-DS.patch
  • patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
  • patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch
  • patch/kernel/archive/sm8550-6.18/0500-ROCKNIX-set-boot-fanspeed.patch
  • patch/kernel/archive/sm8550-6.18/0501-ROCKNIX-fix-wifi-and-bt-mac.patch
  • patch/kernel/archive/sm8550-6.18/0503-ROCKNIX-battery-name.patch
  • patch/kernel/archive/sm8550-6.18/9999-allow-aarch64-to-perform-32bit-syscalls.patch
  • patch/kernel/archive/sm8550-6.18/v2_20260314_vladimir_zapolskiy_arm64_dts_qcom_sm8x50_enable_uhs_i_sdr50_and_sdr104_sd_card_modes.patch
  • patch/kernel/archive/sm8550-6.18/v5_20251120_quic_utiwari_crypto_qce_add_runtime_pm_and_interconnect_bandwidth_scaling_support.patch
💤 Files with no reviewable changes (4)
  • config/kernel/linux-sm8550-edge.config
  • patch/kernel/archive/sm8550-6.18/0215-drivers-mmc-Added-qcom-downstream-sdhci-driver.patch
  • patch/kernel/archive/sm8550-6.18/0216-Revert-clk-qcom-gcc-sm8550-Use-floor-ops-for-SDCC-RC.patch
  • patch/kernel/archive/sm8550-6.18/0217-arm64-dts-Switch-to-downstream-sdhc-driver-for-Odin2.patch

Comment on lines +17 to +19
drivers/power/supply/qcom_battmgr.c | 4 +-
drivers/power/supply/qcom_battmgr.c.orig | 1743 ++++++++++
2 files changed, 1745 insertions(+), 2 deletions(-)
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.

⚠️ Potential issue | 🟠 Major

Drop the accidental .orig file from the kernel patch.

This patch will create drivers/power/supply/qcom_battmgr.c.orig in the patched kernel source. That looks like a backup artifact and should be removed from the patch, along with its diffstat entry, before merge.

🧹 Proposed patch cleanup
- drivers/power/supply/qcom_battmgr.c      |    4 +-
- drivers/power/supply/qcom_battmgr.c.orig | 1743 ++++++++++
- 2 files changed, 1745 insertions(+), 2 deletions(-)
+ drivers/power/supply/qcom_battmgr.c      |    4 +-
+ 1 file changed, 2 insertions(+), 2 deletions(-)

Also remove the entire section starting at:

-diff --git a/drivers/power/supply/qcom_battmgr.c.orig b/drivers/power/supply/qcom_battmgr.c.orig
-new file mode 100644

through the end of the added .orig file hunk.

Based on learnings, only actual +/- patch lines represent changes; this .orig section is a real added file, not hunk context.

Also applies to: 43-1791

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sm8550-6.18/0053-battery-name.patch` around lines 17 -
19, The patch accidentally adds a backup file
drivers/power/supply/qcom_battmgr.c.orig and its diffstat entry; remove that
added file section and its diffstat line from the patch so only the intended
change to drivers/power/supply/qcom_battmgr.c remains. Locate the diff header
and added-file hunk for drivers/power/supply/qcom_battmgr.c.orig in the patch
and delete the entire hunk (all lines from the file header for
qcom_battmgr.c.orig through its end) and remove the corresponding
"drivers/power/supply/qcom_battmgr.c.orig |" stat entry so the patch only
contains changes to drivers/power/supply/qcom_battmgr.c. Ensure the resulting
patch applies cleanly and does not reference the .orig filename anywhere.

Comment on lines +64 to +66
---
arch/arm64/boot/dts/qcom/qcs8550-ayaneo-pocketdmg.dts | 111 ++++++++++
1 file changed, 111 insertions(+)
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'qcs8550-ayaneo-pocketdmg\.(dts|dtb)' -C2

Repository: armbian/build

Length of output: 1538


🏁 Script executed:

#!/bin/bash
# Check if the DTB target exists in the QCOM Makefile patch
grep -n "qcs8550-ayaneo-pocketdmg" patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch || echo "Not found in this patch"

# Check for Makefile-related hunks in this patch
echo "---"
echo "Checking for Makefile hunks in the patch:"
grep -E "^[\+\-].*Makefile|^diff.*Makefile" patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch || echo "No Makefile changes in this patch"

# Look for other QCS8550 board DTB entries in the actual kernel Makefile to understand the pattern
echo "---"
echo "Searching for QCS8550 DTB entries in kernel Makefile patterns:"
find . -name "Makefile" -path "*/dts/qcom/*" -exec grep -l "qcs8550\|QCS8550" {} \; 2>/dev/null | head -5

Repository: armbian/build

Length of output: 467


🏁 Script executed:

#!/bin/bash
# Check all patches in the same directory to see the pattern
echo "All patches in sm8550-6.18 directory:"
ls -1 patch/kernel/archive/sm8550-6.18/ | head -20

echo "---"
echo "Check if any other patch in this set modifies the QCOM DTB Makefile:"
grep -l "arch/arm64/boot/dts/qcom/Makefile" patch/kernel/archive/sm8550-6.18/*.patch | head -5

echo "---"
echo "Show sample of how other board DTS additions handle the DTB wiring:"
# Look at another patch that adds a .dts file to see if it adds a Makefile entry
for p in patch/kernel/archive/sm8550-6.18/*qcom*.patch; do
  if grep -q "^\+.*\.dts" "$p" && ! grep -q "Makefile" "$p"; then
    echo "Patch without Makefile: $(basename $p)"
  elif grep -q "^\+.*\.dts" "$p" && grep -q "Makefile" "$p"; then
    echo "Patch with Makefile: $(basename $p)"
    break
  fi
done

Repository: armbian/build

Length of output: 1791


🏁 Script executed:

#!/bin/bash
# Compare the structure: check what 0211 (Pocket-ACE) includes vs 0212 (Pocket-DMG)
echo "=== Patch 0211 (Pocket-ACE) - has Makefile ==="
grep -E "^diff|Makefile|\.dts" patch/kernel/archive/sm8550-6.18/0211_arm64--dts--qcom--Add-AYANEO-Pocket-ACE.patch | head -20

echo ""
echo "=== Patch 0212 (Pocket-DMG) - under review ==="
grep -E "^diff|Makefile|\.dts" patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch | head -20

echo ""
echo "=== Extract actual Makefile additions from 0211 ==="
sed -n '/arch\/arm64\/boot\/dts\/qcom\/Makefile/,/^diff/p' patch/kernel/archive/sm8550-6.18/0211_arm64--dts--qcom--Add-AYANEO-Pocket-ACE.patch | head -30

Repository: armbian/build

Length of output: 3066


🏁 Script executed:

#!/bin/bash
# Look for the actual DTB entry in the 0211 patch to understand the expected pattern
echo "=== Looking for qcs8550-ayaneo-pocketace dtb entry in Makefile.orig ==="
grep -A2 -B2 "qcs8550-ayaneo-pocketace" patch/kernel/archive/sm8550-6.18/0211_arm64--dts--qcom--Add-AYANEO-Pocket-ACE.patch

echo ""
echo "=== Checking if 0212 should have included a similar Makefile entry ==="
# Look at the actual patch content of 0212 to see complete file list
head -100 patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch

Repository: armbian/build

Length of output: 7443


🏁 Script executed:

#!/bin/bash
# Check if patch 0213 or 0214 (next patches) add the Makefile entry for 0212
echo "=== Check if any LATER patches add the missing DTB entry ==="
for p in patch/kernel/archive/sm8550-6.18/021{3,4}*.patch; do
  echo "File: $(basename $p)"
  if grep -q "qcs8550-ayaneo-pocketdmg" "$p"; then
    echo "  Contains reference to qcs8550-ayaneo-pocketdmg"
    grep -c "qcs8550-ayaneo-pocketdmg" "$p"
  else
    echo "  No reference to qcs8550-ayaneo-pocketdmg"
  fi
done

echo ""
echo "=== Look for Makefile entries added in later patches ==="
for p in patch/kernel/archive/sm8550-6.18/021{3,4}*.patch; do
  if grep -q "Makefile" "$p"; then
    echo "$(basename $p) modifies Makefile"
  fi
done

Repository: armbian/build

Length of output: 374


🏁 Script executed:

#!/bin/bash
# Final confirmation: extract the exact Makefile line that SHOULD be in patch 0212
echo "=== Show what the Makefile entry should look like (from patch 0211) ==="
sed -n '/dtb-\$(CONFIG_ARCH_QCOM).*pocketace/p' patch/kernel/archive/sm8550-6.18/0211_arm64--dts--qcom--Add-AYANEO-Pocket-ACE.patch

echo ""
echo "=== Confirm 0212 patch is complete and final ==="
tail -5 patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch

Repository: armbian/build

Length of output: 215


Add qcs8550-ayaneo-pocketdmg.dtb to the QCOM DTB build target.

This patch adds only the .dts file but lacks the corresponding Makefile entry. The companion patch 0211 (Pocket-ACE) includes arch/arm64/boot/dts/qcom/Makefile.orig modifications; this patch must do the same. Without a dtb-$(CONFIG_ARCH_QCOM) += qcs8550-ayaneo-pocketdmg.dtb entry, the board DTB will not be built.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@patch/kernel/archive/sm8550-6.18/0212_arm64--dts--qcom--Add-AYANEO-Pocket-DMG.patch`
around lines 64 - 66, The patch adds qcs8550-ayaneo-pocketdmg.dts but forgot to
add the DTB to the QCOM Makefile; update the QCOM DTB build list by adding the
line "dtb-$(CONFIG_ARCH_QCOM) += qcs8550-ayaneo-pocketdmg.dtb" into the
arch/arm64/boot/dts/qcom/Makefile (or the Makefile.orig change used by companion
patches), placing it with the other dtb-$(CONFIG_ARCH_QCOM) entries and ensuring
no duplicate entries exist so the qcs8550-ayaneo-pocketdmg.dtb will be built.

Comment on lines +39 to +44
diff --git a/drivers/hwmon/pwm-fan.c.orig b/drivers/hwmon/pwm-fan.c.orig
new file mode 100644
index 000000000000..111111111111
--- /dev/null
+++ b/drivers/hwmon/pwm-fan.c.orig
@@ -0,0 +1,747 @@
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.

⚠️ Potential issue | 🟠 Major

Drop the accidentally-committed drivers/hwmon/pwm-fan.c.orig backup file.

This new file is a 747-line verbatim copy of the pre-patch drivers/hwmon/pwm-fan.c (e.g., line 613 of the .orig still reads ret = set_pwm(ctx, initial_pwm);, i.e. the exact content your - line is removing from pwm-fan.c). That's the classic fingerprint of a .orig artifact left behind by the patch tool after a fuzzy apply — it shouldn't be shipped inside a kernel patch:

  • It's not referenced by any Makefile/Kconfig, so it's pure dead source duplicating an entire upstream driver (license/attribution noise, git-blame confusion, future merge conflicts whenever upstream pwm-fan.c evolves).
  • Depending on the out-of-tree build tooling, stray *.orig files under drivers/ can also trip checkpatch / packaging scripts.
  • The PR’s stated intent here is just "set boot fanspeed" — there is no reason to introduce a second copy of the driver.

Please regenerate this patch cleanly so it only contains the one-line change in drivers/hwmon/pwm-fan.c and drop the new file mode hunk for pwm-fan.c.orig entirely (lines 39–792 of this patch).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sm8550-6.18/0500-ROCKNIX-set-boot-fanspeed.patch` around
lines 39 - 44, The patch accidentally includes a 747-line backup file
drivers/hwmon/pwm-fan.c.orig that duplicates the upstream driver; remove this
file from the patch and regenerate the patch so only the intended one-line
change in drivers/hwmon/pwm-fan.c remains. Specifically, drop the new-file hunk
that adds drivers/hwmon/pwm-fan.c.orig and ensure the final patch contains only
the modification to pwm-fan.c (the single-line change that sets boot fan speed,
e.g., the edit around set_pwm()/initial_pwm usage) so no .orig artifact is
committed.

@kasimling kasimling marked this pull request as draft April 20, 2026 13:43
Signed-off-by: Alex Ling <ling_kasim@hotmail.com>
Signed-off-by: Alex Ling <ling_kasim@hotmail.com>
@kasimling kasimling force-pushed the odin2_fixes_sdhci_msm branch from 4ce477a to fae29b6 Compare April 20, 2026 14:06
@kasimling kasimling marked this pull request as ready for review April 20, 2026 14:06
@igorpecovnik
Copy link
Copy Markdown
Member

Dobule check rabbits comments.

@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions github-actions bot removed the Needs review Seeking for review label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

2 participants