mirror of
https://github.com/dikeckaan/mu300-linux.git
synced 2026-12-06 08:03:36 +00:00
Parity group dvfs (FINDINGS 234). The vendor 5.4 kernel has the DDR's frequency scaling (the scene-frequency
devfreq), the modem's DVFS controls, the DDR controller driver, the top-level DVFS set-up and the passive devfreq
governor; mainline had none of them and ran the DDR at what the bootloader left: pm_sys's DFS off, 1866 MHz, the top
level, at all times.
- upstream/modules/sprd_dvfs (out-of-tree, next to the modem stack, whose SIPC they use):
* sprd_ddr_dvfs: the "scene-frequency" devfreq (sprd,ddr-dvfs, MHz as on 5.4) and its sprd-governor directory.
pm_sys scales the DDR; the driver turns its DFS and automatic scaling on over SIPC (pm_sys channel 22), reads the
7 levels (384-1866 MHz) and passes on forced frequencies, requests and scene votes, as 5.4's. Fixed on the way:
the frequency table handed to devfreq as u32 cast to unsigned long *; frequencies written through cast pointers;
pm_sys ignores a vote of 0, so the vendor "no vote" left the 30 s boot-opt vote at 1866 MHz for good (now the
lowest level stands for "no vote"); a "0" forced frequency was clamped by devfreq to 384 MHz and forced, and a
force turns pm_sys's automatic scaling off for good (now 0 withdraws the force and turns it on again, and
sprd-governor taking over from userspace/performance does the same). pm_sys answers the channel's open once per
boot, so the module cannot be unloaded. scaling=0 (module parameter) leaves pm_sys's DFS as the bootloader left it.
* sprd_cp_dvfs: dvfs_pscp and dvfs_phycp, the modem's own DVFS controls (per device level, idle level, automatic
mode, register access) over SIPC channel 41. Loaded by the boot ramdisk after the SIPC core (module-order.txt):
the CP answers only when the sbuf exists before it starts; loaded later every request times out. The index stores
no longer return with the lock held; the per-device directories go with the device.
Neither carries a device table: udev would pull the SIPC core in out of the modem's order.
- sprd_modem/sipc/smsg.c: smsg_ch_open took smsg_recv's jiffies left (> 0, a finite timeout) for an error and tore
down a channel that had just opened; every caller so far waited forever (0). Only sprd_ddr_dvfs opens with a timeout.
- upstream/port/drivers/soc/sprd/dmc_drv.c (CONFIG_SPRD_DMC_DRV=y, built in as on 5.4): dmc-controller@60050000,
/proc/sprd_dmc (size, type, mode registers), debugfs sprd_pub_monitor (idle/read/write/self-refresh time, time per
DDR level, DFS count) and the DDR level at a panic.
- upstream/port/drivers/devfreq/sprd-top-dvfs.c (CONFIG_SPRD_TOP_DVFS_DEVFREQ=m): binds nothing on these boards (no
sprd,topdvfs-dev node), as on 5.4.
- CONFIG_DEVFREQ_GOV_PASSIVE=y (=y on 5.4).
Tested on F50-B (Ubuntu v2026.10.30.1, this 7.3 build), 9 boots (5 + 3 with the final modules, 1 more after the
ramdisk change), every one clean: sprd-ddr-dvfs, sprd-cp-dvfs (dvfs_pscp, dvfs_phycp) and sprd-dmc bound; the DDR
idles at 533 MHz (1536 MHz in bursts) and goes to 1866 MHz under a memcpy load (python, 256 MiB buffers); memcpy
4.0 GB/s, the same as on the released kernel at a fixed 1866 MHz; forced 384/768/1244 MHz, release, scenes, the
userspace governor and back work, with no hang; pm_sys's monitor showed 95 % of the time at F1; the CP answers
(pscp auto 1, core level 7; phycp auto 1); /proc/sprd_dmc: 2048 MiB LPDDR4X; no Oops/BUG/WARNING, pstore empty;
modem registered, bearer up and DNS over it (the rest needs the VPN, which this board has no profile for), usb0 and
adb up, no failed units. Audio: the audio extra (built for v2026.10.29.1) refuses another build; with
MU300_AUDIO_ANY_BUILD=1 the sprdphone card and DSP came up as on the released kernel. The U30 Air was not connected:
untested on it. 6.18.59, 7.2.13 and 7.3 build and bundle.
parity-5.4.txt: the dvfs group is ok; "class dvfs" belongs to apsys_dvfs (display group) and moves there.
mainline.list records the new names for 6.18, 7.2 and 7.3; the F50-B 7.3 inventory has the four new lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE