linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	kernel@pengutronix.de
Subject: Re: tty: n_gsm: fix closing multiplexer mode
Date: Tue, 23 May 2017 09:55:21 +0200	[thread overview]
Message-ID: <20170523075521.asva3wqq7vb2pnhp@pengutronix.de> (raw)
In-Reply-To: <20170522191617.35dd508f@alans-desktop>

On Mon, May 22, 2017 at 07:16:17PM +0100, Alan Cox wrote:
> > disconnect frame before initialising multiplex mode. Since it's not so
> > nice that userspace has to know the layout of a disconnect frame,
> > the second patch introduces a disconnect ioctl which can be issued
> > right before closing the physical port during the first session.
> > This ioctl is only useful when during the second session it is known
> > the the first session has been closed properly, so I'm not sure
> > how useful it is to introduce such an ioctl.
> 
> I don't think it justifies an ioctl and the likely use case is that the
> tty is hung up when the process dies so would already be in N_TTY at the
> point anyone tried to clean up.

Ok, so let's drop the second patch.

> 
> A more interesting question - and I don't have enough hardware to test
> this any more - would be whether we can safely send that sequence if our
> initial connects failed a few times so we try disconnect/reconnect.

In my current userspace test program I now unconditionally send the
sequence right before sending the AT+CMUX command. This works fine, no
matter if the modem was still in CMUX mode or not. I can only speak for
a UBLOX modem though, other modems might behave differently here. For
example my UBLOX needs the CLD message to close down the multiplexer,
just closing DLC0 does not work.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2017-05-23  7:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22  8:14 tty: n_gsm: fix closing multiplexer mode Sascha Hauer
2017-05-22  8:14 ` [PATCH 1/2] tty: n_gsm: do not send/receive in ldisc close path Sascha Hauer
2017-05-22  8:15 ` [PATCH 2/2] tty: n_gsm: Add GSMIOC_DISCONNECT ioctl to disconnect the multiplexer Sascha Hauer
2017-05-22  9:25   ` Greg Kroah-Hartman
2017-05-22  9:29     ` Sascha Hauer
2017-05-22 18:16 ` tty: n_gsm: fix closing multiplexer mode Alan Cox
2017-05-23  7:55   ` Sascha Hauer [this message]

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=20170523075521.asva3wqq7vb2pnhp@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).