All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Nowak <lnowak.tyco@gmail.com>
To: ofono@ofono.org
Subject: [PATCH v3 1/2] gobi: Do not use low-power modes for some modems
Date: Fri, 24 Mar 2017 14:51:45 +0000	[thread overview]
Message-ID: <1490367106-8401-2-git-send-email-lnowak.tyco@gmail.com> (raw)
In-Reply-To: <1490367106-8401-1-git-send-email-lnowak.tyco@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]

From: Lukasz Nowak <lnowak@tycoint.com>

Telit QMI modems have a problem with the low-power operating modes.
After entering and leaving such a state, UIM service does not return.
The sim card is still marked as powered-down. The QMI interface does
not have a way to power it back on.

To avoid this, keep modems with the "AlwaysOnline" flag online
in the disable-modem and offline-modem procedures.
---
 plugins/gobi.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/plugins/gobi.c b/plugins/gobi.c
index 6a78941..06f906d 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -168,6 +168,16 @@ static void get_oper_mode_cb(struct qmi_result *result, void *user_data)
 
 	data->oper_mode = mode;
 
+	/*
+	 * Telit QMI LTE modem must remain online. If powered down, it also
+	 * powers down the sim card, and QMI interface has no way to bring
+	 * it back alive.
+	 */
+	if (ofono_modem_get_boolean(modem, "AlwaysOnline")) {
+		ofono_modem_set_powered(modem, TRUE);
+		return;
+	}
+
 	switch (data->oper_mode) {
 	case QMI_DMS_OPER_MODE_ONLINE:
 		param = qmi_param_new_uint8(QMI_DMS_PARAM_OPER_MODE,
@@ -353,6 +363,14 @@ static int gobi_disable(struct ofono_modem *modem)
 	qmi_service_cancel_all(data->dms);
 	qmi_service_unregister_all(data->dms);
 
+	/*
+	 * Telit QMI modem must remain online. If powered down, it also
+	 * powers down the sim card, and QMI interface has no way to bring
+	 * it back alive.
+	 */
+	if (ofono_modem_get_boolean(modem, "AlwaysOnline"))
+		goto out;
+
 	param = qmi_param_new_uint8(QMI_DMS_PARAM_OPER_MODE,
 					QMI_DMS_OPER_MODE_PERSIST_LOW_POWER);
 	if (!param)
@@ -362,6 +380,7 @@ static int gobi_disable(struct ofono_modem *modem)
 					power_disable_cb, modem, NULL) > 0)
 		return -EINPROGRESS;
 
+out:
 	shutdown_device(modem);
 
 	return -EINPROGRESS;
-- 
2.7.4


  reply	other threads:[~2017-03-24 14:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 14:51 [PATCH v3 0/2] Telit LE910 V1 QMI support Lukasz Nowak
2017-03-24 14:51 ` Lukasz Nowak [this message]
2017-03-24 15:08   ` [PATCH v3 1/2] gobi: Do not use low-power modes for some modems Denis Kenzior
2017-03-24 14:51 ` [PATCH v3 2/2] udevng: add Telit LE910 V1 support Lukasz Nowak
2017-03-24 15:16   ` Denis Kenzior
2017-03-24 15:56   ` Jonas Bonn
2017-03-24 23:07     ` Lukasz Nowak
2017-03-25 11:15       ` Lukasz Nowak
2017-03-25 20:59     ` Denis Kenzior
2017-03-24 15:11 ` [PATCH v3 0/2] Telit LE910 V1 QMI support Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490367106-8401-2-git-send-email-lnowak.tyco@gmail.com \
    --to=lnowak.tyco@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.