File bnc878066-serial-ports-on-the-IO-card-are-not-responding.patch of Package ModemManager

Index: ModemManager-1.0.0/plugins/generic/mm-plugin-generic.c
===================================================================
--- ModemManager-1.0.0.orig/plugins/generic/mm-plugin-generic.c
+++ ModemManager-1.0.0/plugins/generic/mm-plugin-generic.c
@@ -91,7 +91,7 @@ create_modem (MMPlugin *self,
 G_MODULE_EXPORT MMPlugin *
 mm_plugin_create (void)
 {
-    static const gchar *subsystems[] = { "tty", "net", "usb", NULL };
+    static const gchar *subsystems[] = { "tty", "ttyS", "net", "usb", NULL };
 
     return MM_PLUGIN (
         g_object_new (MM_TYPE_PLUGIN_GENERIC,
Index: ModemManager-1.0.0/src/mm-manager.c
===================================================================
--- ModemManager-1.0.0.orig/src/mm-manager.c
+++ ModemManager-1.0.0/src/mm-manager.c
@@ -239,6 +239,9 @@ device_added (MMManager *manager,
     if (strncmp (name, "tty", 3) == 0 && isdigit (name[3]))
         return;
 
+    if (strncmp (name, "ttyS", 4) == 0 && isdigit (name[4]))
+        return;
+
     /* Ignore devices that aren't completely configured by udev yet.  If
      * ModemManager is started in parallel with udev, explicitly requesting
      * devices may return devices for which not all udev rules have yet been
Index: ModemManager-1.0.0/src/mm-serial-port.c
===================================================================
--- ModemManager-1.0.0.orig/src/mm-serial-port.c
+++ ModemManager-1.0.0/src/mm-serial-port.c
@@ -928,8 +928,13 @@ mm_serial_port_open (MMSerialPort *self,
     }
 
     g_warn_if_fail (MM_SERIAL_PORT_GET_CLASS (self)->config_fd);
-    if (!MM_SERIAL_PORT_GET_CLASS (self)->config_fd (self, priv->fd, error))
+    if (!MM_SERIAL_PORT_GET_CLASS (self)->config_fd (self, priv->fd, error)) {
+        g_debug("Could not config serial device %s: %s", device, strerror (errno));
+        /*  Try to release the lock of the serial por */
+        if (ioctl (priv->fd, TIOCNXCL) < 0)
+            g_warning ("Failed to release the lock for serial device.");
         goto error;
+    }
 
     /* Don't wait for pending data when closing the port; this can cause some
      * stupid devices that don't respond to URBs on a particular port to hang
openSUSE Build Service is sponsored by