mobile: hotdogb stable state: msm built in, display warnings fixed, self-flashing, serial console

Kernel (7.0.0-sm8150-g1299aab93171):
- msm DRM built in again: up at 0.6-0.8 s instead of 4.2 s, safe since
  0003 and 0004.
- 0005: CLK_OPS_PARENT_ENABLE on the pixel RCGs (as sdm845): "rcg didn't
  update its configuration" is gone.
- 0006: dsi_err_worker reported every error as status=4, a FIFO error
  that was none (lane FIFOs empty) and hid the ACK error (bit 0); it now
  reads status=40 ack_err=..., the panel's report on the first read after
  the takeover.
- ftrace (dynamic, function_graph), Landlock.

Without a button: the DTB gets the PON's mode-bootloader/mode-recovery
(fdtput on the pinned binary until the DTS moves in; new pin), Void gets
reboot-mode(1) and a runit stage-3 hook that restarts with the mode
(base/reboot2.c, built static by mkrootimg.sh).  flash.sh and
flash-root.sh reboot a running phone into fastboot themselves and wait for
ABL without ever cutting a command off or resetting the device -- two
usbresets after the userdata flash crashed it into 05c6:900e.  Writing the
fallback slot no longer makes it active.

Access: dnsmasq (DHCP only) on usb0, so the host keeps 172.16.42.2 after
the initramfs; an ACM function next to NCM with the kernel console and a
login on ttyGS0; phone_addr falls back to IPv6 link-local;
tools/reboot-loop.sh for boot races.  zram swap (half the RAM, zstd).

Measured: 20 of 20 warm reboots reachable; the self-flash
(build/logs/selfflash3-2026-11-08.log).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lotherkandClaude Opus 5.5 committed 2026-11-08 09:52:05 +00:00
1 parent 0d60f4dadf
commit b9c0affdb8
28 files changed
+543 -39

No files matched your search

