diff --git a/plugins/mm-modem-huawei-gsm.c b/plugins/mm-modem-huawei-gsm.c
index 5123e7f..bdb5d51 100644
--- a/plugins/mm-modem-huawei-gsm.c
+++ b/plugins/mm-modem-huawei-gsm.c
@@ -542,7 +542,7 @@ send_huawei_cpin_done (MMAtSerialPort *port,
 done:
     if (r)
         g_regex_unref (r);
-    mm_serial_port_close (MM_SERIAL_PORT (port));
+    mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
     mm_callback_info_schedule (info);
 }
 
diff --git a/plugins/mm-modem-mbm.c b/plugins/mm-modem-mbm.c
index 7f6bc9c..130861a 100644
--- a/plugins/mm-modem-mbm.c
+++ b/plugins/mm-modem-mbm.c
@@ -516,7 +516,7 @@ factory_reset_done (MMAtSerialPort *port,
 {
     MMCallbackInfo *info = (MMCallbackInfo *) user_data;
 
-    mm_serial_port_close (MM_SERIAL_PORT (port));
+    mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
     mm_callback_info_schedule (info);
 }
 
@@ -831,7 +831,7 @@ send_epin_done (MMAtSerialPort *port,
     mm_callback_info_set_result (info, GUINT_TO_POINTER (attempts_left), NULL);
 
 done:
-    mm_serial_port_close (MM_SERIAL_PORT (port));
+    mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
     mm_callback_info_schedule (info);
 }
 
diff --git a/plugins/mm-modem-novatel-gsm.c b/plugins/mm-modem-novatel-gsm.c
index 584156f..73dfbb5 100644
--- a/plugins/mm-modem-novatel-gsm.c
+++ b/plugins/mm-modem-novatel-gsm.c
@@ -56,7 +56,7 @@ dmat_callback2 (MMAtSerialPort *port,
                 GError *error,
                 gpointer user_data)
 {
-    mm_serial_port_close (MM_SERIAL_PORT (port));
+    mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
 }
 
 static void
@@ -71,7 +71,7 @@ dmat_callback (MMAtSerialPort *port,
             mm_at_serial_port_queue_command (port, "$NWDMAT=1", 2, dmat_callback2, NULL);
     }
 
-    mm_serial_port_close (MM_SERIAL_PORT (port));
+    mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
 }
 
 static gboolean
