upstream/parity-5.4.txt maps every module, built-in object and run-time item of the
5.4 kernel that mainline does not have under the same name: ok (the module or
config symbol that stands for it, and where it binds on 7.3), missing (porting
group and boards) or na (the reason). upstream/check-parity.py enforces it:
build-modules.sh and make-bundle.sh fail when a named equivalent or a same-named
5.4 module is not in the mainline build; kernel/build-all.sh records the 5.4
build (parity/5.4-build.list, with a hash of its inputs) and fails on an item the
file does not cover; tests/test_parity.py (Tests workflow) checks the file against
those records, parity/mainline.list and the boards' inventories
(parity-inventory.sh on F50-B under 5.4 and 7.3, the U30 Air under 6.18).
Config-only gaps taken: GENERIC_ADC_THERMAL (board-, chg-, nr- and pa-thmzone, no
trips in the vendor tree), CPU_FREQ_GOV_CONSERVATIVE, USB_CONFIGFS_SERIAL,
USB_CONFIGFS_ECM_SUBSET, USB_CONFIGFS_F_HID. Built for 6.18.59, 7.2.13 and 7.3;
7.3 booted on F50-B: the four zones bound (35-38 C), gser/hid/geth functions
created, the conservative governor selectable. FINDINGS 234.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
Ported from kanoqwq/mu300-linux 149c9d2a, 3cbf37fc and 0438ab01: his 5.4 versions of the fixes
we made for mainline only (FINDINGS 92, 93, 103). Seven patches to the vendor trees:
wlan_combo-tx-retry, sprdwcn-tx-pending-backpressure, wlan_combo-skb-headroom,
wlan_combo-special-data-prefix, wlan_combo-ipv6-multicast-data, wlan_combo-stale-tx-ratelimit,
sdhci-sprd-dma-ordering. All apply with --fuzz=0 after ours.
His backpressure patch was written on top of his diagnostics patch (not taken); rebased onto the
pristine tree, with the #339 changes mainline's wcn_bsp has since: the full ring logged once a
minute, a failed direct push no longer leaves the channel refusing, and -EAGAIN is not logged as
"push link fail".
F50-B, 5 boots on 5.4.254: the 204+203 "push link fail"/"tx return err" lines one traffic test
produced are gone, Wi-Fi up every boot, client traffic both ways, IPv6 multicast/RA, SD read and
eMMC write/read-back equal, no mmc errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
Ported from kanoqwq/mu300-linux, adapted to this tree:
- make-bundle.sh refuses a vendor module whose source changed after it was
built: a file of upstream/modules/NAME newer than build-modules.sh's
modules/NAME.log (265f4de3, f6b0668d). His check named three modules
and compared with the .ko; the build logs cover every module directory.
- build-wlan.sh stops on a Wi-Fi tree whose .mu300-patches marker names
another patch set, instead of building the old patches (f0926715).
- build-all.sh's patched_copy removes only its own copies (f0926715).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
* Remove call-audio integration and DSP-only kernel reservations
Remove the official audio extra from installation, update and kernel-switch paths. Drop call-only DSP memory reservations, patches and virtual sound-card configuration, and update current user documentation.
Retire previously installed audio extras through their uninstall hook before changing systems or kernels. Keep generic USB audio, Bluetooth, AT ownership, SMS and mobile data support.
* Update panel integration test after removing the audio extra
dscr_ring_empty() returned "empty" for every valid hardware cursor (an inverted
IS_ERR_OR_NULL test), so edma_rx_push_isr() never popped a completed descriptor
and only refilled the ring. As ZTE's U30 Air wcn_bsp.ko does: read the cursor
once, pop what is complete, then refill. Mainline source, and the same change
for 5.4 as kernel/patches/wcn-pcie-rx-push-cursor.patch (FINDINGS 195).
From kanoqwq's clean-tf-7.2 2d3f7438 (the edma_pending_full counters of that
tree are not part of this).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
The owner's decision: the call-audio stack is a module of its own, github.com/dikeckaan/mu300-audio, installed with
`mu300-extra install audio` like the VPN module.
Gone from here: the 5.4 audio patches and kernel/build-audio.sh, upstream/modules/sprd_audio (and its place in
build-modules.sh), mu300-audio-dsp, mu300-voice, the mu300-audio service, modprobe.d file and OpenWrt init script,
tools/pcmhost, tools/ctlset, tools/hfp, and their tests (they live in mu300-audio now). The release audit refuses a
kernel bundle with a driver of the stack and an image with its programs or services.
Stays in the kernel, because no module can do it: the DSP's memory reservation (of-reserved-mem-add, 0022) and the
ALSA/ASoC/dmaengine core options the extra's drivers are built against.
mu300-extra/mu300-update: the audio extra - one tarball per kernel (mu300-audio-KERNEL.tar.gz), the one of the
kernel choice, verified against its release's SHA256SUMS through the VPN module's code (module_get, module_install,
hooks for every system), --from FILE|DIR offline; the DSP firmware fetched along with its pinned sha256 (opt-out
MU300_AUDIO_FIRMWARE=none, your own image =FILE, offline agdsp.bin next to --from); `mu300-update kernel X` and
rollback-boot take the extra of X along (audio_follow); an update of a device that uses call audio installs the
extra before switching the systems, and says loudly when it cannot (never fatal); `mu300-update check` and
`mu300-extra list` say when it is missing or for another kernel. Tests for all of it in test_extra.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
A TERM to a running mu300-voice call/demo/echo left its aplay/arecord holding the voice PCM, and the next run
failed with "Resource busy". Every player is now a waited-for background child that TERM, INT, HUP and exit end;
a busy PCM held by a leftover of an earlier run is ended and retried, anything else is reported. An open that
fails with EIO is tried once more (a fresh open, never a restart after an xrun).
The EIO itself: each play into FE_ST_VOICE_PCM_P leaves two KCTL_SET replies the driver never waits for, and
aud_recv_cmd() failed a STARTUP on the first reply for another command, so five queued failed the next
FE_ST_DUMP open. A reply for another command is now dropped and the wait goes on within the same timeout; the
drain reads until the cache is empty. The same change for 5.4 as kernel/patches/audio-sipc-stale-reply.patch.
Both reproduced on F50-B (7.2.11) without a call; the script fix measured there, the driver fix unit-tested
against a fake message cache and built for 7.2.11 and 5.4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
build-linux.sh and build-u30air.sh piped make through grep and tail, so the
status was tail's: a sipa_eth.c compile error still reported success and the
previous build's .ko were collected as new. make now writes a log, the same
filtered lines are printed from it, and make's status decides.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
On an idle F50 the vendor 5.4 kernel printed 472 lines a minute and filled OpenWrt's 128 KiB logread in about two
minutes: ~30 info lines per IPA idle power-down/wake-up round trip (every 10-15 s, including "fail to send, ret
-115" at error level for the normal -EINPROGRESS of a resume), the Wi-Fi driver's per-TX-completion and
per-command lines, and the WCN loopcheck. These are pr_debug/dev_dbg/netdev_dbg/WCN_DBG now (dynamic debug brings
them back); a failed send other than -EINPROGRESS stays an error, rate-limited, and the flow-control switch knows
-EINPROGRESS. The mainline modules had the same IPA and WCN lines (F50-B, 7.2.11: 203 a minute) and get the same
change. 90-mu300 raises logd's buffer from a stock size to 1024 KiB.
F50-C (OpenWrt, 5.4): 472 -> 33 kernel lines a minute (41.5 -> 3.5 KB); logread holds the whole boot.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
From kanoqwq's f59a296, reviewed:
- sprd_wlan_combo (mainline module and kernel/patches/wlan_combo-ap-stats-scope.patch for 5.4, --fuzz=0):
in AP/P2P-GO mode get_station answers -ENOENT unless the MAC is one of this interface's peers, and nothing
filled in for one (it handed out the interface's counters and the station side's signal for any address);
dump_station refuses a negative index; get_channel answers for link 0 only (links[link_id] was unchecked).
- sc27xx fuel gauge, patches 0011 and 0018 reworked: the user area written with regmap_update_bits() as the
U30 Air's stock module does (save_last_cap at 0x4ba4, disassembled here) with the stock wait after the
release; no migration guess for a valid saved value; the charger's Full is 100 % while the battery current is
within the node's fullbatt-current. His 4.2 V / 0-120 mA condition is not taken: it runs after the charger's
termination and would refuse the one Full measured here (4.146 V at rest, FINDINGS 33d).
Co-Authored-By: kanoqwq <kanoqwq@qq.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
The PMK record hostapd imported came in the same EVT_NEW_STATION element list as the client's own
association-request elements, with no boundary: a client could append a forged record and finish the
4-way handshake without the passphrase whenever the firmware does not append its own. It cannot be
shown safe, so the owner disabled it (2026-10-17).
- driver (mainline tree; kernel/patches/wlan_combo-softap-no-sae.patch for 5.4): sprd_report_softap()
drops every dd ..40:45:da:04 element (and a malformed tail) before cfg80211_new_sta(); the vendor
command that gave the firmware the SAE password (subcommand 43) returns -EOPNOTSUPP
- hostapd patch and its SDK recipe removed; build-rootfs.sh refuses MU300_SAE_APK_DIR
- openwrt/patches/wifi-scripts-wpa2-only.patch: an access point asking for sae, sae-mixed, sae-compat,
psk3(-mixed) or the u30_sae_offload option is not started, with a line saying WPA2-PSK only
- openwrt-wifi-wpa2-only migrate (replaces openwrt-wifi-sae-guard, at boot before wifi up): SAE becomes
psk2+ccmp with the same password, or the access point goes off (never open) without a usable one;
one log line and /etc/mu300/wpa3-disabled
- a LuCI notice (Status > Overview and the panel's home; en/tr/zh) with a Dismiss button
- mu300-api switches a hotspot still on SAE to WPA2 on save (refused without a password); Ubuntu's
hotspot-start refuses WPA3 in hotspot.conf
- docs: U30AIR-SAE.md is now "disabled, why, what revisiting needs" (credits kept), README, wiki, site
en/tr/zh, FINDINGS 80 updated and 163 added
- tests/test_wpa2_only.py replaces test_u30_sae.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
sc2355_send_cmd_recv_rsp() returned 0 with nothing sent when the command lock was refused and in
the two blocked windows (after the last CLOSE, during an interface type change), the blocked ones
with *rlen left as the caller set it: sc2355_get_station() then handed its uninitialised reply
structure (kernel stack) to nl80211 GET_STATION, which any local user may ask. Now -EIO / -EBUSY
with *rlen 0, and get_station's reply starts zeroed. Mainline module, and the same change for 5.4
as kernel/patches/wlan_combo-unsent-cmd-error.patch.
After kanoqwq's clean-tf-7.2 0e19fe32 (the return values among his SAE changes); his firmware-SAE
bridge is not taken (FINDINGS 106).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
mu300-voice: main's SIM slot (the URC log of the active SIM's channel) kept beside this branch's
root-only run directory. FINDINGS 24c keeps its place in the audio chapter: no section of main has
that number.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
The nft "queue" statement was missing on the vendor 5.4 kernel
(NETFILTER_NETLINK_QUEUE=y, NFT_QUEUE not set), so the nftables mode of
sing-box based proxies on OpenWrt fell back to TUN. OpenWrt's
kmod-nft-queue is built for its own 6.12 kernel and cannot load here.
Built in, like every other CONFIG_NFT_* of the fragment (5.4 has all of
nf_tables built in), so there is no module to package or load. Its only
dependencies, NF_TABLES and NETFILTER_NETLINK_QUEUE, are already =y.
kernel/linux.config (the config the build writes back) gets the same
line by hand; the next build rewrites it.
Not built here: the v2026.10.23 release build validates it
(fragment-rejected.txt must not list NFT_QUEUE). The mainline kernels
already have NFT_QUEUE=m.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
Fixes#103: the Unisoc CONFIG_XFRM_FRAGMENT code kept its second sysctl header and table in two static pointers,
overwritten by every network namespace's init and unregistered and freed by whichever namespace exited first, so
with two namespaces alive (Docker, a sandbox) the second one's exit walked a freed header in count_subheaders or
freed the table twice (slub.c:308), under "Workqueue: netns cleanup_net". The entry is now the fifth member of the
per-namespace xfrm_table (the reporter's candidate fix, tested over 460 lifecycles on an F50); the switch stays one
global integer. No upstream fix to take: the option is vendor-only and linux-5.4.y has not touched this file since
2017. BUILD.md points at KPATCHES instead of a stale hand-written list of three patches; FINDINGS §44 has the trace,
the mechanism and the reproduction (two namespaces torn down at once).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The driver prints at KERN_ERR what is ordinary operation: every poll of cfg80211's survey (sc2355_dump_survey
traces the data and the empty list, two lines every few seconds while anything reads the survey - the lines of
issue #140), the per-mode default of find_lut_index for a multicast or broadcast frame (no peer entry by design),
the short-frame copy path of mm_normal_data_process (an ACK-sized buffer is smaller than skb_shared_info plus the
aligned payload - the vendor's "should not happen" fires for most small frames), the defrag cache sweep when a peer
leaves, every EAPOL frame of a (re)association, reordering drops of a retransmission the window already moved
past, the firmware's DELBA for a session the host no longer has, and the duplicate ACKs the TCP ACK filter skips
(three per fast retransmit). On a 12-minute F50 STA session these were 35 of the 43 wlan lines at err level.
All of them are pr_debug/netdev_dbg now (ratelimited where per-packet), the module's own level stays as it is. The
real errors next to them keep theirs: mm.c's "too short" and "alloc skb fail", the BAR-for-unknown-session twin
of the DELBA line, the command status failures.
Mainline: upstream/modules/sprd_wlan_combo, the edits in place as before. 5.4: kernel/patches/
wlan_combo-routine-not-err.patch, level changes only, generated against the tree with the other wlan_combo-*.patch
applied (it sorts after wlan_combo-logspam-quiet, which already took dump_survey's idx/time/count lines); the whole
set applies with --fuzz=0 and no rejects on the pristine realme tree. The mainline module builds against 7.2.9
(build-modules.sh, modules only). test_static guards both.
Fixes#140
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Based on kanoqwq/e5-linux@13b485c (0013-pcm-period-timer), @74be52a (0016-pcm-pointer-agcp-access),
@6e4377e (0017-capture-dsp-s16-only) and @cd4a536 (0019-fast-play-s16-only, 0020-mcdt-fe-interleaved-only),
ported from the E5's 5.15 vendor tree to the realme 5.4 audio_driver tree build-audio.sh uses.
The E5 measured the stall of docs/FINDINGS.md 24 too - both sprd_dma lines at 0 for a whole stream - and
ticks snd_pcm_period_elapsed() from an hrtimer with the DMA programmed without interrupts, as Android's
PCM_NOIRQ streams run. The position is read only while agdsp_can_access() says the AGCP domain is up (the
bus hang of 24), and the DSP front ends offer only S16_LE / interleaved where the DSP takes nothing else.
The three patched modules build against the 5.4.254-gb50db5b6224c tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
AgentFan0315's two printk-level patches (https://github.com/AgentFan0315/f50-openwrt, kernel/patches), with
attribution in each file's header. logspam-quiet.patch joins KPATCHES; wlan_combo-logspam-quiet.patch is picked up
by the wlan_combo-*.patch glob. Every changed line only lowers a level (dev_/pr_/netdev_ err|warn|info to their
debug form; wlan_combo's sprd_dbg_level starts at L_ERR); CONFIG_DYNAMIC_DEBUG is on, so each line can be turned
back on at runtime. No script greps for any of them: hotspot-verify's "rsp[CMD_START_AP]" is a different, untouched
pr_info, and the demoted lines already in /etc/mu300/kmsg-ignore stay listed there for kernels built before this.
Left out of the originals:
- WCN_INFO in sprdwcn/include/wcn_dbg.h: it demotes every WCN info line, including the start_marlin/stop_marlin
power timeline that the FINDINGS 31n and 14b diagnoses were read from.
- charger-manager's "stop charging due to battery overheat or cold" and "battery overheat or cold is still
abnormal": the only kernel record of a JEITA charging stop on the U30 Air, and not seen repeating on the F50.
- wlan_combo cmdevt.c's two pr_err "cmd->refcnt" in the response path (an event dropped while the driver exits, a
failed kmalloc): error paths, not periodic; the 6.18 port keeps them as pr_err.
Both apply to the pinned trees with GNU patch 2.7.6 (b50db5b; 4381465 in glob order with the other wlan_combo
patches, the pcie.c hunk renumbered to the pinned line). Not yet built or run on a device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
Actions > Release > Run workflow on main with the tag: the job builds the 5.4 kernel (kernel/build-all.sh), the
mainline 6.18 and 7.2 kernels with their modules, keeps the kernel outputs in the Actions cache by the tree they were
built from, runs tools/make-release.sh --publish --prerelease and dispatches the Magisk zips (a release made with the
workflow's token does not start that workflow by itself). It refuses a ref other than main and a tag or release that
exists, so a side branch can never be tagged again and a published release's assets are never built over; its
permissions are the job's only. The config merge logs of a failed 5.4 build are uploaded as an artifact.
kernel/build-all.sh: on a Linux docker the container's outputs are root's, so they are handed to the user through the
build image before the copy, the cleanup of the scratch copy no longer fails a finished build, and MU300_KBUILD_LOGS
names a directory that keeps the merge logs and the rejected fragment options the cleanup would otherwise remove.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
build-all.sh copied wlan_combo and the Bluetooth driver once and patched the copies in place, so a second
run in the same volume failed: wlan_combo-pcie-post-init-retry neither applied nor reverse-applied, because
a later patch had moved its lines, and build-wlan.sh stopped. The Bluetooth loop hid the same case with
"|| true". Both copies now carry .mu300-patches with the hash of their patch files, like the kernel tree,
and are copied afresh and patched in order whenever the hash differs. build-wlan.sh patches only a tree
without the marker (the by-hand route in BUILD.md).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
F50 #1, OpenWrt on 6.18.55, 1 hang in 20 reboots. pstore had an Oops in hard IRQ: pcie_rx_handle+0x34,
"paging request at 00000000000030b8", reached from msi_irq_handle via mchn_hw_pop_link. The probe powers the chip
off after it registered wlan0, outside RTNL. netifd opened the new AP interface 130 ms later, while that power-off
was still in post_deinit. The open's power-on registered the channels, then the probe's power-off cleared
sc2355_hif.hif and stopped the chip, and the next RX read through NULL. power_cnt was atomic; the transitions
behind it were not.
- sprd_iface_set_power holds hif->power_lock across the whole transition.
- pcie_rx_handle drops a list without a context and logs it once.
- sc2355_hif.hif uses a release store and acquire loads, and is cleared only after the channels are unregistered.
- Review findings: probe's error paths and remove powered off after sprd_core_free had freed hif (now before),
and a power-on that failed in post_init or the version sync stayed half up with the count at 0 (now undone).
- The same change for 5.4: kernel/patches/wlan_combo-wcn-power-serialise.patch.
F50-B, 6.18.55 with the fix:
- 30 soft reboots, 0 Oops: 14 hotspot boots, plus 16 Wi-Fi client boots with a unit that opens wlan0 inside the
probe's power-off (all 16 hit the window).
- 30 hotspot restarts, 0 Oops.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
The vendor wlan_combo reads Android's /mnt/vendor/wifimac.txt, which Linux does not have, and fell back to a random
40:45:da address on every boot. The mainline port already reads LK's androidboot.wifimac; this patch does the same
under 5.4. Measured on the second F50 (module built from a private copy of the source): 40:45:da:0a:05:a8 before,
5c:7d:ae:b4:0b:d0 (its bootargs) over two reboots, still a client of its Wi-Fi network.
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
The unwind took 0 .. chn-1 and left the channel that failed registered with half its EDMA state (mchn_init sets
ops before edma_chn_init). It takes chn .. 0 now. Deinit of a channel whose EDMA init failed after an earlier power
cycle met a pool with no memory but that cycle's size, and memset(NULL) oopsed: mbuf_pool_deinit returns at once
then (wcn_bsp; 5.4: sprdwcn-mbuf-pool-deinit-null.patch). Both 5.4 patches checked to apply and to compile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
sipa-delegate-pm-runtime.patch and sipc-debug-once.patch join KPATCHES; wlan_combo-pcie-post-init-retry.patch
(the fork's, with the unwind fix) is picked up by build-wlan.sh. Applied to the pinned tree and compiled
(sipa_dele_cp_in_ap.o, the four sipc objects, sc2355/pcie.o); not yet run on a 5.4 device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
- Windows (fixes#7): a clone with core.autocrlf=true checked the device scripts out as CRLF, and Android's sh
ran none of android-install.sh ("unexpected 'do'"), with an empty log. .gitattributes keeps text LF on every
system; install.ps1 pushes scripts through PushUnix, and build-boot-image.py writes init, ueventd-perms.sh and
the module orders with LF, for clones made before. Checked on Windows: 5 of 5 scripts CRLF on main, 0 now.
- Wi-Fi (#8): the vendor driver had no dump_station, so iw, iwinfo assoclist and LuCI's Associated Stations
were empty although hostapd had the clients; nor get_channel ("Channel: 0"). dump_station lists the firmware's
peer table entries of the AP (address only: the firmware gives no signal or counters), get_channel returns
what cfg80211 kept from start_ap. Mainline copy and a 5.4 patch; the channel checked on the F50 under 6.18.
- A U30 Air restarted every ten minutes after mu300-linux from Android: boot_b's device segment, which
mu300-update keeps, still held an old experiment's --trial-guard. The generic segment carries an empty guard
file that replaces it; an experiment's guard goes last, into a segment of its own. Checked on the U30 Air.
- mu300-nfc on|off: ZTE's NFC switch is bit 5 of the tag's configuration byte 0x3bf (found by reading the chip
with the switch on and off); set, phones get nothing. mu300-nfc says so. Checked on the U30 Air.
- Tests: CRLF inputs, no plain adb push of scripts, the empty guard, NFC on/off. FINDINGS 33g, 33h.
Fixes#7
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
The U30 Air is the F50's board (ums9620_2h10_feimao) with a battery and ZTE's SQC charger stack. On the F50 set of
modules its charger manager never probed and USB stayed down. Now:
- kernel/u30air.fragment + build-u30air.sh: the stock U30 Air config differences, built as modules next to the
MU300 build (the Image stays the same; vmlinux exports are compared), keeping only the 15 modules that differ
- boot/module-order-u30air.txt and --device-modules/--device in build-boot-image.py; init picks the set from
/etc/mu300-device or the device tree (charger_policy_service), only for the kernel it was built for
- init looked for misc and boot_b before the vendor modules loaded sdhci-sprd: the lookup waited 20 s for
nothing and slot a was never restored, and there was no persistent log. It now runs after the modules.
- installers and uninstallers accept the U30 Air; tools/backup-full.sh backs up a whole device before a port
Tested on a U30 Air (5.4, Ubuntu 24.04): 93/93 modules, USB network, Wi-Fi AP, Bluetooth, battery and charger
in /sys/class/power_supply, system "running" with no failed units, misc restored at 12 s.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
A PCIe scan that timed out removed the half-probed card, and sprd_pcie_remove() completed remove_done, which only
sprd_pcie_remove_card() initialises: an oops in __wake_up_locked and a panic, back to Android (caught while
rebooting OpenWrt on 5.4 for v2026.09.29). remove_done is initialised before each scan, remove guards against a
probe that set no data, and a timed-out scan is retried once.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
Testing v2026.09.29 caught OpenWrt on 5.4 falling back to Android: "Kernel panic - not syncing: CFI failure
(target: 0x0)" in dele-4-5, the delegate's connection thread - FINDINGS 31f, which was fixed only in the mainline
copy of the driver. The 5.4 tree gets the same change as kernel/patches/sipa-delegate-einprogress.patch.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
- installer choice 3 installs the newest stable mainline kernel (7.2.8 for now) the way 6.18 is installed;
mu300-update kernel 5.4|6.18|7.2; the release carries mu300-kernel-7.2.tar.gz next to the 6.18 one
- upstream builds keep each kernel's outputs apart: OUTDIR=out-7.2 for build.sh/build-modules.sh,
MU300_UPSTREAM_OUT for make-bundle.sh; make-release.sh packs both and checks each build's version
- 7.x: trusty and six Mali workqueues declare WQ_PERCPU (7.x warns about queues that say neither); a Mali queue
name within the 31 characters
- 5.4: the Wi-Fi complock (irqsave) and Bluetooth tty port fixes as kernel/patches, applied by build-all.sh
Tested on the device: 7.2.8 on OpenWrt and Ubuntu with an empty dmesg, mobile data, hotspot, Bluetooth, GPU.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeuDBrAce8rrgSJDbFJQGN
With RNDIS in configuration 1 and NCM in configuration 2, macOS chose configuration 1 (measured:
kUSBCurrentConfiguration 1), found no driver for the RNDIS control interface and had no network. Windows only
ever uses configuration 1 as well, so no order serves both. The single NCM + ACM configuration does: measured
from boot on macOS (AppleUSBNCMControl/Data, DHCP, SSH and internet over USB, no "inactive" link as with ECM)
and live on Windows 11 (UsbNcm.sys). MU300_USBNET="rndis ncm" keeps the RNDIS layout for Windows without NCM.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The gadget offered ECM, for which Windows has no driver. Now:
* NCM replaces ECM as the network function (ECM stays the fallback, MU300_USBNET=ecm restores the old gadget),
and the device class is IAD (0xEF/2/1) so Windows' composite driver keeps each function's interfaces together.
Tested live on the device: Windows 11 bound its inbox UsbNcm.sys, took a DHCP lease and reached the device and
the internet; the ACM console stayed COM4.
* RNDIS for every Windows from 7 on, in configuration 1 with MS OS descriptors (compatible ID RNDIS/5162001) -
Windows only ever uses the first configuration - and NCM in configuration 2, which Linux and macOS take, as with
g_ether. boot/init renames the netdevs after binding (RNDIS registers first and would take usb0): usb0 stays
the CDC link, rndis0 joins br-lan too.
This needs CONFIG_USB_CONFIGFS_RNDIS, now in the kernel fragment. Unisoc's sprd_usb_f_rndis module cannot stand
in: with CONFIG_USB_PAM it hands the data path to the IPA on connect, so its netdev never passes a packet
(measured: Windows bound it, rndis0 stayed at 0/0). Without the stock function boot/init builds the single NCM
configuration, as before.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two mistakes stacked, and each one hid the other.
The patch was first written into audio_mem_whale2_parse_dt. This board's node is
compatible = "unisoc,audio-mem-sharkl5", so the code compiled, loaded, accepted
its module parameter and never ran. Moving it to the sharkl5 parser was the
obvious fix and it still did nothing, because of the second one:
build-audio.sh guarded the patch with `grep -q shm_shift`, and the first version
had already put that string in the tree - so the corrected patch was never
applied. The module kept the pr_info string from the old build, which made
`strings audio_mem.ko` look right while the call sat in the wrong function.
Then the regenerated patch would not compile: it had been diffed against a tree
that already carried the draft, so the declaration came out as a *context* line
and only the helper was an addition - putting the helper above the variable it
uses. It is now generated against pristine + audio-mem-fixed-region, which is the
base it actually builds on, and the guard keys on the function name instead of a
string an earlier version also had.
It works now: "moved the shared-memory addresses down by 0x100000, cmdaddr is now
0xaf880000", with smsg, aud-str, dsp-vbc and reg-dump following, all matching the
Moto G35's device tree.
Which turns that experiment into a clean negative. At its own addresses, its own
7 MiB region and its own shared memory, the Moto image still never answers, while
the donor image answers on the first try at this board's addresses. Whatever it
wants beyond a matching memory map, it is not the addresses.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
Why the Moto G35 image takes this device down, from its own device tree rather
than a guess: pulled out of vendor_boot.img in the same firmware, it puts
audio-mem at 0xaf600000 and a 7 MiB DSP region at 0xaf900000, with cmdaddr
0xaf880000 - a megabyte below this board's 0xaf700000 / 0xafa00000 / 0xaf980000.
Written to the wrong base the image runs into memory belonging to something else.
Read the other way it is reassuring: the donor image answers SIPC at 0xaf980000,
so it is built for this layout and is where it should be.
CONFIG_OF_RESERVED_MEM_ADD now reserves 0xaf600000,3M;0xaf900000,7M, contiguous
to 0xb0000000 and a superset of what this board uses, so one boot image can host
either. audio-mem-shm-shift.patch adds shm_shift for the addresses that are
absolute in the device tree instead of derived from the region - ddr32_base and
dspbin_base already move everything else.
The experiment itself is inconclusive rather than negative. At its own addresses
the Moto image no longer takes the board down and ldinfo reads 0xaf900000 /
7340032, but the DSP does not answer and shm_shift is not confirmed to have
taken effect - cmdaddr still shows as 0xaf980000 in the SIPC trace. FINDINGS says
so, along with two things that cost time here: audio_mem has three DT parsers and
this board uses the sharkl5 one, so a change made in whale2's compiles, loads,
accepts its parameter and does nothing; and the boot service loads audio_mem at
startup where it is [permanent], so trying another layout needs the service
disabled and a reboot first.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
kernel/patches/mcdt-enable-clock.patch: check_agcp_mcdt_clock() reads BIT_MCDT_EN
and, when it is clear, every MCDT accessor returns early without touching the
hardware - so MCDT gets configured into a void while setup still looks like it
worked. Nothing in the driver set writes that bit. Since the driver already holds
the regmap and knows the bit, have it enable the block it is about to program.
The write only happens when the bit is clear and the result is read back, so a
controller that genuinely cannot be enabled still reports false.
mu300-audio-dsp gains a "profiles" command. The kernel takes the DSP parameters
through request_firmware(), so tools/vbc-profile's output in /lib/firmware is all
it needs, and the select value matters: (mode << 24) | (param_id << 16) | dsp_case
does nothing visible with param_id 0, but with 0x5e - what a working device of
this family carries - the mode is copied into the DSP's shared memory at
sprd,shmaddr-dsp-vbc. The mode numbers are call scenes (Handset, Handsfree,
Headset, BTHS, ... each NB/WB/SWB/FB/VOIP); there is no media mode in there at
all, which is worth knowing before chasing media playback through them.
FINDINGS records the reference comparison. A ZTE MU5358 registers the same
sprdphone-sc2730 card and does carry call audio; between idle and an active call
exactly 18 of its controls move, all routing and output. Applying the same shape
here - every S_*_CODEC switch at once, the codec output tree, agdsp_access_en -
changes nothing. Neither the F50's own Android nor a U30 Air (same ums9620) has
any audio to compare against, but the U30 Air does carry the native UMS9620
parameter XMLs, which are a better source than the community's donor copies.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
cat /proc/asound/cards now has a second entry, and /proc/asound/pcm has nineteen devices on it including
FE_ST_VOICE_PCM_P at card 1 device 53 - the same card the community Android modules produce, and the endpoint
sipserver's detectVoicePCMDevice looks for. mu300-audio-dsp load does the whole thing in one command and it
survives a reboot.
The last obstacle was the DMA engine, and nothing points at it. CONFIG_SPRD_DMA is a module that nothing pulls
in, so /sys/class/dma is empty, sprd-pcm-audio defers for want of a channel, its component never registers, and
snd_soc_register_card fails with "ASoC: failed to init link FE_NORMAL_AP01: -517" - a message that names a link
and never mentions DMA. virt-dma and sprd-dma bring up two controllers with sixty channels and the platform
components follow.
The card's probe runs before any of that exists and is not retried, because it returns 0 even when the
registration deferred. Binding sound@0 again once everything is in place is what finishes it.
sprd-card-dummy-on-defer.patch handles the links whose codecs this board does not have. Two details cost a boot
each: it must apply only to the codec, since giving the cpu dai a dummy kills the card at link 0 instead of 57;
and the dummy has to be filled in directly rather than by returning -ENOENT, because
asoc_sprd_card_dummy_codec_sel reads 'sound-dai' as a u32 and insists on a zero phandle, so it answers -EINVAL
for a node that exists and merely never arrives.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
sprd-card-dummy-on-defer.patch settles dai link 57. BE_FAST_P_SMART_AMP asks for the smart amplifier this
board does not have, so snd_soc_of_get_dai_name defers for ever and asoc_sprd_card_probe abandons all 58 links
- the other 57 parse, BE_VOICE_PCM_P among them. A link whose codec phandle is simply absent already falls
back to a dummy one frame up; dummy_on_defer=1 extends that to one that keeps deferring. Only for the codec:
args_count is NULL exactly on the codec call, and giving the cpu dai a dummy kills the card at link 0 instead
of 57, which is how the narrower condition was found.
The firmware is 6 MiB, which is what settles which region is which - the DSP binary goes in audiodsp-mem at
0xafa00000 and the 3 MiB at 0xaf700000 is the shared memory. sprd_audcp_boot confirms it: base_addr_phy =
0xafa00000, bin size = 0x600000. No image is in this repository and none can be.
Where it stops: starting the DSP reboots the device. The drivers load, the firmware writes, and seconds later
the console shows an orderly CPU shutdown and "reboot: Restarting system" - deliberate, from userspace, not a
panic. start_store writes AUDCPBOOT_CTRL_SYS_RESET and CORE_RESET through regmap and on this board that
appears to reach past the audio core. So mu300-audio-dsp grew a "load" command that stops short of it and
brings up everything else; "start" is the opt-in that reboots, and says so.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
Verified on the device after rebooting into the patched kernel. Both ranges are reserved at boot, audio_mem
takes them from its module parameters, and the audio SIPC channel that used to answer ENODEV now allocates its
blocks inside the reserved region and sends to the DSP:
OF: fdt: Reserved memory: reserved 0x00000000af700000 size 0x0000000000300000 (reserved_mem_add)
[Audio:MEM] dsp_bin (addr, size): (0xaf700000, 0x300000)
[Audio:SBLCK] audio_sblock_create: p_rxblks[6].addr 0xaf71d060
[Audio:SMSG] aud_smsg_send: dst=1, channel=3
The machine card went from deferring at dai link 0 for ever to parsing 57 of 58, BE_VOICE_PCM_P - the back end
the SIP gateway wants - among them. It stops on the last, BE_FAST_P_SMART_AMP, which asks for the smart
amplifier this board does not have: nothing answers at I2C 0x34 and the device tree's own sprd,spk-ext-pa-info
count fails with -22. Links whose codec phandle is missing already fall back to a dummy codec, but one that
defers is fatal, asoc_sprd_card_probe gives up, and nothing re-probes.
So the remaining work has moved off the DSP memory entirely: let a deferring codec fall back to the dummy the
way a missing one does, and supply an image for sprd_audcp_boot.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
Two patches and a config line, which between them remove the one thing standing between this device and call
audio: audio-mem-mgr describes the DSP completely and has no memory-region, so audio_mem has nothing to give
sprd_audcp_boot and the image can never be written.
of-reserved-mem-add is the counterpart of the of-reserved-mem-skip patch already in the tree - where that one
drops reservations the device tree asks for, this one adds ranges it forgot. CONFIG_OF_RESERVED_MEM_ADD, or
reserved_mem_add= on the command line, takes base,size pairs in memparse syntax.
audio-mem-fixed-region gives audio_mem four module parameters standing in for memory-region 0 and 1. At zero
it reads the device tree exactly as before, so a board that does describe its regions is untouched.
The addresses are 0xaf700000 3 MiB and 0xafa00000 6 MiB, which another UMS9620 device uses. They are not a
guess: the F50 reserves nothing between ae8fffff and b0000000, both fit in that hole, and the second ends
precisely where logobuffer begins.
mu300-audio-dsp loads the drivers in dependency order - twice, since a probe that defers once succeeds on the
second pass - and writes the firmware through sysfs if there is one. There cannot be one in this repository:
the project publishes no proprietary files, and unlike the Wi-Fi and modem firmware there is no copy on the
device to take, since the F50 has no audio DSP partition. Without an image the drivers still load and the DSP
stays down, which is exactly where this was before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
kernel/build-audio.sh produces the drivers behind real call audio from the realme unisoc-5.4 tree - the DSP
loader sprd_audcp_boot, agdsp_access, audio_sipc, audio_mem, the VBC v4 voice DAI, the UMP9620 codec, the PCM
platform and the machine card - and all 23 insmod cleanly on the device. The kernel config needed nothing:
CONFIG_SND_SOC, SND_SOC_COMPRESS and SND_SOC_TOPOLOGY are already built in, which is why soc-audio was sitting
there as a registered platform driver with nothing to do.
Three things about the build are worth the comments they got. Order matters and one pass does not suffice, so
it builds repeatedly and hands every Module.symvers produced so far to the next attempt. A failed attempt must
be cleaned before retrying or the leftover objects link twice and the error is "duplicate symbol:
__this_module", which points nowhere. And the UMP9620 codec only compiles with
BSP_KERNEL_DEFCONFIG=sprd_qogirn6pro_defconfig, because its Kbuild hides the codec define behind that and the
failure without it is an implicit declaration of TO_STRING hundreds of lines away.
The device tree turns out not to be the obstacle. sound@0 is okay and fully described, audiocp_boot has its
whole register set, and the machine driver binds it as vbc-rxpx-codec-sc27xx - the same binding the community
Android modules use. What stops it is the DSP: the card defers for ever because the DAI link cannot be parsed
until the audio SIPC channel exists, and that channel says ENODEV because nothing has started the DSP. This
board reserves no memory for it and carries no AGDSP image.
That leaves two concrete tasks rather than a port: reserve the memory, and supply the image.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk