aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-manager.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-01-22 14:38:22 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-01-22 21:03:48 +0100
commit86496bd326f2ec139101049fb19a10b255ee8ad5 (patch)
tree960a9f644fbafd8870d310945c2f8c4d809309aa /src/mm-plugin-manager.c
parent11b7aa46cbbd793e1f42e4a3cf56fe4ed65f67ed (diff)
plugin-manager: longer extra probing time when not using udev
When using udev, we rely on the kernel to timely report port additions in the same device. When not using udev, e.g. when using hotplug scripts in openwrt, we use mmcli --report-kernel-event operations to report the port additions, which may end up requiring much more time to process, especially during bootup as we would be reporting a lot of port addition events one after the other. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/493
Diffstat (limited to 'src/mm-plugin-manager.c')
-rw-r--r--src/mm-plugin-manager.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c
index f0bdba0d..8ec85a57 100644
--- a/src/mm-plugin-manager.c
+++ b/src/mm-plugin-manager.c
@@ -22,6 +22,8 @@
#include <gmodule.h>
#include <gio/gio.h>
+#include <config.h>
+
#include <ModemManager.h>
#include <mm-errors-types.h>
@@ -713,8 +715,14 @@ port_context_new (MMPluginManager *self,
#define MIN_PROBING_TIME_MSECS 2500
/* Additional time to wait for other ports to appear after the last port is
- * exposed in the system. */
-#define EXTRA_PROBING_TIME_MSECS 1500
+ * exposed in the system. Longer time when not using udev, as we rely on
+ * mmcli --report-kernel-event events to report new port additions, e.g.
+ * via openwrt hotplug scripts. */
+#if defined WITH_UDEV
+# define EXTRA_PROBING_TIME_MSECS 1500
+#else
+# define EXTRA_PROBING_TIME_MSECS 3000
+#endif
/* The wait time we define must always be less than the probing time */
G_STATIC_ASSERT (MIN_WAIT_TIME_MSECS < MIN_PROBING_TIME_MSECS);