diff --git a/src/mm-generic-cdma.c b/src/mm-generic-cdma.c
index df602bd..128a2d4 100644
--- a/src/mm-generic-cdma.c
+++ b/src/mm-generic-cdma.c
@@ -132,7 +132,7 @@ get_esn_cb (MMModem *modem,
 {
     if (modem) {
         mm_modem_base_set_equipment_identifier (MM_MODEM_BASE (modem), error ? "" : result);
-        mm_serial_port_close (MM_SERIAL_PORT (MM_GENERIC_CDMA_GET_PRIVATE (modem)->primary));
+        mm_serial_port_close (MM_SERIAL_PORT (MM_GENERIC_CDMA_GET_PRIVATE (modem)->primary), __FILE__, __LINE__, __func__);
         check_valid (MM_GENERIC_CDMA (modem));
     }
 }
@@ -670,7 +670,7 @@ disable_all_done (MMModem *modem, GError *error, gpointer user_data)
         MMGenericCdma *self = MM_GENERIC_CDMA (info->modem);
         MMGenericCdmaPrivate *priv = MM_GENERIC_CDMA_GET_PRIVATE (self);
 
-        mm_serial_port_close_force (MM_SERIAL_PORT (priv->primary));
+        mm_serial_port_close_force (MM_SERIAL_PORT (priv->primary), __FILE__, __LINE__, __func__);
         mm_modem_set_state (modem, MM_MODEM_STATE_DISABLED, MM_MODEM_STATE_REASON_NONE);
 
         priv->cdma_1x_reg_state = MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN;
@@ -728,9 +728,9 @@ disable (MMModem *modem,
 
     /* Close auxiliary serial ports */
     if (priv->secondary)
-        mm_serial_port_close_force (MM_SERIAL_PORT (priv->secondary));
+        mm_serial_port_close_force (MM_SERIAL_PORT (priv->secondary), __FILE__, __LINE__, __func__);
     if (priv->qcdm)
-        mm_serial_port_close_force (MM_SERIAL_PORT (priv->qcdm));
+        mm_serial_port_close_force (MM_SERIAL_PORT (priv->qcdm), __FILE__, __LINE__, __func__);
 
     mm_modem_set_state (MM_MODEM (info->modem),
                         MM_MODEM_STATE_DISABLING,
diff --git a/src/mm-generic-gsm.c b/src/mm-generic-gsm.c
index 3edb6e3..de01869 100644
--- a/src/mm-generic-gsm.c
+++ b/src/mm-generic-gsm.c
@@ -318,7 +318,7 @@ get_imei_cb (MMModem *modem,
 {
     if (modem) {
         mm_modem_base_set_equipment_identifier (MM_MODEM_BASE (modem), error ? "" : result);
-        mm_serial_port_close (MM_SERIAL_PORT (MM_GENERIC_GSM_GET_PRIVATE (modem)->primary));
+        mm_serial_port_close (MM_SERIAL_PORT (MM_GENERIC_GSM_GET_PRIVATE (modem)->primary), __FILE__, __LINE__, __func__);
     }
 }
 
@@ -446,7 +446,7 @@ initial_pin_check_done (MMModem *modem, GError *error, gpointer user_data)
         priv->pin_check_timeout = g_timeout_add_seconds (2, pin_check_again, modem);
     } else {
         priv->pin_checked = TRUE;
-        mm_serial_port_close (MM_SERIAL_PORT (priv->primary));
+        mm_serial_port_close (MM_SERIAL_PORT (priv->primary), __FILE__, __LINE__, __func__);
         check_valid (MM_GENERIC_GSM (modem));
     }
 }
@@ -846,9 +846,9 @@ enable_failed (MMModem *modem, GError *error, MMCallbackInfo *info)
         priv = MM_GENERIC_GSM_GET_PRIVATE (modem);
 
         if (priv->primary && mm_serial_port_is_open (MM_SERIAL_PORT (priv->primary)))
-            mm_serial_port_close_force (MM_SERIAL_PORT (priv->primary));
+            mm_serial_port_close_force (MM_SERIAL_PORT (priv->primary), __FILE__, __LINE__, __func__);
         if (priv->secondary && mm_serial_port_is_open (MM_SERIAL_PORT (priv->secondary)))
-            mm_serial_port_close_force (MM_SERIAL_PORT (priv->secondary));
+            mm_serial_port_close_force (MM_SERIAL_PORT (priv->secondary), __FILE__, __LINE__, __func__);
     }
 
     mm_callback_info_schedule (info);
@@ -1135,7 +1135,7 @@ disable_done (MMAtSerialPort *port,
     if (!info->error) {
         MMGenericGsm *self = MM_GENERIC_GSM (info->modem);
 
-        mm_serial_port_close_force (MM_SERIAL_PORT (port));
+        mm_serial_port_close_force (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
         mm_modem_set_state (MM_MODEM (info->modem),
                             MM_MODEM_STATE_DISABLED,
                             MM_MODEM_STATE_REASON_NONE);
@@ -1228,7 +1228,7 @@ disable (MMModem *modem,
 
     /* Close the secondary port if its open */
     if (priv->secondary && mm_serial_port_is_open (MM_SERIAL_PORT (priv->secondary)))
-        mm_serial_port_close_force (MM_SERIAL_PORT (priv->secondary));
+        mm_serial_port_close_force (MM_SERIAL_PORT (priv->secondary), __FILE__, __LINE__, __func__);
 
     info = mm_callback_info_new (modem, callback, user_data);
 
@@ -1477,7 +1477,7 @@ pin_puk_recheck_done (MMModem *modem, GError *error, gpointer user_data)
     /* Otherwise, clean up and return the PIN check result */
     port = mm_callback_info_get_data (info, PIN_PORT_TAG);
     if (modem && port)
-        mm_serial_port_close (port);
+        mm_serial_port_close (port, __FILE__, __LINE__, __func__);
 
     mm_callback_info_schedule (info);
 }
@@ -1493,7 +1493,7 @@ send_puk_done (MMAtSerialPort *port,
     if (error) {
         info->error = g_error_copy (error);
         mm_callback_info_schedule (info);
-        mm_serial_port_close (MM_SERIAL_PORT (port));
+        mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
         return;
     }
 
@@ -1548,7 +1548,7 @@ send_pin_done (MMAtSerialPort *port,
     if (error) {
         info->error = g_error_copy (error);
         mm_callback_info_schedule (info);
-        mm_serial_port_close (MM_SERIAL_PORT (port));
+        mm_serial_port_close (MM_SERIAL_PORT (port), __FILE__, __LINE__, __func__);
         return;
     }
 
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index 80d0f90..3bd60d1 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -268,11 +268,11 @@ supports_task_dispose (GObject *object)
     if (priv->probe_id)
         g_source_remove (priv->probe_id);
     if (priv->probe_port) {
-        mm_serial_port_close (MM_SERIAL_PORT (priv->probe_port));
+        mm_serial_port_close (MM_SERIAL_PORT (priv->probe_port), __FILE__, __LINE__, __func__);
         g_object_unref (priv->probe_port);
     }
     if (priv->qcdm_port) {
-        mm_serial_port_close (MM_SERIAL_PORT (priv->qcdm_port));
+        mm_serial_port_close (MM_SERIAL_PORT (priv->qcdm_port), __FILE__, __LINE__, __func__);
         g_object_unref (priv->qcdm_port);
     }
 
@@ -404,7 +404,7 @@ port_buffer_full (MMSerialPort *port, GByteArray *buffer, gpointer user_data)
             if (!memcmp (&buffer->data[i], *iter, iter_len)) {
                 /* Immediately close the port and complete probing */
                 priv->probed_caps = 0;
-                mm_serial_port_close (MM_SERIAL_PORT (priv->probe_port));
+                mm_serial_port_close (MM_SERIAL_PORT (priv->probe_port), __FILE__, __LINE__, __func__);
                 probe_complete (task);
                 return;
             }
@@ -502,7 +502,7 @@ try_qcdm_probe (MMPluginBaseSupportsTask *task)
 
     /* Close the AT port */
     if (priv->probe_port) {
-        mm_serial_port_close (MM_SERIAL_PORT (priv->probe_port));
+        mm_serial_port_close (MM_SERIAL_PORT (priv->probe_port), __FILE__, __LINE__, __func__);
         g_object_unref (priv->probe_port);
         priv->probe_port = NULL;
     }
diff --git a/src/mm-serial-parsers.c b/src/mm-serial-parsers.c
index 7c9598e..dc52775 100644
--- a/src/mm-serial-parsers.c
+++ b/src/mm-serial-parsers.c
@@ -233,14 +233,23 @@ mm_serial_parser_v1_parse (gpointer data,
         return FALSE;
 
     /* First, check for successful responses */
+g_debug ("%s: parsing '%s'", __func__, response->str);
 
     found = g_regex_match_full (parser->regex_ok, response->str, response->len, 0, 0, NULL, NULL);
     if (found)
+{
+g_debug ("%s: found OK response", __func__);
         remove_matches (parser->regex_ok, response);
+}
     else
+{
         found = g_regex_match_full (parser->regex_connect, response->str, response->len, 0, 0, NULL, NULL);
+if (found)
+g_debug ("%s: found CONNECT response", __func__);
+}
 
     if (found) {
+g_debug ("%s: non-error response found, success", __func__);
         response_clean (response);
         return TRUE;
     }
@@ -252,6 +261,7 @@ mm_serial_parser_v1_parse (gpointer data,
                                 response->str, response->len,
                                 0, 0, &match_info, NULL);
     if (found) {
+g_debug ("%s: CME error found", __func__);
         str = g_match_info_fetch (match_info, 1);
         g_assert (str);
         local_error = mm_mobile_error_for_code (atoi (str));
@@ -265,6 +275,7 @@ mm_serial_parser_v1_parse (gpointer data,
                                 response->str, response->len,
                                 0, 0, &match_info, NULL);
     if (found) {
+g_debug ("%s: string-style CME error found", __func__);
         str = g_match_info_fetch (match_info, 1);
         g_assert (str);
         local_error = mm_mobile_error_for_string (str);
@@ -278,6 +289,7 @@ mm_serial_parser_v1_parse (gpointer data,
                                 response->str, response->len,
                                 0, 0, NULL, NULL);
     if (found) {
+g_debug ("%s: unknown error found", __func__);
         local_error = mm_mobile_error_for_code (MM_MOBILE_ERROR_UNKNOWN);
         goto done;
     }
@@ -289,6 +301,7 @@ mm_serial_parser_v1_parse (gpointer data,
     if (found) {
         str = g_match_info_fetch (match_info, 1);
         g_assert (str);
+g_debug ("%s: connect fail error '%s' found", __func__, str);
 
         if (!strcmp (str, "NO CARRIER"))
             code = MM_MODEM_CONNECT_ERROR_NO_CARRIER;
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
index ed44167..c98da1b 100644
--- a/src/mm-serial-port.c
+++ b/src/mm-serial-port.c
@@ -602,7 +602,8 @@ data_available (GIOChannel *source,
     if (condition & G_IO_HUP) {
         if (priv->response->len)
             g_byte_array_remove_range (priv->response, 0, priv->response->len);
-        mm_serial_port_close_force (self);
+        g_warning ("%s:%d %s: port hangup", __FILE__, __LINE__, __func__);
+        mm_serial_port_close_force (self, __FILE__, __LINE__, __func__);
         return FALSE;
     }
 
@@ -770,7 +771,7 @@ mm_serial_port_is_open (MMSerialPort *self)
 }
 
 void
-mm_serial_port_close (MMSerialPort *self)
+mm_serial_port_close (MMSerialPort *self, const char *file, guint32 line, const char *func)
 {
     MMSerialPortPrivate *priv;
     const char *device;
@@ -791,6 +792,10 @@ mm_serial_port_close (MMSerialPort *self)
         g_get_current_time (&tv);
         g_debug ("<%ld.%ld> (%s) device open count is %d (close)",
                  tv.tv_sec, tv.tv_usec, device, priv->open_count);
+
+        g_debug ("<%ld.%ld> (%s) close requested by %s:%d/%s",
+                 tv.tv_sec, tv.tv_usec, device,
+                 file, line, func);
     }
 
     if (priv->open_count > 0)
@@ -851,7 +856,7 @@ mm_serial_port_close (MMSerialPort *self)
 }
 
 void
-mm_serial_port_close_force (MMSerialPort *self)
+mm_serial_port_close_force (MMSerialPort *self, const char *file, guint32 line, const char *func)
 {
     MMSerialPortPrivate *priv;
 
@@ -863,7 +868,7 @@ mm_serial_port_close_force (MMSerialPort *self)
 
     /* Force the port to close */
     priv->open_count = 1;
-    mm_serial_port_close (self);
+    mm_serial_port_close (self, file, line, func);
 }
 
 static void
@@ -1238,7 +1243,7 @@ static void
 dispose (GObject *object)
 {
     if (mm_serial_port_is_open (MM_SERIAL_PORT (object)))
-        mm_serial_port_close_force (MM_SERIAL_PORT (object));
+        mm_serial_port_close_force (MM_SERIAL_PORT (object), __FILE__, __LINE__, __func__);
 
     mm_serial_port_flash_cancel (MM_SERIAL_PORT (object));
 
diff --git a/src/mm-serial-port.h b/src/mm-serial-port.h
index f78f793..e9044b3 100644
--- a/src/mm-serial-port.h
+++ b/src/mm-serial-port.h
@@ -110,9 +110,9 @@ gboolean mm_serial_port_is_open           (MMSerialPort *self);
 gboolean mm_serial_port_open              (MMSerialPort *self,
                                            GError  **error);
 
-void     mm_serial_port_close             (MMSerialPort *self);
+void     mm_serial_port_close             (MMSerialPort *self, const char *file, guint32 line, const char *func);
 
-void     mm_serial_port_close_force       (MMSerialPort *self);
+void     mm_serial_port_close_force       (MMSerialPort *self, const char *file, guint32 line, const char *func);
 
 gboolean mm_serial_port_flash             (MMSerialPort *self,
                                            guint32 flash_time,
