import libqmi-1.24.0-3.el8
This commit is contained in:
parent
823ce91976
commit
8ffb0ffccb
363
SOURCES/0001-detect-smdpkt-rh1976886.patch
Normal file
363
SOURCES/0001-detect-smdpkt-rh1976886.patch
Normal file
@ -0,0 +1,363 @@
|
||||
From 185856133af4d723b719a4ad5395e32153deb98b Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksander@aleksander.es>
|
||||
Date: Fri, 18 Oct 2019 11:37:17 +0200
|
||||
Subject: [PATCH 1/3] qmi-device: support and detect smdpkt managed QMI control
|
||||
ports
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/issues/20
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/72
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/101
|
||||
|
||||
(cherry picked from commit e3851c8d456f32553324beaab1b7c48bbffa2892)
|
||||
(cherry picked from commit 6fc07ae25a7c3e2375f02f7ab65c92073303e8d0)
|
||||
---
|
||||
.../libqmi-glib/libqmi-glib-common.sections | 2 +
|
||||
src/libqmi-glib/qmi-device.c | 68 ++++++++---------
|
||||
src/libqmi-glib/qmi-utils.c | 73 ++++++++++++++++---
|
||||
src/libqmi-glib/qmi-utils.h | 11 ++-
|
||||
4 files changed, 107 insertions(+), 47 deletions(-)
|
||||
|
||||
diff --git a/docs/reference/libqmi-glib/libqmi-glib-common.sections b/docs/reference/libqmi-glib/libqmi-glib-common.sections
|
||||
index eb6cbeded2ba..75a13653416a 100644
|
||||
--- a/docs/reference/libqmi-glib/libqmi-glib-common.sections
|
||||
+++ b/docs/reference/libqmi-glib/libqmi-glib-common.sections
|
||||
@@ -1403,6 +1403,8 @@ QmiEndian
|
||||
<SUBSECTION Traces>
|
||||
qmi_utils_get_traces_enabled
|
||||
qmi_utils_set_traces_enabled
|
||||
+<SUBSECTION Private>
|
||||
+__QmiTransportType
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
|
||||
index 1e7d8cd1a9d2..7af4f4cd43b6 100644
|
||||
--- a/src/libqmi-glib/qmi-device.c
|
||||
+++ b/src/libqmi-glib/qmi-device.c
|
||||
@@ -1942,68 +1942,68 @@ device_create_endpoint (QmiDevice *self,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-device_setup_open_flags_by_driver (QmiDevice *self,
|
||||
- DeviceOpenContext *ctx,
|
||||
- GError **error)
|
||||
-{
|
||||
- gchar *driver;
|
||||
- GError *inner_error = NULL;
|
||||
-
|
||||
- driver = __qmi_utils_get_driver (qmi_file_get_path (self->priv->file), &inner_error);
|
||||
- if (driver)
|
||||
- g_debug ("[%s] loaded driver of cdc-wdm port: %s", qmi_file_get_path_display (self->priv->file), driver);
|
||||
- else if (!self->priv->no_file_check)
|
||||
- g_warning ("[%s] couldn't load driver of cdc-wdm port: %s", qmi_file_get_path_display (self->priv->file), inner_error->message);
|
||||
+device_setup_open_flags_by_transport (QmiDevice *self,
|
||||
+ DeviceOpenContext *ctx,
|
||||
+ GError **error)
|
||||
+{
|
||||
+ __QmiTransportType transport;
|
||||
+ GError *inner_error = NULL;
|
||||
+
|
||||
+ transport = __qmi_utils_get_transport_type (qmi_file_get_path (self->priv->file), &inner_error);
|
||||
+ if ((transport == __QMI_TRANSPORT_TYPE_UNKNOWN) && !self->priv->no_file_check)
|
||||
+ g_warning ("[%s] couldn't detect transport type of port: %s", qmi_file_get_path_display (self->priv->file), inner_error->message);
|
||||
g_clear_error (&inner_error);
|
||||
|
||||
#if defined MBIM_QMUX_ENABLED
|
||||
|
||||
/* Auto mode requested? */
|
||||
if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_AUTO) {
|
||||
- if (!g_strcmp0 (driver, "cdc_mbim")) {
|
||||
+ switch (transport) {
|
||||
+ case __QMI_TRANSPORT_TYPE_MBIM:
|
||||
g_debug ("[%s] automatically selecting MBIM mode", qmi_file_get_path_display (self->priv->file));
|
||||
ctx->flags |= QMI_DEVICE_OPEN_FLAGS_MBIM;
|
||||
- goto out;
|
||||
- }
|
||||
- if (!g_strcmp0 (driver, "qmi_wwan")) {
|
||||
+ break;
|
||||
+ case __QMI_TRANSPORT_TYPE_QMUX:
|
||||
g_debug ("[%s] automatically selecting QMI mode", qmi_file_get_path_display (self->priv->file));
|
||||
ctx->flags &= ~QMI_DEVICE_OPEN_FLAGS_MBIM;
|
||||
- goto out;
|
||||
+ break;
|
||||
+ case __QMI_TRANSPORT_TYPE_UNKNOWN:
|
||||
+ g_set_error (&inner_error, QMI_CORE_ERROR, QMI_CORE_ERROR_FAILED,
|
||||
+ "Cannot automatically select QMI/MBIM mode");
|
||||
+ break;
|
||||
}
|
||||
- g_set_error (&inner_error,
|
||||
- QMI_CORE_ERROR,
|
||||
- QMI_CORE_ERROR_FAILED,
|
||||
- "Cannot automatically select QMI/MBIM mode: driver %s",
|
||||
- driver ? driver : "unknown");
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* MBIM mode requested? */
|
||||
if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM) {
|
||||
- if (g_strcmp0 (driver, "cdc_mbim") && !self->priv->no_file_check)
|
||||
- g_warning ("[%s] requested MBIM mode but unexpected driver found: %s", qmi_file_get_path_display (self->priv->file), driver);
|
||||
+ if ((transport != __QMI_TRANSPORT_TYPE_MBIM) && !self->priv->no_file_check)
|
||||
+ g_warning ("[%s] requested MBIM mode but unexpected transport type found", qmi_file_get_path_display (self->priv->file));
|
||||
goto out;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
- if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_AUTO)
|
||||
+ /* Auto mode requested? */
|
||||
+ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_AUTO) {
|
||||
g_warning ("[%s] requested auto mode but no MBIM QMUX support available", qmi_file_get_path_display (self->priv->file));
|
||||
- if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM)
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ /* MBIM mode requested? */
|
||||
+ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM) {
|
||||
g_warning ("[%s] requested MBIM mode but no MBIM QMUX support available", qmi_file_get_path_display (self->priv->file));
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
#endif /* MBIM_QMUX_ENABLED */
|
||||
|
||||
/* QMI mode requested? */
|
||||
- if (g_strcmp0 (driver, "qmi_wwan") && !self->priv->no_file_check)
|
||||
- g_warning ("[%s] requested QMI mode but unexpected driver found: %s",
|
||||
- qmi_file_get_path_display (self->priv->file), driver ? driver : "unknown");
|
||||
+ if ((transport != __QMI_TRANSPORT_TYPE_QMUX) && !self->priv->no_file_check)
|
||||
+ g_warning ("[%s] requested QMI mode but unexpected transport type found",
|
||||
+ qmi_file_get_path_display (self->priv->file));
|
||||
|
||||
-#if defined MBIM_QMUX_ENABLED
|
||||
out:
|
||||
-#endif
|
||||
-
|
||||
- g_free (driver);
|
||||
|
||||
if (inner_error) {
|
||||
g_propagate_error (error, inner_error);
|
||||
@@ -2029,7 +2029,7 @@ device_open_step (GTask *task)
|
||||
/* Fall through */
|
||||
|
||||
case DEVICE_OPEN_CONTEXT_STEP_DRIVER:
|
||||
- if (!device_setup_open_flags_by_driver (self, ctx, &error)) {
|
||||
+ if (!device_setup_open_flags_by_transport (self, ctx, &error)) {
|
||||
g_task_return_error (task, error);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c
|
||||
index df2420cf5c1f..084dba51d011 100644
|
||||
--- a/src/libqmi-glib/qmi-utils.c
|
||||
+++ b/src/libqmi-glib/qmi-utils.c
|
||||
@@ -120,18 +120,13 @@ __qmi_user_allowed (uid_t uid,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
-gchar *
|
||||
-__qmi_utils_get_driver (const gchar *cdc_wdm_path,
|
||||
- GError **error)
|
||||
+static gchar *
|
||||
+utils_get_driver (const gchar *device_basename,
|
||||
+ GError **error)
|
||||
{
|
||||
static const gchar *subsystems[] = { "usbmisc", "usb" };
|
||||
- guint i;
|
||||
- gchar *device_basename;
|
||||
- gchar *driver = NULL;
|
||||
-
|
||||
- device_basename = __qmi_utils_get_devname (cdc_wdm_path, error);
|
||||
- if (!device_basename)
|
||||
- return NULL;
|
||||
+ guint i;
|
||||
+ gchar *driver = NULL;
|
||||
|
||||
for (i = 0; !driver && i < G_N_ELEMENTS (subsystems); i++) {
|
||||
gchar *tmp;
|
||||
@@ -153,9 +148,65 @@ __qmi_utils_get_driver (const gchar *cdc_wdm_path,
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
+ if (!driver)
|
||||
+ g_set_error (error, QMI_CORE_ERROR, QMI_CORE_ERROR_FAILED,
|
||||
+ "couldn't detect device driver");
|
||||
+ return driver;
|
||||
+}
|
||||
+
|
||||
+__QmiTransportType
|
||||
+__qmi_utils_get_transport_type (const gchar *path,
|
||||
+ GError **error)
|
||||
+{
|
||||
+ __QmiTransportType transport = __QMI_TRANSPORT_TYPE_UNKNOWN;
|
||||
+ gchar *device_basename = NULL;
|
||||
+ gchar *driver = NULL;
|
||||
+ gchar *sysfs_path = NULL;
|
||||
+ GError *inner_error = NULL;
|
||||
+
|
||||
+ device_basename = __qmi_utils_get_devname (path, &inner_error);
|
||||
+ if (!device_basename)
|
||||
+ goto out;
|
||||
+
|
||||
+ driver = utils_get_driver (device_basename, &inner_error);
|
||||
+
|
||||
+ /* On Android systems we get access to the QMI control port through
|
||||
+ * virtual smdcntl devices in the smdpkt subsystem. */
|
||||
+ if (!driver) {
|
||||
+ path = g_strdup_printf ("/sys/devices/virtual/smdpkt/%s", device_basename);
|
||||
+ if (g_file_test (path, G_FILE_TEST_EXISTS)) {
|
||||
+ g_clear_error (&inner_error);
|
||||
+ transport = __QMI_TRANSPORT_TYPE_QMUX;
|
||||
+ }
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (!g_strcmp0 (driver, "cdc_mbim")) {
|
||||
+ transport = __QMI_TRANSPORT_TYPE_MBIM;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (!g_strcmp0 (driver, "qmi_wwan")) {
|
||||
+ transport = __QMI_TRANSPORT_TYPE_QMUX;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ g_set_error (&inner_error, QMI_CORE_ERROR, QMI_CORE_ERROR_FAILED,
|
||||
+ "unexpected driver detected: %s", driver);
|
||||
+
|
||||
+ out:
|
||||
+
|
||||
g_free (device_basename);
|
||||
+ g_free (driver);
|
||||
+ g_free (sysfs_path);
|
||||
|
||||
- return driver;
|
||||
+ if (inner_error) {
|
||||
+ g_assert (transport == __QMI_TRANSPORT_TYPE_UNKNOWN);
|
||||
+ g_propagate_error (error, inner_error);
|
||||
+ } else
|
||||
+ g_assert (transport != __QMI_TRANSPORT_TYPE_UNKNOWN);
|
||||
+
|
||||
+ return transport;
|
||||
}
|
||||
|
||||
gchar *
|
||||
diff --git a/src/libqmi-glib/qmi-utils.h b/src/libqmi-glib/qmi-utils.h
|
||||
index b83bf23c184d..8a1c712dfad0 100644
|
||||
--- a/src/libqmi-glib/qmi-utils.h
|
||||
+++ b/src/libqmi-glib/qmi-utils.h
|
||||
@@ -84,9 +84,16 @@ gchar *__qmi_utils_str_hex (gconstpointer mem,
|
||||
G_GNUC_INTERNAL
|
||||
gboolean __qmi_user_allowed (uid_t uid,
|
||||
GError **error);
|
||||
+
|
||||
+typedef enum {
|
||||
+ __QMI_TRANSPORT_TYPE_UNKNOWN,
|
||||
+ __QMI_TRANSPORT_TYPE_QMUX,
|
||||
+ __QMI_TRANSPORT_TYPE_MBIM,
|
||||
+} __QmiTransportType;
|
||||
+
|
||||
G_GNUC_INTERNAL
|
||||
-gchar *__qmi_utils_get_driver (const gchar *cdc_wdm_path,
|
||||
- GError **error);
|
||||
+__QmiTransportType __qmi_utils_get_transport_type (const gchar *path,
|
||||
+ GError **error);
|
||||
|
||||
G_GNUC_INTERNAL
|
||||
gchar *__qmi_utils_get_devname (const gchar *cdc_wdm_path,
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
From 00502d0353d7e056b3348514033001e0a71bbd83 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksander@aleksander.es>
|
||||
Date: Fri, 18 Oct 2019 11:41:49 +0200
|
||||
Subject: [PATCH 2/3] qmi-device: when MBIM/QMUX support not enabled ignore
|
||||
AUTO warnings
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/20
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/72
|
||||
|
||||
(cherry picked from commit 99e320c76dc41bc4b4cb0a5b55c06a825cd9224c)
|
||||
---
|
||||
src/libqmi-glib/qmi-device.c | 8 ++------
|
||||
1 file changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
|
||||
index 7af4f4cd43b6..7e93fad079a4 100644
|
||||
--- a/src/libqmi-glib/qmi-device.c
|
||||
+++ b/src/libqmi-glib/qmi-device.c
|
||||
@@ -1984,18 +1984,14 @@ device_setup_open_flags_by_transport (QmiDevice *self,
|
||||
|
||||
#else
|
||||
|
||||
- /* Auto mode requested? */
|
||||
- if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_AUTO) {
|
||||
- g_warning ("[%s] requested auto mode but no MBIM QMUX support available", qmi_file_get_path_display (self->priv->file));
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
/* MBIM mode requested? */
|
||||
if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM) {
|
||||
g_warning ("[%s] requested MBIM mode but no MBIM QMUX support available", qmi_file_get_path_display (self->priv->file));
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ /* Treat AUTO as QMI mode, without warnings */
|
||||
+
|
||||
#endif /* MBIM_QMUX_ENABLED */
|
||||
|
||||
/* QMI mode requested? */
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
From dc013e2e3fee3583f93961900b45d6b2fc59871c Mon Sep 17 00:00:00 2001
|
||||
From: Luca Weiss <luca@z3ntu.xyz>
|
||||
Date: Mon, 21 Oct 2019 21:05:28 +0200
|
||||
Subject: [PATCH 3/3] qmi-device: detect rpmsg control ports
|
||||
|
||||
and adjust the path to check for smdpkt nodes
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/issues/20
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/73
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/merge_requests/101
|
||||
|
||||
(cherry picked from commit c2ceb25d6e95e37e9f3394937fd9b9b524207224)
|
||||
(cherry picked from commit 816c36f9a1d24ac1b2a4c46d04cb2ca47d9c0a4e)
|
||||
---
|
||||
src/libqmi-glib/qmi-utils.c | 16 ++++++++++++----
|
||||
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c
|
||||
index 084dba51d011..cb29c91c64b4 100644
|
||||
--- a/src/libqmi-glib/qmi-utils.c
|
||||
+++ b/src/libqmi-glib/qmi-utils.c
|
||||
@@ -170,11 +170,19 @@ __qmi_utils_get_transport_type (const gchar *path,
|
||||
|
||||
driver = utils_get_driver (device_basename, &inner_error);
|
||||
|
||||
- /* On Android systems we get access to the QMI control port through
|
||||
- * virtual smdcntl devices in the smdpkt subsystem. */
|
||||
if (!driver) {
|
||||
- path = g_strdup_printf ("/sys/devices/virtual/smdpkt/%s", device_basename);
|
||||
- if (g_file_test (path, G_FILE_TEST_EXISTS)) {
|
||||
+ /* On Android systems we get access to the QMI control port through
|
||||
+ * virtual smdcntl devices in the smdpkt subsystem. */
|
||||
+ sysfs_path = g_strdup_printf ("/sys/class/smdpkt/%s", device_basename);
|
||||
+ if (g_file_test (sysfs_path, G_FILE_TEST_EXISTS)) {
|
||||
+ g_clear_error (&inner_error);
|
||||
+ transport = __QMI_TRANSPORT_TYPE_QMUX;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ g_free (sysfs_path);
|
||||
+ /* On mainline kernels this control port is provided by rpmsg */
|
||||
+ sysfs_path = g_strdup_printf ("/sys/class/rpmsg/%s", device_basename);
|
||||
+ if (g_file_test (sysfs_path, G_FILE_TEST_EXISTS)) {
|
||||
g_clear_error (&inner_error);
|
||||
transport = __QMI_TRANSPORT_TYPE_QMUX;
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
104
SOURCES/0002-crash-qmi-device-rh1976888.patch
Normal file
104
SOURCES/0002-crash-qmi-device-rh1976888.patch
Normal file
@ -0,0 +1,104 @@
|
||||
From 3f6d53fdba9045c64b5e6cf7f8c1dbbd07eb8d37 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksander@aleksander.es>
|
||||
Date: Thu, 4 Jun 2020 09:35:17 +0200
|
||||
Subject: [PATCH 1/2] libqmi-glib,device: endpoint is cleared when device is
|
||||
closed
|
||||
|
||||
#0 qmi_endpoint_is_open (self=0x0) at ../../../libqmi-1.24.8/src/libqmi-glib/qmi-endpoint.c:180
|
||||
#1 0x00007ffff7caf275 in qmi_device_command_abortable (self=self@entry=0x7fffe8006f00, message=message@entry=0x5555557e7330, message_context=message_context@entry=0x0, timeout=timeout@entry=30,
|
||||
abort_build_request_fn=abort_build_request_fn@entry=0x0, abort_parse_response_fn=abort_parse_response_fn@entry=0x0, abort_user_data=0x0, abort_user_data_free=0x0, cancellable=0x5555557e8a50,
|
||||
callback=0x7ffff7caf620 <transaction_abort_ready>, user_data=0x1120016) at ../../../libqmi-1.24.8/src/libqmi-glib/qmi-device.c:2301
|
||||
#2 0x00007ffff7caf87b in qmi_device_command_full (self=self@entry=0x7fffe8006f00, message=message@entry=0x5555557e7330, message_context=message_context@entry=0x0, timeout=timeout@entry=30,
|
||||
cancellable=<optimized out>, callback=callback@entry=0x7ffff7caf620 <transaction_abort_ready>, user_data=0x1120016) at ../../../libqmi-1.24.8/src/libqmi-glib/qmi-device.c:2375
|
||||
#3 0x00007ffff7caf966 in transaction_abort (self=0x7fffe8006f00, tr=tr@entry=0x7fffe0009800, abort_error_take=0x5555557fc3b0) at ../../../libqmi-1.24.8/src/libqmi-glib/qmi-device.c:361
|
||||
#4 0x00007ffff7cafaf5 in transaction_timed_out (ctx=0x5555557b8690, ctx@entry=<error reading variable: value has been optimized out>) at ../../../libqmi-1.24.8/src/libqmi-glib/qmi-device.c:385
|
||||
#5 0x00007ffff7809f94 in g_timeout_dispatch (source=0x5555558116b0, callback=<optimized out>, user_data=<optimized out>) at ../glib-2.60.7/glib/gmain.c:4678
|
||||
#6 0x00007ffff78094ef in g_main_dispatch (context=0x55555570c670) at ../glib-2.60.7/glib/gmain.c:3189
|
||||
#7 g_main_context_dispatch (context=context@entry=0x55555570c670) at ../glib-2.60.7/glib/gmain.c:3854
|
||||
#8 0x00007ffff78098c0 in g_main_context_iterate (context=0x55555570c670, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib-2.60.7/glib/gmain.c:3927
|
||||
#9 0x00007ffff7809bd3 in g_main_loop_run (loop=0x5555557233e0) at ../glib-2.60.7/glib/gmain.c:4123
|
||||
#10 0x000055555559bbc0 in main (argc=<optimized out>, argv=<optimized out>) at ../../ModemManager-1.12.8/src/main.c:206
|
||||
|
||||
https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/37
|
||||
|
||||
(cherry picked from commit ee61c03a76bf390693f04e8a5559c04ad87dac18)
|
||||
(cherry picked from commit 4ca7aa55b88ba2bdfc77259140e229a739a668e1)
|
||||
---
|
||||
src/libqmi-glib/qmi-device.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
|
||||
index 7e93fad079a4..da7161fde571 100644
|
||||
--- a/src/libqmi-glib/qmi-device.c
|
||||
+++ b/src/libqmi-glib/qmi-device.c
|
||||
@@ -2335,7 +2335,7 @@ qmi_device_command_abortable (QmiDevice *self,
|
||||
tr = transaction_new (self, message, message_context, cancellable, callback, user_data);
|
||||
|
||||
/* Device must be open */
|
||||
- if (!qmi_endpoint_is_open (self->priv->endpoint)) {
|
||||
+ if (!qmi_device_is_open (self)) {
|
||||
error = g_error_new (QMI_CORE_ERROR,
|
||||
QMI_CORE_ERROR_WRONG_STATE,
|
||||
"Device must be open to send commands");
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
From 1c316fcba53021d9179fb8702deafcb89a03ed64 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksander Morgado <aleksander@aleksander.es>
|
||||
Date: Mon, 15 Feb 2021 14:38:37 +0100
|
||||
Subject: [PATCH 2/2] libqmi-glib,endpoint-qmux: plug QmiClientCtl leak
|
||||
|
||||
This is a severe leak when using qmicli operations, as e.g. in OpenWRT
|
||||
based setups. It's shown as still reachable here, because it's really
|
||||
not a true leak as in we can no longer free it; there's some pointer
|
||||
to the objects around but we never free them, so the memory grows and
|
||||
keeps growing all the time.
|
||||
|
||||
==6589== 506,784 bytes in 10,558 blocks are still reachable in loss record 1,378 of 1,378
|
||||
==6589== at 0x4E84925: g_type_create_instance (in /usr/lib/libgobject-2.0.so.0.6600.7)
|
||||
==6589== by 0x4E7501D: ??? (in /usr/lib/libgobject-2.0.so.0.6600.7)
|
||||
==6589== by 0x4E768C3: g_object_new_valist (in /usr/lib/libgobject-2.0.so.0.6600.7)
|
||||
==6589== by 0x4E76C39: g_object_new (in /usr/lib/libgobject-2.0.so.0.6600.7)
|
||||
==6589== by 0x4911E39: client_ctl_setup (qmi-device.c:3009)
|
||||
==6589== by 0x4911FA2: check_type_async_ready (qmi-device.c:3047)
|
||||
==6589== by 0x4D39173: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)
|
||||
==6589== by 0x4D3D6E8: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)
|
||||
==6589== by 0x4916FEB: query_info_async_ready (qmi-file.c:105)
|
||||
==6589== by 0x4D39173: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)
|
||||
==6589== by 0x4D391A8: ??? (in /usr/lib/libgio-2.0.so.0.6600.7)
|
||||
==6589== by 0x4F01B83: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6600.7)
|
||||
==6589==
|
||||
==6589== LEAK SUMMARY:
|
||||
==6589== definitely lost: 0 bytes in 0 blocks
|
||||
==6589== indirectly lost: 0 bytes in 0 blocks
|
||||
==6589== possibly lost: 2,424 bytes in 25 blocks
|
||||
==6589== still reachable: 1,702,273 bytes in 33,071 blocks
|
||||
==6589== of which reachable via heuristic:
|
||||
==6589== length64 : 1,384 bytes in 28 blocks
|
||||
==6589== newarray : 1,776 bytes in 31 blocks
|
||||
==6589== suppressed: 0 bytes in 0 blocks
|
||||
|
||||
Fixes https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/39
|
||||
|
||||
(cherry picked from commit 36a990794307e47806a6be2f97e3eabde220640b)
|
||||
(cherry picked from commit 1a5c521daee8842ffc2d684fd326679c435779f7)
|
||||
---
|
||||
src/libqmi-glib/qmi-endpoint-qmux.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/libqmi-glib/qmi-endpoint-qmux.c b/src/libqmi-glib/qmi-endpoint-qmux.c
|
||||
index 5709f856679e..5cc21f68ff79 100644
|
||||
--- a/src/libqmi-glib/qmi-endpoint-qmux.c
|
||||
+++ b/src/libqmi-glib/qmi-endpoint-qmux.c
|
||||
@@ -504,6 +504,7 @@ dispose (GObject *object)
|
||||
QmiEndpointQmux *self = QMI_ENDPOINT_QMUX (object);
|
||||
|
||||
destroy_iostream (self);
|
||||
+ g_clear_object (&self->priv->client_ctl);
|
||||
|
||||
G_OBJECT_CLASS (qmi_endpoint_qmux_parent_class)->dispose (object);
|
||||
}
|
||||
--
|
||||
2.31.1
|
||||
|
@ -3,10 +3,13 @@
|
||||
Name: libqmi
|
||||
Summary: Support library to use the Qualcomm MSM Interface (QMI) protocol
|
||||
Version: 1.24.0
|
||||
Release: 1%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: LGPLv2+
|
||||
URL: http://freedesktop.org/software/libqmi
|
||||
|
||||
Source: http://freedesktop.org/software/libqmi/%{name}-%{version}.tar.xz
|
||||
Patch0001: 0001-detect-smdpkt-rh1976886.patch
|
||||
Patch0002: 0002-crash-qmi-device-rh1976888.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: glib2-devel >= 2.32.0
|
||||
@ -42,7 +45,7 @@ from the command line.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%autosetup -p1
|
||||
pathfix.py -i %{__python3} -pn build-aux/qmi-codegen/*.py \
|
||||
build-aux/qmi-codegen/qmi-codegen
|
||||
|
||||
@ -89,6 +92,12 @@ find %{buildroot}%{_datadir}/gtk-doc |xargs touch --reference configure.ac
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 19 2021 Thomas Haller <thaller@redhat.com> - 1.24.0-3
|
||||
- fix crash in qmi_endpoint_is_open() (rh #1976888)
|
||||
|
||||
* Mon Jul 19 2021 Thomas Haller <thaller@redhat.com> - 1.24.0-2
|
||||
- fix crash and detect QMI port over smdpkt subsystem (rh #1976886)
|
||||
|
||||
* Wed Oct 16 2019 Lubomir Rintel <lkundrak@v3.sk> - 1.24.0-1
|
||||
- Update to 1.24.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user