+5 -2
View File
@@ -27,8 +27,11 @@ pmOS fork are not the base any more).
`tools/mkrootimg.sh` adds what the image needs on the phone: the kernel's
modules, `/etc/fstab` with the root by UUID, a NetworkManager profile that
keeps 172.16.42.1 on usb0, and root's password `ROOT_PASSWORD`
(default `makronix`), valid on the console and over ssh.
keeps 172.16.42.1 on usb0, root's password `ROOT_PASSWORD`
(default `makronix`), valid on the console and over ssh, and
`/usr/libexec/makronix/reboot2`, built from `reboot2.c` with the device's
cross compiler, static: the restart with a reboot mode (fastboot) that no
tool of Void can make (`reboot-mode(1)`, docs/BOOT.md).
## What carries over from pmOS, and what does not
+34
View File
@@ -0,0 +1,34 @@
/*
* reboot2 MODE -- restart now and hand MODE to the kernel
* (LINUX_REBOOT_CMD_RESTART2), whose reboot-mode driver writes it where
* the bootloader reads it: "bootloader" (fastboot), "recovery". The modes
* a phone knows are the mode-* properties of its reboot-mode node in the
* DT (e.g. pon@800, qcom-pon.c).
*
* No unmounting: called last in runit's stage 3
* (/etc/runit/shutdown.d/95-reboot-mode.sh, after 80-filesystems), the way
* Void's 90-kexec.sh calls kexec -e. Users run reboot-mode(1) instead.
*
* Built by tools/mkrootimg.sh with the device's cross compiler, static,
* into /usr/libexec/makronix/reboot2: no shell, perl or python on Void
* can make this system call, and its reboot(8) takes no argument.
*/
#include <linux/reboot.h>
#include <stdio.h>
#include <sys/syscall.h>
#include <unistd.h>
int
main(int argc, char **argv)
{
if (argc != 2) {
fprintf(stderr, "usage: reboot2 MODE\n");
return 2;
}
sync();
syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
LINUX_REBOOT_CMD_RESTART2, argv[1]);
perror("reboot2");
return 1;
}
+3
View File
@@ -18,6 +18,9 @@ NetworkManager
wpa_supplicant
iproute2
chrony
# DHCP for the host on the USB network (usb0-dhcp), so the host keeps its
# address after the initramfs is gone or the cable is replugged
dnsmasq
# graphics stack: the kernel's DRM needs Mesa's userspace
mesa-dri
libinput
+59 -6
View File
@@ -4,15 +4,16 @@ OnePlus 7T. NOT the 7T Pro (hotdog): the 7T Pro has a 1440x3120 panel and a
different init sequence; its sequence garbles this phone's display
(measured 2026-11-07).
- `kernel.config` -- the config of the kernel that runs on the phone; since
2026-11-07 with netconsole (dynamic) and `PRINTK_CALLER`
(7.0.0-sm8150, display working, ADSP off).
- `kernel.config` -- the config of the kernel that runs on the phone
(7.0.0-sm8150, display working, ADSP off); since 2026-11-07 with
netconsole (dynamic) and `PRINTK_CALLER`, since 2026-11-08 with msm DRM
built in (`CONFIG_DRM_MSM=y`), dynamic ftrace (function, function_graph),
Landlock. BTF (`DEBUG_INFO_BTF`) waits for `pahole` on the build host.
- `cmdline` -- the kernel arguments; `ROOT_UUID` (device.conf) is appended
by `tools/mkbootimg.sh` as `root=UUID=` and `pmos_root_uuid=`.
msm DRM is a module (`CONFIG_DRM_MSM=m`), loaded by udev during boot; the
by `tools/mkbootimg.sh` as `root=UUID=` and `pmos_root_uuid=`. The
`modprobe.blacklist=msm` of the SMMU race (below) is gone since patch 0003.
- `sm8150-oneplus-hotdogb.dtb` -- the DTB of the flashed baseline, pinned by
`DTB_SHA256_PREFIX`. Built from branch `hotdogb-dts` of
`DTB_SHA256_PREFIX`, with the PON reboot modes added (below). Built from branch `hotdogb-dts` of
~/src/sm8150-617 (6.17 dts includes). TODO: move the DTS source here.
- Boot chain: slot b holds the known-good image. Test on slot a only.
@@ -150,3 +151,55 @@ dispcc index on the GCC, so `msm_mdss_reset` holds `GCC_EMAC_BCR` (index 0,
`gcc-sm8150.c`) for 20 ms and never resets the MDSS. The pinned DTB has
the same (`resets = <0x2c 0x00>`, phandle 0x2c = `clock-controller@100000`).
Fix it when the DTS moves into the tree.
## Measured 2026-11-08, after 0004
- msm is built in again (`CONFIG_DRM_MSM=y`, its helpers with it): with
0003 and 0004 the race it met at 0.6 s is gone. `Initialized msm` at
0.59-0.76 s instead of 4.2 s, `fb0` at 0.68 s.
- `rcg didn't update its configuration` is gone with
`kernel/patches/0005` (`CLK_OPS_PARENT_ENABLE` on the pixel RCGs, as
sdm845's dispcc has it).
- `dsi_err_worker: status=4` was no FIFO error: the raw registers
(temporary debug print) were `ack=01003f06 ... fifo=11111010`, i.e. every
lane FIFO *empty*, which dsi_fifo_status counted as an error, and an ACK
error, which `DSI_ERR_STATE_ACK = 0` hid. It is the panel's error report
on the first read after msm takes the link over (the panel driver's
retry reads cleanly: `tries 2`). `kernel/patches/0006` reports it as
what it is: `dsi_err_worker: status=40 ack_err=01003f06`, once per boot.
- The DTB carries the PON reboot modes since this day, for `reboot-mode
bootloader` (docs/BOOT.md): added to the pinned binary as an interim step,
until the DTS moves into the tree --
fdtput -t u sm8150-oneplus-hotdogb.dtb /soc@0/spmi@c440000/pmic@0/pon@800 mode-bootloader 2
fdtput -t u sm8150-oneplus-hotdogb.dtb /soc@0/spmi@c440000/pmic@0/pon@800 mode-recovery 1
(sdm845's pm8998.dtsi has the same two; `dtc -s` diff: only these two
lines). Pin `DTB_SHA256_PREFIX` 915e91eb7e2b1d3b -> 8eb4b7a7c6a6d346.
Measured: the modes in `/proc/device-tree`, fastboot 7 s after
`reboot-mode bootloader`.
- The state of this day (kernel `7.0.0-sm8150-g1299aab93171`, patches
0001-0006, msm built in, the DTB above, root image with usb0-dhcp,
ACM console, zram-swap): 20 of 20 warm reboots reachable
(`tools/reboot-loop.sh 20`), `zram0` 3.8 GB swap, `landlock: Up and
running`, tracers `function_graph function`. Flashed without a button:
`reboot-mode bootloader`, then `tools/flash-root.sh` and `tools/flash.sh`
(`build/logs/selfflash3-2026-11-08.log`).
Open, for the DTS step (the DTS of the pinned DTB is
`~/src/sm8150-617`, branch `hotdogb-dts`, commit c4195dd0d; the 7.0 tree's
own `sm8150-oneplus-hotdogb.dts` is an older variant -- different memory
map, compatible `"oneplus,hotdobg"` -- not the one to use):
- the MDSS reset (above);
- `simplefb: cannot reserve video memory at [mem 0x9c000000-0x9c9e33ff]`
and `WARNING ... ioremap attempted on RAM pfn` at 0.31 s: the
bootloader's framebuffer is not in reserved memory;
- USB OTG (host mode): the kernel has dual-role DWC3, TCPM with the
pm8150b Type-C driver, the VBUS regulator, XHCI, storage, HID; the DT has
`dr_mode = "peripheral"`, `typec@1500` and `usb-vbus-regulator@1100`
disabled, no connector graph and no `usb-role-switch`.
Open, elsewhere: `WARNING: drivers/usb/gadget/function/u_serial.c:703 at
gs_close` when a shell on ttyGS0 exits after `login`'s vhangup -- the open
count of the gadget's tty is already 0 (upstream code).
+1 -1
View File
@@ -9,7 +9,7 @@ CMDLINE=cmdline
DTB=sm8150-oneplus-hotdogb.dtb
# pinned inputs of the baseline that boots on the phone (make check)
DTB_SHA256_PREFIX=915e91eb7e2b1d3b
DTB_SHA256_PREFIX=8eb4b7a7c6a6d346
INITRAMFS_SHA256_PREFIX=7dac53b05ffeec5d
# (the pmOS initramfs; ours, base/initramfs, replaces it once it has booted)
+39 -14
View File
@@ -149,6 +149,7 @@ CONFIG_TREE_SRCU=y
CONFIG_TASKS_RCU_GENERIC=y
CONFIG_NEED_TASKS_RCU=y
CONFIG_TASKS_RCU=y
CONFIG_TASKS_RUDE_RCU=y
CONFIG_TASKS_TRACE_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_NEED_SEGCBLIST=y
@@ -688,6 +689,7 @@ CONFIG_KVM=y
# CONFIG_NVHE_EL2_DEBUG is not set
# CONFIG_PTDUMP_STAGE2_DEBUGFS is not set
CONFIG_HAVE_LIVEPATCH=y
# CONFIG_LIVEPATCH is not set
CONFIG_CPU_MITIGATIONS=y
CONFIG_ARCH_HAS_DMA_OPS=y
@@ -830,7 +832,8 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
CONFIG_HAVE_GCC_PLUGINS=y
CONFIG_FUNCTION_ALIGNMENT_4B=y
CONFIG_FUNCTION_ALIGNMENT=4
CONFIG_FUNCTION_ALIGNMENT_8B=y
CONFIG_FUNCTION_ALIGNMENT=8
CONFIG_CC_HAS_MIN_FUNCTION_ALIGNMENT=y
CONFIG_CC_HAS_SANE_FUNCTION_ALIGNMENT=y
# end of General architecture-dependent options
@@ -4647,8 +4650,8 @@ CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_KMS_HELPER=y
# CONFIG_DRM_PANIC is not set
CONFIG_DRM_CLIENT=y
CONFIG_DRM_CLIENT_LIB=m
CONFIG_DRM_CLIENT_SELECTION=m
CONFIG_DRM_CLIENT_LIB=y
CONFIG_DRM_CLIENT_SELECTION=y
CONFIG_DRM_CLIENT_SETUP=y
#
@@ -4662,7 +4665,7 @@ CONFIG_DRM_CLIENT_DEFAULT="fbdev"
# end of Supported DRM clients
# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
CONFIG_DRM_DISPLAY_DP_AUX_BUS=m
CONFIG_DRM_DISPLAY_DP_AUX_BUS=y
CONFIG_DRM_DISPLAY_HELPER=y
CONFIG_DRM_BRIDGE_CONNECTOR=y
# CONFIG_DRM_DISPLAY_DP_AUX_CEC is not set
@@ -4675,11 +4678,11 @@ CONFIG_DRM_DISPLAY_HDMI_CEC_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_CEC_NOTIFIER_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_HELPER=y
CONFIG_DRM_DISPLAY_HDMI_STATE_HELPER=y
CONFIG_DRM_EXEC=m
CONFIG_DRM_GPUVM=m
CONFIG_DRM_EXEC=y
CONFIG_DRM_GPUVM=y
CONFIG_DRM_GEM_DMA_HELPER=m
CONFIG_DRM_GEM_SHMEM_HELPER=m
CONFIG_DRM_SCHED=m
CONFIG_DRM_SCHED=y
# CONFIG_DRM_AMDGPU is not set
#
@@ -4755,7 +4758,7 @@ CONFIG_DRM_POWERVR=m
# CONFIG_DRM_LIMA is not set
# CONFIG_DRM_LOGICVC is not set
# CONFIG_DRM_MGAG200 is not set
CONFIG_DRM_MSM=m
CONFIG_DRM_MSM=y
CONFIG_DRM_MSM_GPU_STATE=y
CONFIG_DRM_MSM_KMS=y
CONFIG_DRM_MSM_KMS_FBDEV=y
@@ -5789,6 +5792,7 @@ CONFIG_SONY_FF=y
#
# HID-BPF support
#
# CONFIG_HID_BPF is not set
# end of HID-BPF support
CONFIG_I2C_HID=y
@@ -7029,7 +7033,7 @@ CONFIG_QCOM_GENI_SE=y
CONFIG_QCOM_GSBI=y
CONFIG_QCOM_LLCC=y
CONFIG_QCOM_KRYO_L2_ACCESSORS=y
CONFIG_QCOM_MDT_LOADER=m
CONFIG_QCOM_MDT_LOADER=y
CONFIG_QCOM_OCMEM=y
CONFIG_QCOM_PD_MAPPER=m
CONFIG_QCOM_PDR_HELPERS=y
@@ -7056,7 +7060,7 @@ CONFIG_QCOM_INLINE_CRYPTO_ENGINE=y
CONFIG_QCOM_PBS=m
# end of Qualcomm SoC drivers
CONFIG_QCOM_UBWC_CONFIG=m
CONFIG_QCOM_UBWC_CONFIG=y
#
# Sophgo SoC drivers
@@ -8226,6 +8230,7 @@ CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240
CONFIG_PSTORE_COMPRESS=y
CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_PMSG=y
# CONFIG_PSTORE_FTRACE is not set
CONFIG_PSTORE_RAM=y
# CONFIG_PSTORE_BLK is not set
# CONFIG_UFS_FS is not set
@@ -8355,9 +8360,10 @@ CONFIG_PROC_MEM_ALWAYS_FORCE=y
CONFIG_SECURITY=y
CONFIG_HAS_SECURITY_AUDIT=y
CONFIG_SECURITYFS=y
# CONFIG_SECURITY_NETWORK is not set
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PATH=y
# CONFIG_STATIC_USERMODEHELPER is not set
# CONFIG_SECURITY_SELINUX is not set
# CONFIG_SECURITY_SMACK is not set
# CONFIG_SECURITY_TOMOYO is not set
# CONFIG_SECURITY_APPARMOR is not set
@@ -8365,7 +8371,7 @@ CONFIG_SECURITY_PATH=y
# CONFIG_SECURITY_YAMA is not set
# CONFIG_SECURITY_SAFESETID is not set
# CONFIG_SECURITY_LOCKDOWN_LSM is not set
# CONFIG_SECURITY_LANDLOCK is not set
CONFIG_SECURITY_LANDLOCK=y
# CONFIG_SECURITY_IPE is not set
CONFIG_INTEGRITY=y
# CONFIG_INTEGRITY_SIGNATURE is not set
@@ -9027,21 +9033,35 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_FREGS=y
CONFIG_HAVE_FTRACE_GRAPH_FUNC=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS=y
CONFIG_HAVE_EXTRA_IPI_TRACEPOINTS=y
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
CONFIG_BUILDTIME_MCOUNT_SORT=y
CONFIG_TRACE_CLOCK=y
CONFIG_RING_BUFFER=y
CONFIG_EVENT_TRACING=y
CONFIG_CONTEXT_SWITCH_TRACER=y
CONFIG_TRACING=y
CONFIG_GENERIC_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
CONFIG_TRACEFS_AUTOMOUNT_DEPRECATED=y
# CONFIG_BOOTTIME_TRACING is not set
# CONFIG_FUNCTION_TRACER is not set
CONFIG_FUNCTION_TRACER=y
CONFIG_FUNCTION_GRAPH_TRACER=y
# CONFIG_FUNCTION_GRAPH_RETVAL is not set
# CONFIG_FUNCTION_GRAPH_RETADDR is not set
CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
CONFIG_DYNAMIC_FTRACE_WITH_CALL_OPS=y
CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y
# CONFIG_FUNCTION_SELF_TRACING is not set
# CONFIG_FPROBE is not set
# CONFIG_FUNCTION_PROFILER is not set
# CONFIG_STACK_TRACER is not set
# CONFIG_IRQSOFF_TRACER is not set
# CONFIG_PREEMPT_TRACER is not set
@@ -9049,7 +9069,6 @@ CONFIG_TRACEFS_AUTOMOUNT_DEPRECATED=y
# CONFIG_HWLAT_TRACER is not set
# CONFIG_OSNOISE_TRACER is not set
# CONFIG_TIMERLAT_TRACER is not set
# CONFIG_ENABLE_DEFAULT_TRACERS is not set
# CONFIG_FTRACE_SYSCALLS is not set
# CONFIG_TRACER_SNAPSHOT is not set
CONFIG_BRANCH_PROFILE_NONE=y
@@ -9057,11 +9076,13 @@ CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_PROFILE_ALL_BRANCHES is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
CONFIG_KPROBE_EVENTS=y
# CONFIG_KPROBE_EVENTS_ON_NOTRACE is not set
CONFIG_UPROBE_EVENTS=y
CONFIG_EPROBE_EVENTS=y
CONFIG_BPF_EVENTS=y
CONFIG_DYNAMIC_EVENTS=y
CONFIG_PROBE_EVENTS=y
CONFIG_FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY=y
# CONFIG_SYNTH_EVENTS is not set
# CONFIG_USER_EVENTS is not set
# CONFIG_HIST_TRIGGERS is not set
@@ -9069,6 +9090,10 @@ CONFIG_PROBE_EVENTS=y
# CONFIG_TRACEPOINT_BENCHMARK is not set
# CONFIG_RING_BUFFER_BENCHMARK is not set
# CONFIG_TRACE_EVAL_MAP_FILE is not set
# CONFIG_FTRACE_RECORD_RECURSION is not set
# CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING is not set
# CONFIG_FTRACE_STARTUP_TEST is not set
# CONFIG_FTRACE_SORT_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_STARTUP_TEST is not set
# CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set
# CONFIG_PREEMPTIRQ_DELAY_TEST is not set
Binary file not shown.
+30 -10
View File
@@ -12,16 +12,36 @@
handoff: reset_gpio=0 power_mode=0x9c ... compression_mode=0x00
handoff: compression enable sent, err 0
- Access on a running system: USB network 172.16.42.1, ssh with a key; to get
to fastboot, `reboot bootloader` leaves the display garbled, and fastboot may
need Power 15 s, then Power + Vol Up + Vol Down.
- The host gets 172.16.42.2 by DHCP from the initramfs only; the root
system runs no DHCP server. If the host misses that window (or the cable
is replugged later), its interface stays without IPv4: ping, ssh and
netconsole fail although the phone booted fine (2026-11-08, a "hang" that
was none: screen and cursor fine). Reach it over IPv6 link-local:
`ping -6 ff02::1%<if>` names the phone's `fe80::` address, then
`ssh root@fe80::...%<if>`.
- Access on a running system (Void root, since 2026-11-08):
- USB network: the phone is 172.16.42.1, root/`makronix` over ssh. The
host gets 172.16.42.2 by DHCP -- from the initramfs, then from
`usb0-dhcp` (dnsmasq, DHCP only: no route, no DNS) in the root system,
so a replugged cable no longer leaves the host without an address.
Before that service a host that missed the initramfs's DHCP had no IPv4,
and ssh and netconsole failed although the phone ran (a "hang" that was
none, 2026-11-08). The fallback still works: `ping -6 ff02::1%<if>`
names the phone's `fe80::` address, `ssh root@fe80::...%<if>`
(`phone_addr` in `tools/lib.sh` does both).
- Serial: stage 1 adds an ACM function to the initramfs's gadget
(`01-acm-console.sh`), so the host has `/dev/ttyACM0` (group dialout)
with the kernel console (`console=ttyGS0`) and a login
(`agetty-ttyGS0`). `login` hangs the line up after the password: the
host must open the port again (a terminal program does; a script
reopens it).
- Fastboot from Linux: `reboot-mode bootloader` (or `recovery`) shuts
down cleanly and restarts with the reboot reason in the PMIC
(`/etc/runit/shutdown.d/95-reboot-mode.sh`, `base/reboot2.c`; needs
`mode-bootloader` on the PON node of the DT). Measured: fastboot 7 s
after the command, no button pressed. `tools/flash.sh` and
`tools/flash-root.sh` do it themselves when no phone is in fastboot
(`fastboot_ready`). After a large flash (userdata) ABL stays busy for
more than 15 s and does not answer: wait (`fastboot_answers`, up to
120 s), never cut the command off and never reset the device. Two
`usbreset`s 30 s apart in that state crashed the phone into Qualcomm's
crash-dump mode (`05c6:900e`, screen dark; out with Power 15 s),
2026-11-08.
- By hand, when Linux does not run: Power 15 s, then Power + Vol Up +
Vol Down.
## Verification
@@ -0,0 +1,45 @@
From 758e62731d47b911ef3f9f0400b55737a8964169 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 08:20:19 +0000
Subject: [PATCH 5/6] clk: qcom: dispcc-sm8250: enable the parent of the pixel
RCGs while configuring them
An RCG takes a new configuration only while its new parent runs. The
pixel clock sources are fed by the DSI PLL, which is off when msm sets
their rate at the first modeset, and every boot of the OnePlus 7T
(SM8150, which uses this driver) logged
disp_cc_mdss_pclk0_clk_src: rcg didn't update its configuration.
with a WARNING from update_config. sdm845's dispcc, the predecessor,
sets CLK_OPS_PARENT_ENABLE on the same two clocks; do the same here.
Measured: the warning is gone, the display comes up as before.
---
drivers/clk/qcom/dispcc-sm8250.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/qcom/dispcc-sm8250.c b/drivers/clk/qcom/dispcc-sm8250.c
index 8f433e1e7..d021cf2f2 100644
--- a/drivers/clk/qcom/dispcc-sm8250.c
+++ b/drivers/clk/qcom/dispcc-sm8250.c
@@ -578,7 +578,7 @@ static struct clk_rcg2 disp_cc_mdss_pclk0_clk_src = {
.name = "disp_cc_mdss_pclk0_clk_src",
.parent_data = disp_cc_parent_data_6,
.num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
.ops = &clk_pixel_ops,
},
};
@@ -592,7 +592,7 @@ static struct clk_rcg2 disp_cc_mdss_pclk1_clk_src = {
.name = "disp_cc_mdss_pclk1_clk_src",
.parent_data = disp_cc_parent_data_6,
.num_parents = ARRAY_SIZE(disp_cc_parent_data_6),
- .flags = CLK_SET_RATE_PARENT,
+ .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE,
.ops = &clk_pixel_ops,
},
};
--
2.53.0
@@ -0,0 +1,97 @@
From 1299aab931714fd5c5a736597be530367717c666 Mon Sep 17 00:00:00 2001
From: lotherk <konrad@lother.io>
Date: Sun, 8 Nov 2026 08:20:20 +0000
Subject: [PATCH 6/6] drm/msm/dsi: report ACK errors, and count only real FIFO
errors
Two bugs hid the cause of a DSI error interrupt:
- DSI_ERR_STATE_ACK was 0, so an acknowledge-with-error-report from the
panel left no trace in the status dsi_err_worker logs.
- dsi_fifo_status took any non-zero FIFO_STATUS as an error, but the
register also holds state bits that are set in normal operation (lane
FIFOs empty, e.g. 0x11111010). Every error interrupt therefore showed
as status=4, a FIFO error that was none.
Give ACK a bit of its own and log the raw ACK_ERR_STATUS with it, and
count only overflow and underflow bits as FIFO errors. On the OnePlus 7T
the one error per boot now reads as what it is: the panel's error report
on the first read after msm takes the link over from the bootloader
(ack_err=01003f06; the panel driver's retry reads cleanly).
---
drivers/gpu/drm/msm/dsi/dsi_host.c | 31 +++++++++++++++++++++++++++---
1 file changed, 28 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 24d905fae..dca3031b1 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -85,7 +85,7 @@ static int dsi_get_version(const void __iomem *base, u32 *major, u32 *minor)
}
}
-#define DSI_ERR_STATE_ACK 0x0000
+#define DSI_ERR_STATE_ACK 0x0040
#define DSI_ERR_STATE_TIMEOUT 0x0001
#define DSI_ERR_STATE_DLN0_PHY 0x0002
#define DSI_ERR_STATE_FIFO 0x0004
@@ -147,6 +147,7 @@ struct msm_dsi_host {
spinlock_t intr_lock; /* Protect interrupt ctrl register */
u32 err_work_state;
+ u32 err_ack_status;
struct work_struct err_work;
struct workqueue_struct *workqueue;
@@ -1543,7 +1544,11 @@ static void dsi_err_worker(struct work_struct *work)
container_of(work, struct msm_dsi_host, err_work);
u32 status = msm_host->err_work_state;
- pr_err_ratelimited("%s: status=%x\n", __func__, status);
+ if (status & DSI_ERR_STATE_ACK)
+ pr_err_ratelimited("%s: status=%x ack_err=%08x\n", __func__,
+ status, msm_host->err_ack_status);
+ else
+ pr_err_ratelimited("%s: status=%x\n", __func__, status);
if (status & DSI_ERR_STATE_MDP_FIFO_UNDERFLOW)
dsi_sw_reset(msm_host);
@@ -1564,6 +1569,7 @@ static void dsi_ack_err_status(struct msm_dsi_host *msm_host)
dsi_write(msm_host, REG_DSI_ACK_ERR_STATUS, status);
/* Writing of an extra 0 needed to clear error bits */
dsi_write(msm_host, REG_DSI_ACK_ERR_STATUS, 0);
+ msm_host->err_ack_status = status;
msm_host->err_work_state |= DSI_ERR_STATE_ACK;
}
}
@@ -1602,7 +1608,26 @@ static void dsi_fifo_status(struct msm_dsi_host *msm_host)
status = dsi_read(msm_host, REG_DSI_FIFO_STATUS);
- /* fifo underflow, overflow */
+ /*
+ * fifo underflow, overflow. The register also holds state bits --
+ * lane FIFOs empty or full, DMA FIFO watermarks -- which are set in
+ * normal operation (e.g. 0x11111010, every lane empty) and are no
+ * error; counted as one, they hid the real error behind
+ * DSI_ERR_STATE_FIFO.
+ */
+ status &= DSI_FIFO_STATUS_VIDEO_MDP_FIFO_OVERFLOW |
+ DSI_FIFO_STATUS_VIDEO_MDP_FIFO_UNDERFLOW |
+ DSI_FIFO_STATUS_CMD_MDP_FIFO_UNDERFLOW |
+ DSI_FIFO_STATUS_CMD_DMA_FIFO_UNDERFLOW |
+ DSI_FIFO_STATUS_DLN0_LP_FIFO_OVERFLOW |
+ DSI_FIFO_STATUS_DLN0_HS_FIFO_OVERFLOW |
+ DSI_FIFO_STATUS_DLN0_HS_FIFO_UNDERFLOW |
+ DSI_FIFO_STATUS_DLN1_HS_FIFO_OVERFLOW |
+ DSI_FIFO_STATUS_DLN1_HS_FIFO_UNDERFLOW |
+ DSI_FIFO_STATUS_DLN2_HS_FIFO_OVERFLOW |
+ DSI_FIFO_STATUS_DLN2_HS_FIFO_UNDERFLOW |
+ DSI_FIFO_STATUS_DLN3_HS_FIFO_OVERFLOW |
+ DSI_FIFO_STATUS_DLN3_HS_FIFO_UNDERFLOW;
if (status) {
dsi_write(msm_host, REG_DSI_FIFO_STATUS, status);
msm_host->err_work_state |= DSI_ERR_STATE_FIFO;
--
2.53.0
@@ -0,0 +1,21 @@
# A serial port next to the USB network: add an ACM function to the gadget
# the initramfs built (g1, ncm.usb0 only), so the host gets /dev/ttyACM0.
# The kernel console follows (console=ttyGS0 on the cmdline,
# CONFIG_U_SERIAL_CONSOLE) and agetty-ttyGS0 offers a login there -- a way in
# that needs no IP. The gadget is unbound and bound again to add the
# function: the host sees a replug, and gets its address again from
# usb0-dhcp. Before 01-netconsole.sh (glob order), so netconsole starts on
# the link as it stays.
# Sourced by /etc/runit/1: no exit, nothing left set.
_g=/sys/kernel/config/usb_gadget/g1
if [ -d "$_g/configs/c.1" ] && [ ! -e "$_g/functions/acm.GS0" ]; then
_udc=$(cat "$_g/UDC")
if [ -n "$_udc" ] && mkdir "$_g/functions/acm.GS0" 2>/dev/null; then
echo "" > "$_g/UDC"
ln -s "$_g/functions/acm.GS0" "$_g/configs/c.1/" 2>/dev/null
echo "$_udc" > "$_g/UDC" &&
echo "acm-console: ttyGS0 on $_udc" > /dev/kmsg
fi
fi
unset _g _udc
@@ -0,0 +1 @@
/etc/sv/agetty-ttyGS0
@@ -0,0 +1 @@
/etc/sv/usb0-dhcp
@@ -0,0 +1 @@
/etc/sv/zram-swap
@@ -0,0 +1,11 @@
# Reboot with a mode (bootloader, recovery) when reboot-mode(1) asked for
# one: the last step of stage 3, after 80-filesystems, the way 90-kexec.sh
# triggers kexec. Not reached when the restart succeeds; otherwise runit
# reboots plainly.
if [ -z "$VIRTUALIZATION" ] && [ -s /run/reboot-mode ] &&
[ -n "$(find /run/runit/reboot -perm -u+x 2>/dev/null)" ] &&
[ -x /usr/libexec/makronix/reboot2 ]; then
msg "Rebooting into $(cat /run/reboot-mode)..."
/usr/libexec/makronix/reboot2 "$(cat /run/reboot-mode)"
fi
@@ -0,0 +1 @@
../agetty-serial/conf
@@ -0,0 +1 @@
../agetty-generic/finish
@@ -0,0 +1 @@
../agetty-serial/run
@@ -0,0 +1 @@
/run/runit/supervise.agetty-ttyGS0
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
# DHCP for the host on the USB network: hands it 172.16.42.2, the address the
# initramfs gave it, and nothing else (no router, no DNS, no DNS server of its
# own: port 0). Without it the host loses its address whenever the USB link
# comes up again after the initramfs -- a replugged cable, or the ACM
# function stage 1 adds (01-acm-console.sh) -- and ping, ssh and netconsole
# fail although the phone runs (docs/BOOT.md). Its own options, not
# /etc/dnsmasq.conf: Void's dnsmasq service stays as Void ships it.
exec 2>&1
[ -d /sys/class/net/usb0 ] || { sv down "${PWD##*/}"; exit 0; }
exec dnsmasq --keep-in-foreground --conf-file=/dev/null --port=0 \
--interface=usb0 --bind-dynamic --dhcp-authoritative \
--dhcp-range=172.16.42.2,172.16.42.2,255.255.255.0,12h \
--dhcp-option=3 --dhcp-option=6 \
--dhcp-leasefile=/run/usb0-dhcp.leases --log-facility=-
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
# Take the zram swap down when the service stops (sv down, shutdown).
grep -q '^/dev/zram0 ' /proc/swaps && swapoff /dev/zram0
echo 1 > /sys/block/zram0/reset 2>/dev/null
exit 0
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
# Compressed swap in RAM: one zram device of half the memory, zstd (the
# kernel's default, CONFIG_ZRAM_DEF_COMP), at a priority above any disk
# swap. Set up once; the service then waits, and finish takes it down.
exec 2>&1
z=/sys/block/zram0
if ! grep -q '^/dev/zram0 ' /proc/swaps; then
modprobe zram num_devices=1 || exit 1
kb=$(awk '/^MemTotal:/ { print $2 }' /proc/meminfo)
echo 1 > "$z/reset" 2>/dev/null
echo "$((kb / 2))K" > "$z/disksize" || exit 1
mkswap /dev/zram0 >/dev/null || exit 1
swapon -p 100 /dev/zram0 || exit 1
fi
exec pause
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
#
# reboot-mode bootloader|recovery -- reboot into the bootloader's fastboot
# or into recovery, with a clean shutdown: the mode goes to /run/reboot-mode,
# reboot(8) runs runit's stage 3 (services stopped, file systems unmounted),
# and its last hook, /etc/runit/shutdown.d/95-reboot-mode.sh, restarts with
# the mode (/usr/libexec/makronix/reboot2). Needs the mode-* properties on
# the PMIC's PON node in the DT; without them the phone just restarts.
case ${1:-} in
bootloader|recovery) ;;
*) echo "usage: reboot-mode bootloader|recovery" >&2; exit 2 ;;
esac
[ -x /usr/libexec/makronix/reboot2 ] ||
{ echo "reboot-mode: no /usr/libexec/makronix/reboot2" >&2; exit 1; }
echo "$1" > /run/reboot-mode || exit 1
exec reboot
+2 -2
View File
@@ -16,8 +16,8 @@ img=$2
[ "$FLASH_METHOD" = fastboot ] || die "flash method $FLASH_METHOD not implemented"
[ -n "${ROOT_PARTITION:-}" ] || die "ROOT_PARTITION not set"
[ -n "$(fastboot devices)" ] || die "no device in fastboot"
prod=$(fastboot getvar product 2>&1 | sed -n 's/^product: *//p')
fastboot_ready
prod=$(timeout 10 fastboot getvar product 2>&1 | sed -n 's/^product: *//p')
[ "$prod" = "$FASTBOOT_PRODUCT" ] ||
die "product is '$prod', expected '$FASTBOOT_PRODUCT'"
+8 -4
View File
@@ -2,7 +2,8 @@
#
# Flash a boot image to a phone in fastboot. The test slot (TEST_SLOT, a) is
# the default; the fallback slot holds the known-good image and is written
# only with FORCE_FALLBACK=1. The device must report FASTBOOT_PRODUCT.
# only with FORCE_FALLBACK=1, and writing it does not make it active. The
# device must report FASTBOOT_PRODUCT.
#
# Usage: flash.sh DEVICEDIR IMAGE [SLOT]
@@ -16,11 +17,14 @@ img=$2 slot=${3:-$TEST_SLOT}
[ "$FLASH_METHOD" = fastboot ] || die "flash method $FLASH_METHOD not implemented"
[ "$slot" != "$FALLBACK_SLOT" ] || [ "${FORCE_FALLBACK:-0}" = 1 ] ||
die "slot $slot is the fallback; set FORCE_FALLBACK=1 to overwrite it"
[ -n "$(fastboot devices)" ] || die "no device in fastboot"
prod=$(fastboot getvar product 2>&1 | sed -n 's/^product: *//p')
fastboot_ready
prod=$(timeout 10 fastboot getvar product 2>&1 | sed -n 's/^product: *//p')
[ "$prod" = "$FASTBOOT_PRODUCT" ] ||
die "product is '$prod', expected '$FASTBOOT_PRODUCT'"
fastboot flash "$BOOT_PARTITION_PREFIX$slot" "$img"
fastboot set_active "$slot"
# the fallback is a reserve: writing it leaves the active slot as it is (the
# test slot keeps booting, its successful flag and retry count untouched);
# the test slot is made active, which resets its retry count (docs/BOOT.md)
[ "$slot" = "$FALLBACK_SLOT" ] || fastboot set_active "$slot"
fastboot reboot
+68
View File
@@ -38,3 +38,71 @@ die() {
echo "$0: $*" >&2
exit 1
}
# The running phone over the USB network. phone_addr prints the address
# where ssh answers: PHONE_IP (172.16.42.1) if it does, else the IPv6
# link-local neighbour on the host's cdc_ncm interface -- the host loses its
# IPv4 when it misses the phone's DHCP (docs/BOOT.md) -- or nothing.
# phone_ssh ADDR CMD runs CMD as root (PHONE_PASS, default makronix).
phone_ssh() {
sshpass -p "${PHONE_PASS:-makronix}" ssh -o ConnectTimeout=3 \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
-o LogLevel=error "root@$1" "$2"
}
phone_addr() {
command -v sshpass >/dev/null || die "needs sshpass"
if phone_ssh "${PHONE_IP:-172.16.42.1}" true 2>/dev/null; then
echo "${PHONE_IP:-172.16.42.1}"
return 0
fi
for _d in /sys/class/net/*; do
[ "$(basename "$(readlink -f "$_d/device/driver" 2>/dev/null)")" = cdc_ncm ] ||
continue
_i=${_d##*/}
_own=$(ip -6 -o addr show dev "$_i" scope link 2>/dev/null |
awk '{sub("/.*", "", $4); print $4}')
for _a in $(ping -6 -c 2 -W 2 "ff02::1%$_i" 2>/dev/null |
awk '/bytes from/ {sub("%.*", "", $4); print $4}' | sort -u); do
[ "$_a" = "$_own" ] && continue
if phone_ssh "$_a%$_i" true 2>/dev/null; then
echo "$_a%$_i"
return 0
fi
done
done
return 1
}
# fastboot_ready: a phone in fastboot that answers, or die. When none is
# there but the phone runs Linux, reboot it into fastboot (reboot-mode
# bootloader, which needs the PON's mode-bootloader in the DT); otherwise
# wait, the phone may be between two USB identities. Gives up after 120 s
# without a fastboot device. Never resets the device (fastboot_answers).
fastboot_answers() {
[ -n "$(fastboot devices)" ] || return 1
# Wait long and never cut a command off: after a large flash (userdata)
# ABL stays busy for more than 15 s and does not answer; a host that
# gives up and resets the device then (usbreset) crashes it into the
# Qualcomm crash-dump mode, 05c6:900e (measured 2026-11-08: two resets
# 30 s apart, then error -71 and the phone dark).
timeout 120 fastboot getvar product >/dev/null 2>&1
}
fastboot_ready() {
_t=0 _asked=
while [ "$_t" -lt 120 ]; do
if [ -n "$(fastboot devices)" ]; then
fastboot_answers && return 0
die "the phone is in fastboot but does not answer"
fi
if [ -z "$_asked" ] && _a=$(phone_addr); then
echo "$0: rebooting the phone at $_a into fastboot" >&2
phone_ssh "$_a" "reboot-mode bootloader" >/dev/null 2>&1 || true
_asked=1
fi
sleep 2
_t=$((_t + 2))
done
die "no phone in fastboot within 120 s"
}
+10
View File
@@ -46,6 +46,12 @@ make -s -C "$tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" \
INSTALL_MOD_PATH="$work/modules" INSTALL_MOD_STRIP=1 modules_install
[ -d "$work/modules/lib/modules/$release" ] || die "modules_install wrote no $release"
# reboot2 (base/reboot2.c): restart with a reboot mode (fastboot), for
# reboot-mode(1); static, so it does not depend on the host's glibc version
"${CROSS_COMPILE}gcc" -static -Os -Wall -Werror -o "$work/reboot2" \
"$ROOT/base/reboot2.c" || die "cannot build base/reboot2.c"
"${CROSS_COMPILE}strip" "$work/reboot2"
# the root password as a SHA-512 crypt hash, the scheme both bases' shadow uses
pwhash=$(openssl passwd -6 "$password")
export MRI_WORK="$work" MRI_TAR="$tarball" MRI_OUT="$out" MRI_PWHASH="$pwhash" \
@@ -68,6 +74,10 @@ unshare --map-root-user --map-auto sh -eu -c '
[ ! -d "$o" ] || cp -R "$o/." "$r/"
done
mkdir -p "$r/usr/libexec/makronix"
cp "$MRI_WORK/reboot2" "$r/usr/libexec/makronix/reboot2"
chmod 755 "$r/usr/libexec/makronix/reboot2"
cat > "$r/etc/fstab" <<EOF
# <file system> <dir> <type> <options> <dump> <pass>
UUID=$MRI_UUID / ext4 defaults 0 1
+51
View File
@@ -0,0 +1,51 @@
#!/bin/sh
#
# Warm-reboot a running phone N times (sysrq b) and count the boots that do
# not come back: a test for boot races. Each round waits up to WAIT
# seconds (default 90) for ssh -- at the phone's IPv4 address or, when the
# host has lost its IPv4 on the USB link, at its IPv6 link-local address
# (phone_addr, tools/lib.sh), so a missing host address is not taken for a
# hang. Stops at the first boot that answers neither: an unreachable phone
# cannot be rebooted. With netconsole running (tools/netconsole-listen.sh
# LOG), each line names the LOG lines of its boot.
#
# Usage: reboot-loop.sh [N] [LOG]
set -u
. "$(dirname "$0")/lib.sh"
n=${1:-10}
log=${2:-}
wait=${WAIT:-90}
lines() {
if [ -n "$log" ] && [ -f "$log" ]; then
wc -l < "$log" | tr -d ' '
else
echo 0
fi
}
a=$(phone_addr) || die "phone not reachable"
hangs=0 i=1
while [ "$i" -le "$n" ]; do
start=$(lines)
phone_ssh "$a" 'sync; echo b > /proc/sysrq-trigger' >/dev/null 2>&1
sleep 15
t=0
while ! a=$(phone_addr) && [ "$t" -lt "$wait" ]; do
sleep 3
t=$((t + 3))
done
if [ -z "$a" ]; then
hangs=1
echo "run $i: NOT REACHABLE (log lines from $start)"
break
fi
echo "run $i: up at $a (log lines $start-$(lines))"
sleep 5
i=$((i + 1))
done
[ "$i" -gt "$n" ] && i=$n
echo "$i runs, $hangs not reachable"
[ "$hangs" -eq 0 ]