[PATCH] filter: pci and sdio ports under the platform driver filter

Aleksander Morgado aleksander at aleksander.es
Tue May 22 10:31:04 UTC 2018


Do not automatically probe serial ports under the 'pci' or 'sdio'
platform drivers unless explicitly tagged with
ID_MM_PLATFORM_DRIVER_PROBE.

  $ realpath /sys/class/tty/ttyS0/
  /sys/devices/pci0000:00/0000:00:16.3/tty/ttyS0
  $ basename $(realpath /sys/devices/pci0000:00/0000:00:16.3/subsystem)
  pci
---
 src/mm-filter.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mm-filter.c b/src/mm-filter.c
index 41529e59..c67e0720 100644
--- a/src/mm-filter.c
+++ b/src/mm-filter.c
@@ -107,7 +107,10 @@ mm_filter_port (MMFilter        *self,
         /* If the physdev is a 'platform' or 'pnp' device that's not whitelisted, ignore it */
         physdev_subsystem = mm_kernel_device_get_physdev_subsystem (port);
         if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_PLATFORM_DRIVER) &&
-            (!g_strcmp0 (physdev_subsystem, "platform") || !g_strcmp0 (physdev_subsystem, "pnp"))) {
+            (!g_strcmp0 (physdev_subsystem, "platform") ||
+             !g_strcmp0 (physdev_subsystem, "pci") ||
+             !g_strcmp0 (physdev_subsystem, "pnp") ||
+             !g_strcmp0 (physdev_subsystem, "sdio"))) {
             if (!mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_PLATFORM_DRIVER_PROBE")) {
                 mm_dbg ("[filter] (%s/%s): port filtered: port's parent platform driver is not whitelisted", subsystem, name);
                 return FALSE;
-- 
2.16.1



More information about the ModemManager-devel mailing list