From e66fead6d479b5870280918ea42160c7dd0fc532 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 15 Jun 2023 14:31:51 +0200 Subject: [PATCH 1/2] modemmanager: do not cache virtual device events On small systems with many virtual devices, the modem manager sometimes could not start because it took too long until all devices for the modem were recognised. This is because all system events that are stored in the file events.cache have to be processed. To speed up the processing, all devices under /sys/devices/virtual are now filtered out so that they do not have to be processed. Signed-off-by: Florian Eckert --- net/modemmanager/Makefile | 2 +- net/modemmanager/files/modemmanager.common | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index a79f65f67..b6063fb85 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=modemmanager PKG_SOURCE_VERSION:=1.20.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git diff --git a/net/modemmanager/files/modemmanager.common b/net/modemmanager/files/modemmanager.common index 6367eb32b..a931717fd 100644 --- a/net/modemmanager/files/modemmanager.common +++ b/net/modemmanager/files/modemmanager.common @@ -273,6 +273,14 @@ mm_report_event() { local subsystem="$3" local sysfspath="$4" + # Do not save virtual devices + local virtual + virtual="$(echo "$sysfspath" | cut -d'/' -f4)" + [ "$virtual" = "virtual" ] && { + mm_log "debug" "sysfspath is a virtual device ($sysfspath)" + return + } + # Track/untrack events in cache case "${action}" in "add") From fd63e400ba1c2cf7242517ebb5675bfdcd22fc3f Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 15 Jun 2023 15:38:34 +0200 Subject: [PATCH 2/2] modemmanager: if an alias name is used do not check sysfs path If an alias name is used for the modem, then a check if the device exists in sysfs does not work. To fix this remove the check if the sysfs device exists. The protocoll handler already checks if the modem is responsible for this device on the next line. Signed-off-by: Florian Eckert --- net/modemmanager/Makefile | 2 +- net/modemmanager/files/modemmanager.proto | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile index b6063fb85..3c021b44d 100644 --- a/net/modemmanager/Makefile +++ b/net/modemmanager/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=modemmanager PKG_SOURCE_VERSION:=1.20.6 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git diff --git a/net/modemmanager/files/modemmanager.proto b/net/modemmanager/files/modemmanager.proto index e6ec9e203..2a61f5178 100755 --- a/net/modemmanager/files/modemmanager.proto +++ b/net/modemmanager/files/modemmanager.proto @@ -368,11 +368,6 @@ proto_modemmanager_setup() { proto_set_available "${interface}" 0 return 1 } - [ -e "${device}" ] || { - echo "Device not found in sysfs" - proto_set_available "${interface}" 0 - return 1 - } # validate that ModemManager is handling the modem at the sysfs path modemstatus=$(mmcli --modem="${device}" --output-keyvalue)