modemmanager: suppress hotplug noise without breaking QMAP/QMI/MBIM mux

Commit 7885dff933 ("modemmanager: skip virtual net devices in hotplug
script") exited 25-modemmanager-net for every device under
/devices/virtual/* to stop the per-device "event processed" line from
spamming daemon.info on every boot and hotplug replay.

That blanket exit also dropped the QMAP/QMI/MBIM multiplexing netdevices
(qmapmux*, qmimux*, mbimmux*).  Those live under /devices/virtual too,
but they are real modem data ports and mm_report_event() deliberately
keeps them (ModemManager then resolves their lower_* link back to the
physical modem).  Skipping them in the hotplug script broke multiplexed
data connections.

Rather than duplicating that qmapmux/qmimux/mbimmux allow-list in the
hotplug script -- where it would drift out of sync with the copy in
mm_report_event() -- keep the filter in one place.  mm_report_event()
now returns non-zero when it drops a virtual device, and the hotplug
scripts only emit their "event processed" info log when the event was
actually reported.  The noisy log lines are gone for the dropped
devices, and the mux ports still reach ModemManager.

Fixes: 7885dff933 ("modemmanager: skip virtual net devices in hotplug script")
Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
This commit is contained in:
Michael Pfeifroth authored and Florian Eckert committed 2026-09-22 08:37:11 +02:00
1 parent 018c3f3886
commit f094afbed0
5 files changed
+10 -15

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=modemmanager
PKG_VERSION:=1.24.0
PKG_RELEASE:=14
PKG_RELEASE:=15
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git
@@ -8,19 +8,12 @@
# We require a interface name
[ -n "${INTERFACE}" ] || exit
# Virtual net devices (SQM IFB, GRE, bridges, veth, tun/tap, ...)
# can never be modems; mm_report_event drops them internally, skip
# the log-noisy hotplug script entirely.
case "${DEVPATH}" in
/devices/virtual/*) exit ;;
esac
# Always make sure the rundir exists
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
# Report network interface
mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}" || exit
mm_log "info" "${ACTION} network interface ${INTERFACE}: event processed"
mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}"
# Look for an associated cdc-wdm interface
@@ -33,6 +26,6 @@ esac
# Report cdc-wdm device, if any
[ -n "${cdcwdm}" ] && {
mm_log "info" "${ACTION} cdc interface ${cdcwdm}: custom event processed"
mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}"
mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}" &&
mm_log "info" "${ACTION} cdc interface ${cdcwdm}: custom event processed"
}
@@ -12,5 +12,5 @@
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
# Report TTY
mm_report_event "${ACTION}" "${DEVNAME}" "tty" "/sys${DEVPATH}" || exit
mm_log "info" "${ACTION} serial interface ${DEVNAME}: event processed"
mm_report_event "${ACTION}" "${DEVNAME}" "tty" "/sys${DEVPATH}"
@@ -11,5 +11,5 @@
mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
# Report wwan
mm_report_event "${ACTION}" "${DEVNAME}" "wwan" "/sys${DEVPATH}" || exit
mm_log "info" "${ACTION} wwan control port ${DEVNAME}: event processed"
mm_report_event "${ACTION}" "${DEVNAME}" "wwan" "/sys${DEVPATH}"
@@ -140,7 +140,7 @@ mm_report_event() {
mm_log "debug" "mbim vlan netdevice $name"
;;
*)
return
return 1
;;
esac
}
@@ -161,7 +161,7 @@ mm_report_event() {
# Skip live report if MM isn't up; wrapper will replay from cache.
if [ ! -s "${MODEMMANAGER_PID_FILE}" ] || \
! kill -0 "$(cat "${MODEMMANAGER_PID_FILE}" 2>/dev/null)" 2>/dev/null; then
return
return 0
fi
# Report the event
@@ -170,6 +170,8 @@ mm_report_event() {
if [ "$?" -ne "0" ]; then
mm_log "error" "Couldn't report kernel event: ${result}"
fi
return 0
}
mm_report_event_from_cache_line() {