Skip to content

qmodem: Require current device presence before dialing and stop stale slots - #288

Open
FUjr wants to merge 1 commit into
mainfrom
fix-modem-presence-280
Open

FUjr wants to merge 1 commit into
mainfrom
fix-modem-presence-280

Conversation

@FUjr

@FUjr FUjr commented Oct 22, 2026

Copy link
Copy Markdown
Owner

When USB enumeration changes across boots, an enabled saved section can refer to an absent modem or an AT port now owned by another modem. This PR requires current device presence before starting dialing and disables stale sections, including with block_auto_probe=1.

Related to #280. This is an alternative to the configuration migration approach in #285: slot configurations remain independent, without serial/VID/PID matching, cross-slot merging, or APN migration. A historical section may remain in UCI, but it must not keep dialing after its device disappears.

Changes

  • The scanner validates saved sections at startup and during full scans, and publishes a volatile presence proof after checking the device path, AT endpoint and data netdev. Same-path re-enumeration invalidates the proof; explicit PCIe associated_usb mappings and nested QMI data interfaces are supported.
  • Automatic and manual dial entry points require current presence. The dial script rechecks before reading configuration and sending AT commands.
  • Remove/disable immediately revokes presence and invalidates older scan events. Host-only cleanup stops the procd instance and connection manager and removes owned interfaces without querying SIM state or sending hangup commands through a stale AT port. Cleanup failures keep the section unready and receive bounded retries.
  • block_auto_probe blocks discovery/configuration probing, while presence checks and removal handling remain active. Fixed/manual configurations are checked without rediscovering their settings.
  • Add isolated presence/lifecycle regression coverage, wire it into CI, and document the behavior.

Validation

PASS locally: host compilation of scanner/client; new presence/lifecycle tests; existing scheduler, modem netdev, bridge passthrough, core command and vendor command boundary tests; BusyBox ash syntax checks; git diff --check.

The new tests cover boot admission, tty reuse, same-slot re-enumeration, PCIe association, nested QMI, manual/fixed configurations, stale-event cancellation, commit failure, cleanup retries, AT admission and cleanup without SIM queries. UCI/sysfs/procd are fixtures: these results are not physical modem or real procd validation.

Hardware testing is requested, especially on the reported Orange Pi Zero 3 multi-modem setup. Update both qmodem and modem_scan from this branch. This PR targets main; a stable backport is not included. The issue should remain open pending hardware results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant