Review of the first commit: one flaky sensor made the whole virtual zone unreadable while its cooling maps stayed
bound, and thermal-guard trusted the bindings alone - nothing would have throttled. mu300_thermal now reports the
hottest of the zones that read and fails only when none does (the core then skips the update and the sysfs temp
read fails). thermal-guard hands over only when the bound zone also has a passive trip at or below HOT and reads a
number within 15 C of the hottest reading of the round; a missing, non-numeric or stale reading, or trips above
HOT, keep it capping. Tests for each, for mainline without the zone, and for the 105 C power-off under native
cooling.
System > CPU gets a read-only Thermal card from standard thermal sysfs (mu300-cpu status --json: "thermal", every
zone's type, temperature, trips and bound cooling devices with their states), in the 31 catalogs. FINDINGS 48 has
the device tree facts, the module-or-DT decision and its evidence, how the kernel's QoS cap and the profile ceiling
compose, and the handoff rules; the upstream README, the panel wiki page and tests/README follow.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
The stock device tree has trip points on one zone only, soc-thmzone (passive 70 and 85 C, critical 110 C, cooling
maps from the 85 C trip to the three CPU clusters), and its sensor is /virtual-sensor@0, the hottest of eleven
physical zones, whose driver mainline does not have; so under 6.18 and 7.2 the zone did not exist and thermal-guard
capped cpufreq by hand. upstream/modules/mu300_thermal (after kanoqwq's clean-tf-7.2, 5c8c2f9) binds to that sensor
node and reports the hottest referenced zone; thermal_of then registers soc-thmzone with its trips, binds the cpufreq
cooling devices and the step_wise governor throttles. build-modules.sh builds it for both kernels, extra-modules
loads it (modprobe, else insmod from the bundle's directory; the vendor 5.4 kernel has no such module).
thermal-guard: the vendor kernel is told by its release (5.x), not by "a zone has trips", since the mainline zone
has trips too; on mainline the 105 C power-off stays always, and while an enabled zone with a passive trip has
every cpufreq cooling device bound the guard only watches: it lifts the cap it set itself (a marker survives a
restart) and leaves scaling_max_freq to the profile's ceiling, under which the kernel's QoS cap sits; with the zone
gone it caps again. Tests: the handoff, a cluster left out, a disabled zone, the module gone, the marker, and
extra-modules' load by name and by path.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
An update on a device whose default boot is Android cannot try the boot image it just wrote: every Linux
boot there is a one-shot trial armed from Android (mu300-linux, the panel), and a plain reboot goes to
Android by itself. `mu300-next-boot --trial` answered "default boot is not linux, nothing to do" and
exited 0, and `unlock_for_trial` threw that away - so the update ended with "Reboot to start the updated
openwrt-luci" and the reboot started Android (U30 Air, v2026.10.17 -> v2026.10.20, 2026-10-12). The image
and the systems were fine; the reboot after it was not what anything had said it would be.
- `mu300-next-boot --trial` exits 3 when there is nothing to arm, and 1 when this slot's block cannot be
rebuilt and the initramfs' own one-shot block goes in instead (one boot, not N, FINDINGS 32) - that
arm was a silent success before. `--rearm` keeps exit 0: there, "nothing to do" is normal.
- `mu300-update` says both (`unlock_for_trial`) and keeps going either way: the image is written by then,
and a warning is no reason to roll it back.
- What `apply`, `boot`, `kernel`, `rollback` and `rollback-boot` print last is how to start Linux by hand
(`mu300-linux`) and keep it (`mu300-next-boot linux`) when a reboot goes to Android.
- `docs/FINDINGS.md` 17: what that device's init log showed (`stage=misc-restored`, no
`stage=default-boot-linux`, `.mu300/boot-tries` 0) and why nothing was broken.
Tests: `test_device_scripts.py` (`NextBoot`: the two states the arming can be in) and `test_update.py`
(`FromStock`: what the update reports for each, and the line the subcommands end with).
Based on oswaldxdd/mu300-linux v2026.10.15-charge2 (tag commit 321f771, the source snapshot under
experimental/u30air-charge2/source), reviewed and redone in our stack (FINDINGS 33l):
- mu300-power: CHARGE_TO is any whole number 0-100 (was 100|80). 1-99 stops at N % and starts again under N-5
(at once when the limit changed), 0 never charges, 100 lets go at once; never held under 5 % (the SGM41511
supplements a load its input does not cover from the battery); the temperature guard keeps the last word.
`mu300-power charge-limit [N]`. Nothing on the F50 (no battery).
- System > Power: the limit as a number 0-100, only with a battery; the charger's input current; the note in all
31 catalogs. The adapter no longer shows the F50's phantom battery.
- patch 0012 (6.18 and 7.2): bq256xx raises the input current to a Type-C source's Rp (1.5 A, 3 A taken as 2 A),
read from the UMP9620 Type-C block's STATUS: a hub or splitter with a charger behind it was an SDP, 500 mA.
On the Mac's USB-C port: 0x6082 (sink, 3 A), input 2 A, the battery at 1.6 A instead of 0.36 A.
- mu300-usb host with something on VBUS: host with the boost left off (charger + USB NIC on a splitter),
instead of refusing.
- sprd_wlan_combo: the wiphy's permanent address is the factory one from LK (it was 00:00:00:00:00:00).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
A chip reset can send FW_ERROR more than once (sprd_wlan_combo's watchdog and wcn_bsp's own reset), and every event
started its own background "wifi down; wifi up": two of them raced each other through netifd. The hotplug hook now
takes a lock in /run that names its holder; an event while a reopen runs is dropped (the running one reopens what is
there by then), and a lock left by a killed run is taken over. The Ubuntu side already had this from systemd.
Kept from the fork: the single recovery owner. Not taken: its per-radio reopen by uci phy/path, which skips a radio
whose section names neither (the MU300 has the one radio, and "wifi" without a section covers it).
Based on kanoqwq/mu300-linux@23361ce
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
From the fork's AT client, with the request framing made identical on every path:
- One request is one modem command, refused otherwise in mu300-at before anything is written and again in
mu300-atd (one_request, the same function in both; a test keeps them equal). A line feed would make the rest a
second fifo request with an answer file of the writer's choosing, and a CR a second modem command. The only CR
allowed is the PDU send "AT+CMGS=<length><CR><hex PDU><Ctrl-Z>" (or CMGW), which mu300-sms needs in one request.
The panel's unisoc-modem/at already refused CR and LF; NUL cannot be in an argument.
- -t is 1-99 whole seconds: exactly what the daemon parses. The fork allowed 1-999, and the daemon read
"120 /run/... AT" as a line without a timeout and sent all of it to the modem.
- mu300-atd parses a request strictly and drops a malformed line (it used to fall back to "the whole line is the
command"); the answer file must be $DIR/answer.<digits>.
- The client lock waited MU300_AT_LOCK_WAIT * 10 rounds of `sleep 0.1 || sleep 1`; where no sleep takes fractions
the 90 s wait became 900 s. It now ends at a deadline of the clock.
- The direct-tty path (no daemon) exited 0 after a timeout with no answer; it now succeeds only with a final code.
Based on kanoqwq/mu300-linux@25f8d0c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Both sides kept: forward_* and traffic_* in mu300dash, its ACL and the
security tests; #112's Cellular order unchanged, Data usage after it
(8); the catalogs are main's with the data usage messages added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Both sides kept: cpu_* and traffic_* in mu300dash, its ACL and the
security tests; both pages in the menu; mu300-cpu and mu300-traffic in
path-commands, build-rootfs.sh and assemble.sh; the catalogs are main's
with the data usage messages added (tools/luci-i18n.py check clean).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Flaky on the macOS runner (t=1 several times today): the budget is counted
on whole seconds of the clock and $SECONDS on whole seconds since the shell
started, so the same run can read 1, 2 or 3.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
mu300-led events listens for ubusd's object add/remove events and sets
the Wi-Fi LED from hostapd.wlan0's status whenever that object comes or
goes: wifi down/up from the shell, the panel's toggle, a WCN reset, a
hostapd that died. Before, only a wireless config reload re-synced it
(by polling wlan0 for two minutes), and "wifi down" left the LED lit.
mu300-post runs it as a procd instance instead of the reload trigger.
Ubuntu already does this through the hotspot unit's ExecStartPost/
ExecStopPost; the data LED stays mobile-data's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
A profile is a governor and a per-cluster scaling_min/max set only inside the hardware frequency table
(cpuinfo_min_freq..cpuinfo_max_freq); it never changes voltage and never touches the kernel thermal trips, so the
device still throttles at its thermal limit in every profile. "saving" caps each cluster at the highest table step
<= ~60 % of its maximum, "balanced" is schedutil over the full range (stock), "performance" pins the hardware
maximum with the performance governor. One dash/bash/busybox-ash script shared by Ubuntu (mu300-cpu.service) and
OpenWrt (/etc/init.d/mu300-cpu) applies the saved profile at boot; /etc/mu300/cpu.conf keeps it across updates.
It does not fight the rest of the power logic: mu300-power's idle "eco" still drops the big core while the device
is asleep and restores to whatever this profile set, and thermal-guard caps a hot policy a step lower and lifts it
on cool-down - but no longer above the ceiling a profile wrote (/run/mu300/cpu-ceiling), so a "saving" cap is not
undone by the cooling path (verified on the F50-B board: without the ceiling fix the cap rose a step after a hot
run, with it the cap held at 75 C idle).
LuCI: System > CPU (view mu300/cpu, mu300dash cpu_get/cpu_set, unisoc-modem/cpu adapter, ACL, catalogs); tr and
zh_Hans translated, the other catalogs carry the new ids.
Voltage offsets (the risky part of the request) are deliberately not included; the PR explains why.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The udev rule only restarted mu300-hotspot. With the device a client of
another network the hotspot is not running, wlan0 was never reopened, and
the recovery watchdog rebooted the device 70 s after the assert (seen on an
F50, v2026.10.17 test build). wcn-reopen restarts the hotspot as before,
or takes wlan0 down and up and joins the saved network again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The user asked for a Linux that never changes slot by itself. "mu300-next-boot lock" arms the Linux slot successful=1 (LK never counts a successful slot down, so it never rolls back), keeps the wish in .mu300/boot-lock on the Linux disk, and every good boot re-arms it locked. The initramfs sees the lock (the bit in misc and the file on the disk) and skips its backstop count; with no system to start it does not restore Android's slot either but waits on telnet with /run/to-android. A new kernel is the one thing that could leave a locked device with no Linux at all, so mu300-update arms the usual attempts (mu300-next-boot --trial) before it writes a boot image or rolls one back, and the first boot that reaches mu300-boot-ok locks again. "unlock" goes back to the attempts; "android" switches by hand and keeps the wish for when Linux is chosen again. A slot marked successful without the file keeps the backstop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The nft rule sits in postrouting, which fw4's software flowtable skips, so it needed offloading off. The flowtable
transmits with dev_queue_xmit, which still runs clsact's egress hook: on the mainline kernels (act_pedit, act_csum,
cls_matchall) a matchall filter there rewrites the TTL/hop limit of every packet on every sipa_eth*, and offloading
is left alone. The 5.4 vendor kernel keeps the nft backend with offloading off (ttl.offload-off records that this
script turned it off, so tc and "off" only turn back on what it turned off). matchall cannot replace a filter
(EEXIST, seen on the U30 Air), so apply deletes and re-adds; mobile-data's bring-up calls it.
LuCI: Cellular > TTL (view mu300/ttl, mu300dash ttl_get/ttl_set, unisoc-modem/ttl adapter, ACL, catalogs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The SGM41511 (a bq25601, I2C 6-006b, vendor node "ti,bq2560x_chg") had no driver under 6.18 and 7.2, so it kept
what Android left in its registers: CHG_CONFIG 0, 500 mA input. The battery never charged and drained while
plugged in. port/install.py adds the compatible to bq256xx's OF and I2C tables; patch 0009 handles that node
without a register cache, with ICHG at most 1.98 A and VREG at most 4.208 V, sets the input current from the
chip's own input detection at probe and on every VBUS change from the extcon, switches charging on unless
userspace wrote "N/A" to charge_type, and names the fuel gauge in supplied_to. Patch 0010 makes sc27xx-fgu take
its status from the charger. mu300-usb reaches the chip past the driver with -f and leaves its watchdog off.
FINDINGS 33d no longer says the chip charges on its defaults. Built for 6.18.55 and 7.2.9, untested on hardware.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
collect() ended at $(date +%s) + T, which with whole-second clocks is anywhere from T - 1 to T seconds
away. With T=1 a command written at x.995 had 5 ms: its reply came back empty, or cut after its first
line with the OK landing in the nr1 log as a stray line. That is the macOS CI flake in
Atd.test_stray_lines_while_idle_do_not_shift_the_answers (bash 3.2, every drain waits 1 s, so the
command lands at a random point of the second). The stray-line handling itself was never at fault:
the pre-command drain always takes what arrived while idle.
The deadline is now now + T + 1, also in mu300-at's direct-tty path; mu300-at's live-daemon budget
grows from T + 30 to T + 31 to keep its slack. A new test answers just past a second boundary and
failed every time before.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
FINDINGS: main's 34 (LEDs, the second F50) before this branch's 35, under its own heading. The F50 lamp states that
K68/K38 point to are on main now. Host 650 OK, busybox OK, check-i18n and luci-i18n clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
`tr < /proc/$pid/cmdline 2>/dev/null` reports a failed redirection before its own 2>/dev/null applies, so every
check of a dead owner put "/opt/mu300/bin/mu300-at: line 96: can't open /proc/7668/cmdline" into mobile-data's
radio.log lines (seen on both devices while the modem was down). The read is braced in mu300-at, mu300-atd,
mobile-data, mu300-sms and mu300-smsd.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Under set -e, L=$(cat /run/mu300/linux-slot) failing ended the script before modem_control: with a boot image that
does not publish the file (F50 #1, booted by the v2026.10.08 image), procd respawned it every 10 s and the AT
channel never answered (measured on openwrt-luci: vendor-perms, then nothing, eight times in 100 s). Now the slot
falls back to the command line as intended; with the fix the same boot registered at 30.6 s and had data at 46 s.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Conflicts kept both sides: boot/init's region marker before the usb-net and pick-root blocks; android-vendor-start
links the partitions of the eMMC found by type, through the fork-free link_partitions; the OpenWrt build links the
shared path-commands list and keeps the panel's own services and mu300-sms; no VPN engine in either image (the vpn
extra) while the panel's docker mounts stay positional; assemble.sh enables mu300-atd2 next to the update notice;
android-install keeps openwrt-luci and the extras on a legacy wipe; make-release audits both the panel asset and the
vpn extra.
The third system in main's new places: mu300-extra counts a disk with only openwrt-luci as mounted, the Magisk
installer sees an installed openwrt-luci (space, plan, MU300_BOOT_OS) and names the installed systems in its last
hint (the fixed "ubuntu|openwrt" text became the {1} form install.sh already uses). Tests that read what git tracks
skip where there is no checkout (a container with only the worktree mounted).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Conflicts: mu300-update keeps main's comment ("its boot image") and this
branch's clean_broken before the download; FINDINGS takes main's 31l
(the card slot took mmc0) before this branch's 31m (hard hangs), and 31m's
table now points at 31l instead of the mmc-order-fix branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
"wifi sync S" reads wlan0 again every 2 s for S seconds and sets the LED on every change: a hotspot LuCI turned on
can take longer than one moment to come up (the reload trigger now follows it for a minute), and the Wi-Fi button
on OpenWrt ran "wifi up" with nothing to light the LED afterwards. "mu300-led test" now includes the F50's Wi-Fi
light, and thermal-guard says the siren is red, white and blue. The kmsg-forward test filters only where grep has
--line-buffered (GNU's: the script runs on Ubuntu alone).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
With a live daemon mu300-at could wait 12 s for the lock and T + 30 = 38 s for the answer, so rpcd killed the call and
the page showed a generic failure. mu300-at takes MU300_AT_BUDGET to shorten (never lengthen) its answer wait; the
panel sets both limits for its AT call only, and a budget that runs out is a translated busy reply saying the command
may still run (final review minor 4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
mobile-data gains radio-locked CMD (CMD under the lock radio_on takes, held by mobile-data itself, so its
lock_owner_alive and reaper keep working unchanged; 75 when busy) and radio-busy. The action adapter runs its radio
ops through it and the backend refuses them with a translated "busy" before detaching; a lock apply's or late
replay's SFUN restart waits up to two minutes for the dial or the watchdog instead. Without mobile-data the panel
runs as before (final review minor 3, K57).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Any answer without OK ended every radio round before CFUN, for the whole boot, on a firmware that refuses the
handshake. A final ERROR, +CME ERROR or +CMS ERROR is now logged, the once-per-boot marker written and the round goes
on; only no answer (a timeout, the client lock busy, no final result code) still ends it. All systems (final review
minor 2, K57).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
It read with --follow-new, so the early call traces (seconds before the service starts) never reached the
journal; a restart still forwards only what is new. With an ignore list, "exec" in the pipeline replaced only a
subshell, and the unfiltered dmesg ran once the filtered one ended. The README says where the warnings are:
journalctl -t kernel (journald has ReadKMsg=no, so -k shows nothing).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The F50's Wi-Fi light is the PMIC's keypad backlight sink (ZTE lights it at 48 of 127 while the hotspot is up);
mu300-led mapped no Wi-Fi LED on the F50, so it stayed dark. "wifi sync" reads wlan0 back, and OpenWrt runs it after
a wireless reload (LuCI turning Wi-Fi off or on). mu300cell no longer turns a 5G connection blue with "data on", and
the watchdog keeps red while there is no service. Measured on both F50s: every state read back from /sys/class/leds;
F50 #1 (OpenWrt) LuCI-style off/on: 48 -> 0 -> 48.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
K12, K67 (K10 stays c). Ported from the kanoqwq fork: cd4fb28 (--fast-run, usb-ready one-shot), 4e70d02 (role check, configfs mount, --ready).
mu300-usb-reset keeps --if-no-lease and the 20 s re-enumeration stays; mu300-post runs the usb-ready one-shot in addition to --if-no-lease.
The K12 gate (macOS, Windows 11, Linux, 5 boots each) is deferred to the device phase.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
R35, from Task 23's review:
- up()'s lock had the empty-pid moment the radio lock lost in Task 23 (a directory with a pid file: a waiter that
read an empty pid removed a lock that had just been taken). The radio lock's code is now lock_take/lock_drop
over lock_owner_alive/lock_reap (renamed, same bodies), used by radio_on and up() alike; the up lock is the
symbolic link /run/mu300-mobile-data-up.owner, waited for MU300_UP_LOCK_WAIT real seconds (150). down() reads it.
- The dial calls sipa-dele-start and marks dial-sipa-dele only when /lib/modules/<release> has sipa-dele.ko (or
extra/sipa-dele.ko), as kanoqwq/clean-tf-7.2 checks (cd4fb28), so the mark is truthful; without it radio.log
says so and the dial goes on.
Tests: a bring-up holder killed mid-round and two waiters (one round at a time, nothing left), the holder named
from the start, the wait giving up with the holder's pid, the dial with and without the module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
* init: the eMMC serial only from androidboot.emmcid. The /sys CID fallback ran before the modules that find the
eMMC, so it would have come and gone between boots; without the argument the identity is the serial number alone.
An emmcid without a serial number no longer gives "MU300LINUX--<emmc>".
* mu300-update: fetch_stdout retries only a failed connection (curl 6 7 35 52 56, GNU wget 4). A timeout (28) had
been retried by curl already; four more rounds held "check" for half an hour. A 404 through wget is not retried.
* mu300-at: a test of the loop itself (a writable directory, a dead owner's lock that cannot be removed: "busy").
* build-wlan.sh: a Wi-Fi patch either applies or is applied already, as in upstream/build.sh (it was `|| true`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
K45, K46, K47, ported from kanoqwq/clean-tf-7.2 cd4fb28 (the CFI panic the spec cites with 45222e6), for
every system rather than OpenWrt only as in the fork: Ubuntu (mu300-extra-modules.service), OpenWrt and
openwrt-luci (init.d/mu300-hw) all run the same extra-modules, which no longer starts sipa-dele-start.
- extra-modules: the background start is gone (K45).
- sipa-dele-start: refuses with exit 1 after MU300_DELE_WAIT instead of loading anyway (K46); an insmod
failure is exit 1 too; the wait is a deadline in seconds (date +%s), not a count of 2 s rounds; the dmesg
sbuf-line precondition is dropped (the caller has just registered over the AT channel, and a late first
dial could find the line gone from the ring buffer).
- mobile-data up_locked: after "registered" and before CGDCONT/CGACT, when sipa_dele is not in
/proc/modules, runs MU300_DELE_WAIT=20 sipa-dele-start (log /tmp/mu300-sipa-dele.log); a failure ends the
attempt (radio.log, led error, exit 1) without a PDP context (K47).
Ruling R32, radio_on's lock:
- The lock is a symbolic link /run/mu300-radio-on.owner -> owner pid, made in one step, so it never exists
without its owner (no empty-pid grace and no race on it).
- A dead owner is taken over through radio_reap: only the waiter that creates the marker LINK.dead.PID may
remove the link, after looking again under the marker, so two waiters that saw the same dead owner cannot
remove each other's fresh lock. A dead marker maker is reaped the same way one level down.
- MU300_RADIO_LOCK_WAIT is a real-seconds deadline ($SECONDS).
Tests: SipaDele (extra-modules never starts it; refusal without insmod; both module layouts; insmod
failure; already loaded); MobileData: delegate between registration and CGACT and the dial stops on
failure; two waiters on a killed owner's lock run one state machine; the lock names its owner from the
start; the lock wait in seconds.
Device cycles (10 down/up per device and system, dmesg CFI/panic count, lsmod) are deferred.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
K57: radio_on waits (30 s at most) for nr0's first URC, sends AT+SMMSWAP=0 to the nr1 daemon once per boot
(/run/mu300-ril-handshake), sends no AT+SFUN when AT+CFUN? is unanswered, and after AT+SFUN=4 waits for
"+CFUN: 1" (30 real seconds) before the SFUN=2/SFUN=4 power cycle. A lock (/run/mu300-radio-on.lock) keeps two
radio state machines apart; the second caller waits for the first (120 s) instead of the fork's 8 s, since a
dial that gives up costs netifd's 20 s pause.
K58: AT+CAVIMS=1 after the radio is on, in up and in radio-on.
K65: the unisoc-modem plugin's early lock replay ($PLUGIN_LOCK, MU300_PLUGIN_LOCK in tests) runs between the
radio-off answer and AT+SFUN=4; the pending marker is cleared on success only.
K66: `mobile-data radio-on`. K20: mu300-atd's radio-warmup instance runs it once nr1's daemon reads commands.
Ported from kanoqwq/clean-tf-7.2 cd4fb28 and 6404c10 (tests/test_early_replay_hook.py, paths adjusted).
R30: the CGACT=1 comment says only a timeout ends the bring-up; the address waits state their real worst case
and fetch_addr no longer sleeps past its budget; at() writes its own pid (not the parent's $$) into the AT lock,
so operator_log's background query owns the lock it holds. A modem reset during the registration wait is left to
the next attempt, which starts with radio_on (as in the fork).
Gate K57/K58 (cold boots, SMS) is deferred to the device phase.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn