claude-noether 3a38286e6f notes: Patch C v3 Phase 7 N=3 results — +73% throughput, race fix verified
N=3 stress reps on ohm with v3 module (srcversion 371C6606B73AF19299228CA),
3 min @ 4 MB/s each, all within fresh-chip uptime window (200/391/582 s).

| rep | MB/s | sdio_rx_work | bh_work redispatches |
|----:|----:|-:|-:|
|  1  | 2.363 | 0 | 0 |
|  2  | 2.590 | 0 | 0 |
|  3  | 2.102 | 0 | 0 |

N=3 mean: 2.352 MB/s · median 2.363 MB/s · min 2.102 MB/s.

vs Patch B baseline (1.362 MB/s, run-20260507-patchC-preflight): +73%.
vs original Bug #5 floor (75 KB/s rep 3 death): 28× improvement.

Plan §4.5 prediction verified:
  - sdio_rx_work dispatch rate: 86.4/s -> 0/s (function deleted)
  - bes2600_bh_work redispatches: 0 (preserved invariant)
  - observed receive @ 4 MB/s: floor lifts toward >= 1 MB/s (exceeded —
    floor is 2.10 MB/s)

Bonus finding: sdio_tx_work dispatch rate dropped from 276.1/s to
0.8/s.  The post-tx queue_work(rx_work) call I rewired to
self->irq_handler() was actually firing more often than predicted;
folding it into bh-wake-up cuts ~99.7% of the workqueue dispatches.

No WARN/BUG/oops on any rep — the v2 race that wedged Patch C v1
within 13 s under stress did NOT reproduce on v3.

Phase 8 lesson distilled as feedback_mine_upstream_ancestor memory:
when patching a fork-from-upstream driver, mine the ancestor's
fix history BEFORE writing fixes from scratch.  cw1200 mining
drove the structural pivot from v2's atomic_t wrapper to v3's
no-relay architecture.  Without the mine, we'd have shipped v2.

Phase 7 receipts checklist met (N=3, fresh-chip, identical
instrumentation, predicted delta verified, no-WARN under stress).
2026-05-07 23:08:51 +02:00

BESser — BES2600 driver mainlining for Pine64 PineTab2

Working tree for upstreaming the Bestechnic BES2600WM WiFi/BT combo driver currently shipped out-of-tree by the danctnix kernel for the Pine64 PineTab2.

Why "BESser"

"BES" (the chip vendor) + German besser ("better"). Sibling to:

  • Bin — u-boot upstreaming for the CoolPi GenBook (RK3588)
  • MegabitChip — DDR init blob RE for the same SoC
  • SouthAfrica — OpenPineBuds / 1MORE Fit SE BES2300 firmware RE (chip family relative)
  • RockHard — RK3588 mainline kernel work

Hardware target

Item Value
Device PineTab2
Host name ohm (ohm.fritz.box, ohm.vpn = 10.170.16.14)
SoC Rockchip RK3566 (aarch64)
WiFi/BT Bestechnic BES2600WM — WiFi 4 (11n dual-band 1x1) + BT 5.2/5.3
WiFi interface SDIO 3.0, vendor 0xBE57 device 0x2002
BT interface UART HCI (separate bes2600_btuart module)
OS Arch Linux ARM, danctnix kernel 6.19.10-danctnix1-1-pinetab2

Driver lineage

ST-Ericsson CW1200 (mainline drivers/net/wireless/st/cw1200/)
        │   author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
        ▼
Bestechnic BES2600 (closed fork ~20152023, same author)
        │   adds: BT-over-UART, 5GHz, ePTA coexistence, SDIO ADMA, char-dev API
        ▼
Released for Chinese Android burner-phone vendor kernels (~2023)
        │
        ▼
arjan-vlek/bes2600 (GitLab, 2023-07) → 26-commit checkpatch cleanup
        │
        ├── TuxThePenguin0/bes2600 (preserves pre-removal Android source)
        ├── salsa.debian.org/Mobian-team/devices/bes2600-dkms (active, our PR target)
        └── codeberg.org/DanctNIX/linux-pinetab2 (in-kernel at drivers/staging/bes2600/)

CW1200-ancestry markers in current source: same author Dmitry Tarnyagin, CONFIG_BES2600_USE_STE_EXTENSIONS (STE = ST-Ericsson), CONFIG_BES2600_WSM_DEBUG (WSM = CW1200's host↔FW protocol).

Repos

Role Path
This umbrella git.reauktion.de/marfrit/besser — patches/, scripts/, fw-analysis/, notes/
Mobian DKMS fork (PR target) git.reauktion.de/marfrit/bes2600-dkms — branches per patch; upstream = salsa.debian.org/Mobian-team/devices/bes2600-dkms

Patch series

Patch Status Description
c1 MERGED-LOCAL, deployed on ohm bes2600: use request_firmware() for factory.txt read — kills filp_open / kernel_read in the read path; fixes the (NULL device *) read and check /lib/firmware/bes2600_factory.txt error boot spam
c2 pending PM handshake gate + retry — fixes bes2600_pwr_enter_lp_mode wait pm ind timeout recurring every 510s
c3 pending bes_chardev removal + nl80211 testmode hookup — clears the second upstream blocker (custom char device); secondary effect on bug #3
c4 pending Enable CONFIG_BES2600_TESTMODE=y + route patch_wifi_testMode — exposes hidden firmware testmode features
c5 pending Investigate factory.txt parse fail — uncovered by c1; original bug masked it; parser chokes on data request_firmware now successfully returns
c1.1 pending follow-up Drop kernel_write from factory.c + bes_chardev.c + bes_fw.c (/lib/firmware/bes2002_fw_write.bin debug file!)
c1.2 pending follow-up Thread struct device * through factory API → eliminates (NULL device *) log prefix

Workflow

  1. Edit on Mobian fork (bes2600-dkms) — primary upstream PR target
  2. Topic branch per patch: bes2600/<short-name>
  3. git commit --signoff with full kernel-style message
  4. checkpatch.pl --no-tree --strict before push (must be clean)
  5. git format-patch -1 -o ../besser/patches/ to canonicalize
  6. Push branch to origin (Gitea), open MR upstream when ready

Build + deploy

See scripts/:

  • build-bes2600-on-ohm.sh — native aarch64 build on ohm (requires linux-pinetab2-headers)
  • deploy-c1-to-ohm.sh — install patched modules to /lib/modules/<ver>/extra/ + depmod
  • backup-ohm-kernel.sh — timestamped tar.zst of /boot + /lib/modules + /lib/firmware/bes2600

Firmware RE state (task d)

Firmware blobs (4 .bin + factory.txt) are not committed here (binary, ships from Bestechnic). On boltzmann:~/src/besser/firmware-from-ohm/ and on oppenheimer:/work/besser/ (Ghidra host).

What IS committed under fw-analysis/:

  • *.strings.txt — full sorted-unique strings extraction per blob
  • *.fnnames.txt — function-name pattern extraction (191 candidates from best2002_fw_sdio.bin)

Build provenance: Dec 26-27 2023 build from Bestechnic Jenkins (GCC-10-pipeline), source git commit 8125e20be (NOT public).

Hidden features in firmware (per task d): testmode patch (CONFIG_BES2600_TESTMODE gates it), ePTA coexistence with bypass (gEptaBypass: %d), DPD per-channel calibration, hal_trace_crash_dump_register, METAL_ID + patch_version introspection, RF tone generation (nosignal variant), memory dump (nosignal variant), DAC/IQ calibration v2, fast-PSM tuning hooks.

Adjacent infrastructure

  • oppenheimer (CT131 on data Proxmox): Ghidra 11.3.2 host. SSH via mfritsche@192.168.88.63. Staging at /work/besser/.
  • boltzmann (Rock 5 ITX+): primary build/dev, ARM64 native, hub-tools preferred path.
  • ohm: target hardware; UART-over-USB-C debug rig also available (Tigard FT2232H Channel A @ 1.8V).

Authors / contacts

  • Markus Fritsche <fritsche.markus@gmail.com> (this fork)
  • Driver upstream: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> (CW1200 / BES2600 base)
  • BT companion: Dang Huynh <dang.huynh@mainlining.org> (bes2600_btuart.c, 2025)
  • Mobian DKMS: Julian <mail@julianfairfax.ch> (current packaging maintainer)
S
Description
BESser - BES2600 driver mainlining umbrella (patches, RE, scripts)
Readme 471 MiB
Languages
Shell 100%