Skip to contentSkip to conversation

patch "tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set" added to tty-linus

PATCH [email protected] 1 participant 1 message Apr 22, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set

to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

Quoted 1 line

From b2d89ad9c9682e795ed6eeb9ed455789ad6cedf1 Mon Sep 17 00:00:00 2001

From: Tony Lindgren <[email protected]>
Date: Sat, 7 Apr 2018 10:19:51 -0700
Subject: tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set

At least on droid 4 with control channel in ADM mode, there is no response to Modem Status Command (MSC). Currently gsmtty_modem_update() expects to have data in dlci->modem_rx unless debug & 2 is set. This means that on droid 4, things only work if debug & 2 is set.

Let's fix the issue by ignoring empty dlci->modem_rx for ADM mode. In the AMD mode, CMD_MSC will never respond and gsm_process_modem() won't get called to set dlci->modem_rx.

And according to ts_127010v140000p.pdf, MSC is only relevant if basic option is chosen, so let's test for that too.

Fixes ea3d8465ab9b ("tty: n_gsm: Allow ADM response in addition to UA for control dlci")
Cc Alan Cox <[email protected]>
Cc Dan Williams <[email protected]>
Cc Jiri Prchal <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Marcel Partap <[email protected]>
Cc Merlijn Wajer <[email protected]>
Cc Michael Nazzareno Trimarchi <[email protected]>
Cc Michael Scott <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Peter Hurley <[email protected]>
Cc Russ Gorby <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Sebastian Reichel <[email protected]>
Cc stable <[email protected]>
---
 drivers/tty/n_gsm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/tty/n_gsm.c +11 -0
index 7b1f8636f8e9..1dbe27c9946c 100644
@@ -2871,11 +2871,22 @@ static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk)
 static int gsm_carrier_raised(struct tty_port *port)
 {
 	struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port);
+	struct gsm_mux *gsm = dlci->gsm;
+
 	/* Not yet open so no carrier info */
 	if (dlci->state != DLCI_OPEN)
 		return 0;
 	if (debug & 2)
 		return 1;
+
+	/*
+	 * Basic mode with control channel in ADM mode may not respond
+	 * to CMD_MSC at all and modem_rx is empty.
+	 */
+	if (gsm->encoding == 0 && gsm->dlci[0]->mode == DLCI_MODE_ADM &&
+	    !dlci->modem_rx)
+		return 1;
+
 	return dlci->modem_rx & TIOCM_CD;
 }
 
Signature · 1 line
2.17.0