From 35d84ac840dca47ae4bcca54d8ce4fed764be8b4 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 14 Feb 2019 15:57:58 +0100 Subject: broadband-modem-qmi: log reason of QMI port open failure If ModemManager fails to open a QMI port with data format update, it retries without update. It would be useful to log the reason why the first try failed; for example on RHEL 7.6 ModemManager fails to write to sysfs due to SELinux. With this commit, the following message would be logged: QMI port open operation finished Couldn't open QMI port with data format update: Expected data format not updated properly: Failed to open file '/sys/class/net/wwp0s29u1u2i8/qmi/raw_ip' for R/W: Permission denied Opening QMI device... instead of just: QMI port open operation finished Opening QMI device... While at it, also fix the GError leak. --- src/mm-broadband-modem-qmi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c index 4f294a7c..ca274c43 100644 --- a/src/mm-broadband-modem-qmi.c +++ b/src/mm-broadband-modem-qmi.c @@ -8422,6 +8422,8 @@ qmi_port_open_ready (MMPortQmi *qmi, * try without it. The qmi_wwan driver will fix up any issues that * the device might have between raw-ip and 802.3 mode anyway. */ + mm_dbg ("Couldn't open QMI port with data format update: %s", error->message); + g_error_free (error); mm_port_qmi_open (ctx->qmi, FALSE, NULL, -- cgit v1.2.3-70-g09d2