Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/3] net: wwan: support DTR/RTS on AT ports via MHI IP_CTRL
@ 2026-08-16 12:17 Peter Hunt
  2026-08-16 12:17 ` [PATCH net-next v4 1/3] net: wwan: core: propagate modem control signals to port drivers Peter Hunt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Hunt @ 2026-08-16 12:17 UTC (permalink / raw)
  To: loic.poulain, ryazanov.s.a, mani
  Cc: johannes, netdev, mhi, linux-arm-msm, linux-kernel, Peter Hunt

Qualcomm/Sierra SDX55/SDX65 modems (e.g. EM9291) withhold unsolicited AT
result codes until the host asserts DTR.  The in-tree mhi_wwan_ctrl driver
exposed AT ports but never signalled DTR, so URCs never reached userspace.

Patch 1 extends the wwan core with an optional ->dtr_rts(port, on) port
op, mirroring tty_port_operations.dtr_rts.  The TIOCM bitmask state is
tracked entirely in the wwan core; drivers receive only a simple boolean
assert/de-assert signal reflecting the DTR line.  The core raises DTR/RTS
on first open of any AT port whose driver implements ->dtr_rts and drops
them on last close, mirroring TTY semantics.  at_data.mdmbits is
serialised under data_lock; the ->dtr_rts call is made after releasing
data_lock and re-acquiring ops_lock so that it is serialised against port
removal.

Patch 2 enables the IP_CTRL MHI channel in the Sierra PCI table so that
the IP_CTRL driver (patch 3) is actually bound on those controllers.

Patch 3 adds a second mhi_driver that binds the IP_CTRL channel and
registers a ->dtr_rts op so that the wwan core's open/close DTR raise/drop
and userspace TIOCMSET calls both reach the modem.  The existing AT/QMI/MBIM
data path is untouched.

v3: https://lore.kernel.org/netdev/20260807215042.2714442-1-peter.hunt@opengear.com/

v4:
- Protect at_data.mdmbits in wwan_port_op_start/stop under data_lock
- Release data_lock and acquire ops_lock with a NULL check before calling
  ->dtr_rts from the ioctl path, preventing NULL deref and use-after-free
  on port removal
- Gate ioctl ->dtr_rts on WWAN_PORT_AT to match open/close behaviour
- Reduce TIOCM boolean to TIOCM_DTR only (DTR governs URC gating; RTS is
  tracked in mdmbits but driven together with DTR on open/close)
- Add dev_dbg when IP_CTRL is not enumerated and when mhi_queue_buf fails
- Reword forward reference in patch 2 commit message

Peter Hunt (3):
  net: wwan: core: propagate modem control signals to port drivers
  bus: mhi: host: pci_generic: enumerate IP_CTRL channel for Sierra
    EM919x/EM929x
  net: wwan: mhi_wwan_ctrl: drive DTR/RTS via the IP_CTRL channel

 drivers/bus/mhi/host/pci_generic.c |   2 +
 drivers/net/wwan/mhi_wwan_ctrl.c   | 178 ++++++++++++++++++++++++++++-
 drivers/net/wwan/wwan_core.c       |  31 ++++-
 include/linux/wwan.h               |   3 +
 4 files changed, 212 insertions(+), 2 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-16 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-16 12:17 [PATCH net-next v4 0/3] net: wwan: support DTR/RTS on AT ports via MHI IP_CTRL Peter Hunt
2026-08-16 12:17 ` [PATCH net-next v4 1/3] net: wwan: core: propagate modem control signals to port drivers Peter Hunt
2026-08-16 12:17 ` [PATCH net-next v4 2/3] bus: mhi: host: pci_generic: enumerate IP_CTRL channel for Sierra EM919x/EM929x Peter Hunt
2026-08-16 12:17 ` [PATCH net-next v4 3/3] net: wwan: mhi_wwan_ctrl: drive DTR/RTS via the IP_CTRL channel Peter Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox