Skip to contentSkip to conversation

tty: n_gsm: Fix long delays with control frame timeouts in ADM mode

PATCH In review Tony Lindgren 2 participants 14 messages Apr 7, 2018 – Apr 16, 2018 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tty: n_gsm: Fix long delays with control frame timeouts in ADM mode

Commit ea3d8465ab9b ("tty: n_gsm: Allow ADM response in addition to UA for control dlci") added support for DLCI to stay in Asynchronous Disconnected Mode (ADM). But we still get long delays waiting for commands to other DLCI to complete:

--> 5) C: SABM(P)

Q>  0) C: UIH(F)
Q>  0) C: UIH(F)
Q>  0) C: UIH(F)

...

This happens because gsm_control_send() sets cretries timer to T2 that is by default set to 34. This will cause resend for T2 times for the control frame. In ADM mode, we will never get a response so the control frame, so retries are just delaying all the commands.

Let's fix the issue by setting DLCI_MODE_ADM flag after detecting the ADM mode for the control DLCI. Then we can use that in gsm_control_send() to set retries to 1. This means the control frame will be sent once allowing the other end at an opportunity to switch from ADM to ABM mode.

Note that retries will be decremented in gsm_control_retransmit() so we don't want to set it to 0 here.

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]>
---
 drivers/tty/n_gsm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/tty/n_gsm.c +11 -1
@@ -121,6 +121,9 @@ struct gsm_dlci {
 	struct mutex mutex;
 
 	/* Link layer */
+	int mode;
+#define DLCI_MODE_ABM		0	/* Normal Asynchronous Balanced Mode */
+#define DLCI_MODE_ADM		1	/* Asynchronous Disconnected Mode */
 	spinlock_t lock;	/* Protects the internal state */
 	struct timer_list t1;	/* Retransmit timer for SABM and UA */
 	int retries;
@@ -1364,7 +1367,13 @@ static struct gsm_control *gsm_control_send(struct gsm_mux *gsm,
 	ctrl->data = data;
 	ctrl->len = clen;
 	gsm->pending_cmd = ctrl;
-	gsm->cretries = gsm->n2;
+
+	/* If DLCI0 is in ADM mode skip retries, it won't respond */
+	if (gsm->dlci[0]->mode == DLCI_MODE_ADM)
+		gsm->cretries = 1;
+	else
+		gsm->cretries = gsm->n2;
+
 	mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100);
 	gsm_control_transmit(gsm, ctrl);
 	spin_unlock_irqrestore(&gsm->control_lock, flags);
@@ -1472,6 +1481,7 @@ static void gsm_dlci_t1(struct timer_list *t)
 			if (debug & 8)
 				pr_info("DLCI %d opening in ADM mode.\n",
 					dlci->addr);
+			dlci->mode = DLCI_MODE_ADM;
 			gsm_dlci_open(dlci);
 		} else {
 			gsm_dlci_close(dlci);
Signature · 1 line
2.17.0
#1 lore raw

PATCH 2/2 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]>
---
 drivers/tty/n_gsm.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/tty/n_gsm.c +11 -0
@@ -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
#2 lore raw
In reply to Tony Lindgren

Hi!

Quoted 16 lines

Commit ea3d8465ab9b ("tty: n_gsm: Allow ADM response in addition to UA for control dlci") added support for DLCI to stay in Asynchronous Disconnected Mode (ADM). But we still get long delays waiting for commands to other DLCI to complete:

--> 5) C: SABM(P)

Q>  0) C: UIH(F)
Q>  0) C: UIH(F)
Q>  0) C: UIH(F)

...

This happens because gsm_control_send() sets cretries timer to T2 that is by default set to 34. This will cause resend for T2 times for the control frame. In ADM mode, we will never get a response so the control frame, so retries are just delaying all the commands.

Quoted 7 lines

Let's fix the issue by setting DLCI_MODE_ADM flag after detecting the ADM mode for the control DLCI. Then we can use that in gsm_control_send() to set retries to 1. This means the control frame will be sent once allowing the other end at an opportunity to switch from ADM to ABM mode.

Note that retries will be decremented in gsm_control_retransmit() so we don't want to set it to 0 here.

Thanks!

I guess I'd like to test this on Droid4; there are fso-gsm0710muxd and gsm0710muxd packages in Debian, but I assume those do multiplexing in userspace and thus are not suitable?

Do you have a tool to use and a script?

Thanks and best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#3 lore raw
Quoted 3 lines · Pavel Machek

I guess I'd like to test this on Droid4; there are fso-gsm0710muxd and gsm0710muxd packages in Debian, but I assume those do multiplexing in userspace and thus are not suitable?

I don't think those are needed, we now have kernel n_gsm driver do most of the work for us :) Doing ldattach config is still needed, but eventually we should have a serdev driver do that too for us.

So apps should only do the ldattach part if node yet already done, and just attempt to use /dev/gsmtty* ports directly.

I did get serdev working with n_gsm several weeks ago with horrible hacks, it needs quite a bit more work though before it's ready..

Then we need to add proxying of some /dev/gsmtty* ports to W3GLTE to get that working (US only AFAIK for the band). It might make sense to add the proxy features to ModemManager eventually.

Quoted 1 line

Do you have a tool to use and a script?

Yes I used the shell script I posted earlier, but forgot it also needs the ldattach done.

Anyways, last night and today I wrote a quick test utility called droid4-ngsm that initializes things and I can use to do some experiments to get the ts27010 channel proxying to W3GLTE also going:

http://github.com/tmlind/droid4-ngsm/

Sorry could not resist adding a test call feature too :)

Hmm it might be best to add the ts27010 support and proxying eventually to ModemManager? I think ofono and others could still use the /dev/gsmtty* ports for the modem as needed too?

Regards,

Tony

#4 lore raw

Hi!

Quoted 11 lines
Quoted 1 line

Do you have a tool to use and a script?

Yes I used the shell script I posted earlier, but forgot it also needs the ldattach done.

Anyways, last night and today I wrote a quick test utility called droid4-ngsm that initializes things and I can use to do some experiments to get the ts27010 channel proxying to W3GLTE also going:

http://github.com/tmlind/droid4-ngsm/

Ok, now i'm confused. It wants to bind to ttyS0, but modem is on ttyUSB4 AFAICT? Or is the modem connected to serial port, too? (Do I need to enable some more drivers for that?)

I do have ttyS0, but I don't think there's anything attached there. Or is ttyS0 for the LTE modem?

Quoted 1 line

Sorry could not resist adding a test call feature too :)

:-)

Quoted 3 lines

Hmm it might be best to add the ts27010 support and proxying eventually to ModemManager? I think ofono and others could still use the /dev/gsmtty* ports for the modem as needed too?

I'm not sure how the userland should be designed...

Thanks,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#5 lore raw
Quoted 12 lines · Pavel Machek

Hi!

Quoted 10 lines
Quoted 1 line

Do you have a tool to use and a script?

Yes I used the shell script I posted earlier, but forgot it also needs the ldattach done.

Anyways, last night and today I wrote a quick test utility called droid4-ngsm that initializes things and I can use to do some experiments to get the ts27010 channel proxying to W3GLTE also going:

Quoted 8 lines
Quoted 1 line

http://github.com/tmlind/droid4-ngsm/

Ok, now i'm confused. It wants to bind to ttyS0, but modem is on ttyUSB4 AFAICT? Or is the modem connected to serial port, too? (Do I need to enable some more drivers for that?)

I do have ttyS0, but I don't think there's anything attached there. Or is ttyS0 for the LTE modem?

The ttyS0 is connected to mdm6600, and ttyUSB4 seems to be some buggy subset of ttyS0 n_gsm dlci1. You need need at least the following commits in current mainline kernel:

984c7706ff18 ("ARM: dts: omap4-droid4: Configure uart1 pins") e5b9fd7bdeb5 ("ARM: dts: omap4-droid4: Configure MDM6600 USB PHY")

And then you need PHY_MAPPHONE_MDM6600 and CONFIG_N_GSM enabled.

Regards,

Tony

#6 lore raw

Hi!

Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
Quoted 1 line

Do you have a tool to use and a script?

Yes I used the shell script I posted earlier, but forgot it also needs the ldattach done.

Anyways, last night and today I wrote a quick test utility called droid4-ngsm that initializes things and I can use to do some experiments to get the ts27010 channel proxying to W3GLTE also going:

Quoted 8 lines
Quoted 1 line

http://github.com/tmlind/droid4-ngsm/

Ok, now i'm confused. It wants to bind to ttyS0, but modem is on ttyUSB4 AFAICT? Or is the modem connected to serial port, too? (Do I need to enable some more drivers for that?)

I do have ttyS0, but I don't think there's anything attached there. Or is ttyS0 for the LTE modem?

Quoted 8 lines

The ttyS0 is connected to mdm6600, and ttyUSB4 seems to be some buggy subset of ttyS0 n_gsm dlci1. You need need at least the following commits in current mainline kernel:

984c7706ff18 ("ARM: dts: omap4-droid4: Configure uart1 pins") e5b9fd7bdeb5 ("ARM: dts: omap4-droid4: Configure MDM6600 USB PHY")

And then you need PHY_MAPPHONE_MDM6600 and CONFIG_N_GSM enabled.

Ok, I should have all that enabled. But droid4-ngsm still fails:

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..

commit 984c7706ff180e33096c57183435d925cb644576 says:

ARM: dts: omap4-droid4: Configure uart1 pins

These are needed to use the n_gsm driver for TS 27.010 UART
multiplexing. Note that support for the OOB wake gpio is still
missing so the UART is not yet usable for n_gsm.

...am I still missing the OOB wake gpio support?

Thanks,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#7 lore raw
Quoted 8 lines · Pavel Machek

Ok, I should have all that enabled. But droid4-ngsm still fails:

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..

I guess you must have phy-mapphone-mdm6600 enabled as you a have working modem over USB. What do you see in dmesg if you enable n_gsm debug with modprobe n_gsm debug=0xff or on kernel cmdline?

Quoted 9 lines

commit 984c7706ff180e33096c57183435d925cb644576 says:

ARM: dts: omap4-droid4: Configure uart1 pins

These are needed to use the n_gsm driver for TS 27.010 UART
multiplexing. Note that support for the OOB wake gpio is still
missing so the UART is not yet usable for n_gsm.

...am I still missing the OOB wake gpio support?

We can get away without OOB wake gpio for a while as mdm6600 is not yet suspended over USB. But if you have manually suspended mdm6600 USB interface via /sys, then it won't respond properly on n_gsm either.

Regards,

Tony

#8 lore raw
Quoted 10 lines · Tony Lindgren
Quoted 8 lines · Pavel Machek

Ok, I should have all that enabled. But droid4-ngsm still fails:

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Quoted 3 lines

I guess you must have phy-mapphone-mdm6600 enabled as you a have working modem over USB. What do you see in dmesg if you enable n_gsm debug with modprobe n_gsm debug=0xff or on kernel cmdline?

Ok, I guess I can do that, but first:

Should the modem respond to AT commands on ttyS0? I launched minicom (115200 8N1) and I'm not getting any responses.

Quoted 8 lines
Quoted 8 lines

commit 984c7706ff180e33096c57183435d925cb644576 says:

ARM: dts: omap4-droid4: Configure uart1 pins

These are needed to use the n_gsm driver for TS 27.010 UART
multiplexing. Note that support for the OOB wake gpio is still
missing so the UART is not yet usable for n_gsm.

Quoted 6 lines
Quoted 1 line

...am I still missing the OOB wake gpio support?

We can get away without OOB wake gpio for a while as mdm6600 is not yet suspended over USB. But if you have manually suspended mdm6600 USB interface via /sys, then it won't respond properly on n_gsm either.

Ahha, ok.

Thanks,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#9 lore raw
Quoted 2 lines · Pavel Machek

Should the modem respond to AT commands on ttyS0? I launched minicom (115200 8N1) and I'm not getting any responses.

Not that I know. At least I never got anything out of it. But who knows, maybe it is in normal mode initially during boot or when mdm6600 is being flashed.

Regards,

Tony

#10 lore raw
In reply to Tony Lindgren
Quoted 10 lines · Tony Lindgren
Quoted 8 lines · Pavel Machek

Ok, I should have all that enabled. But droid4-ngsm still fails:

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Quoted 3 lines

I guess you must have phy-mapphone-mdm6600 enabled as you a have working modem over USB. What do you see in dmesg if you enable n_gsm debug with modprobe n_gsm debug=0xff or on kernel cmdline?

Ok, let me try... Got some debugging output, hopefully you can see what is going on there?

Thanks,
Pavel

sudo insmod /tmp/n_gsm.ko debug=0xff

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
^CCould not set conf: Interrupted system call
Could not start ngsm: Interrupted system call
[ 3378.381134] cpcap-usb-phy cpcap-usb-phy.0: connected to USB host
[ 3408.460937] cpcap-usb-phy cpcap-usb-phy.0: connected to USB host
[ 3413.633239] Q>  0) R: UIH(F)
[ 3413.639190] C3
[ 3413.642761] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3413.653564] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3413.978942] Q>  0) R: UIH(F)
[ 3413.984924] C3
[ 3413.988586] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3413.999114] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3414.328247] Q>  0) R: UIH(F)
[ 3414.333068] C3
[ 3414.336608] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3414.346984] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3414.679870] gsmld_output: 00000000: f9 03 3f 01 1c f9
..?...
[ 3414.690979] --> 0) C: SABM(P)
[ 3414.798370] gsmld_output: 00000000: f9 03 3f 01 1c f9
..?...
[ 3414.809570] --> 0) C: SABM(P)
[ 3414.918243] gsmld_output: 00000000: f9 03 3f 01 1c f9
..?...
[ 3414.928588] --> 0) C: SABM(P)
[ 3416.743682] Q>  0) R: UIH(F)
[ 3416.748352] C3
[ 3416.751800] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3416.762145] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3417.088256] Q>  0) R: UIH(F)
[ 3417.093078] C3
[ 3417.096679] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3417.107208] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3417.438201] Q>  0) R: UIH(F)
[ 3417.443206] C3
[ 3417.446990] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3417.457733] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3417.788330] gsmld_output: 00000000: f9 03 3f 01 1c f9
..?...
[ 3417.799163] --> 0) C: SABM(P)
[ 3417.918243] gsmld_output: 00000000: f9 03 3f 01 1c f9
..?...
[ 3417.929107] --> 0) C: SABM(P)
[ 3418.038208] gsmld_output: 00000000: f9 03 3f 01 1c f9
..?...
[ 3418.049102] --> 0) C: SABM(P)
[ 3419.854248] Q>  0) R: UIH(F)
[ 3419.859527] C3
[ 3419.863555] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3419.874481] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3420.208221] Q>  0) R: UIH(F)
[ 3420.213500] C3
[ 3420.217498] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3420.228393] gsmld_output: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3420.598205] Q>  0) R: UIH(F)
[ 3420.603515] C3
[ 3420.607513] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3420.618377] gsmld_output: 00000000: 7e 01 ef c3 aa 7e

~....~
user@devuan:/my/droid4-ngsm$

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#11 lore raw
Quoted 15 lines · Pavel Machek

sudo insmod /tmp/n_gsm.ko debug=0xff

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
^CCould not set conf: Interrupted system call
Could not start ngsm: Interrupted system call
Quoted 7 lines
[ 3378.381134] cpcap-usb-phy cpcap-usb-phy.0: connected to USB host
[ 3408.460937] cpcap-usb-phy cpcap-usb-phy.0: connected to USB host
[ 3413.633239] Q>  0) R: UIH(F)
[ 3413.639190] C3
[ 3413.642761] gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
~....~
[ 3413.653564] gsmld_output: 00000000: 7e 01 ef c3 aa 7e

OK so no response from the modem. After few of the above packets, you should then also see something coming back:

gsm_data_kick: 00000000: 7e 01 ef c3 aa 7e
gsmld_output: 00000000: 7e 01 ef c3 aa 7e
gsmld_output: 00000000: f9 03 3f 01 1c f9
--> 0) C: SABM(P)
gsmld_output: 00000000: f9 03 3f 01 1c f9
--> 0) C: SABM(P)
gsmld_receive: 00000000: f9 03 1f 01 36 f9
<-- 0) C: DM(P)
gsmld_output: 00000000: f9 03 3f 01 1c f9
--> 0) C: SABM(P)
gsmld_receive: 00000000: f9 03 1f 01 36 f9
<-- 0) C: DM(P)
DLCI 0 opening in ADM mode.

Do you have phy-mapphone-mdm6600 loaded? That is still needed to configure all the boot mode pins for the modem so it is usable.. The UART will then work also without ohci-platform, just the USB PHY is disabled without ohci-platform.

I have these in my .config:
CONFIG_SERIAL_8250_OMAP=y
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP=y
CONFIG_PHY_MAPPHONE_MDM6600=m
CONFIG_N_GSM=m

And then the two patches from $subject thread. I just tried it with today's mainline kernel and it's still working for me.

Maybe you're missing some related patch though if usingv4.16?

984c7706ff18 ("ARM: dts: omap4-droid4: Configure uart1 pins") e5b9fd7bdeb5 ("ARM: dts: omap4-droid4: Configure MDM6600 USB PHY") fdd192037fce ("ARM: dts: omap4-droid4: Fix USB PHY port naming") bca809d8183c ("ARM: omap2plus_defconfig: Enable MDM6600 USB PHY") 077e1cde78c3 ("ARM: omap2plus_defconfig: Enable 8250_OMAP"

So maybe you're still using CONFIG_SERIAL_OMAP=y instead of CONFIG_SERIAL_8250_OMAP=y?

Regards,

Tony

Tested-by
#12 lore raw
Quoted 18 lines

Do you have phy-mapphone-mdm6600 loaded? That is still needed to configure all the boot mode pins for the modem so it is usable.. The UART will then work also without ohci-platform, just the USB PHY is disabled without ohci-platform.

I have these in my .config:
CONFIG_SERIAL_8250_OMAP=y
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP=y
CONFIG_PHY_MAPPHONE_MDM6600=m
CONFIG_N_GSM=m

And then the two patches from $subject thread. I just tried it with today's mainline kernel and it's still working for me.

Maybe you're missing some related patch though if usingv4.16?

Quoted 8 lines

984c7706ff18 ("ARM: dts: omap4-droid4: Configure uart1 pins") e5b9fd7bdeb5 ("ARM: dts: omap4-droid4: Configure MDM6600 USB PHY") fdd192037fce ("ARM: dts: omap4-droid4: Fix USB PHY port naming") bca809d8183c ("ARM: omap2plus_defconfig: Enable MDM6600 USB PHY") 077e1cde78c3 ("ARM: omap2plus_defconfig: Enable 8250_OMAP"

So maybe you're still using CONFIG_SERIAL_OMAP=y instead of CONFIG_SERIAL_8250_OMAP=y?

Ahha, so first I missed two of the patches, and second, I was not patient enough. I was stopping my test after first or second error. Now I get... so I guess it works for me.

Thanks!

For the series:

Pavel

user@devuan:/my/droid4-ngsm$ sudo ./droid4-ngsm
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Testing ngsm..
Could not open /dev/gsmtty1: Level 2 halted
Trying to start ngsm again: Level 2 halted
Starting ngsm..
Testing ngsm..
1> U0000AT+CFUN?
1<
Enable speaker phone..
2> U0001AT+EACC=3,0
2<
2> U0002AT+CMUT=0
2<
2> U0003AT+NREC=1
2<
2> U0004AT+CLVL=6
2<
Started ngsm, press Ctrl-C to exit when done
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#13 lore raw
Quoted 3 lines · Pavel Machek

Ahha, so first I missed two of the patches, and second, I was not patient enough. I was stopping my test after first or second error. Now I get... so I guess it works for me.

OK good to hear.

Quoted 3 lines

For the series:

Thanks for testing.

Quoted 3 lines

Testing ngsm..
1> U0000AT+CFUN?
1<

Hmm droid4-ngsm should show the response or error out as you already probably figured out :)

Regards,

Tony