Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1647749

Re: tty: n_gsm: fix closing multiplexer mode

From Sascha Hauer <s.hauer@pengutronix.de>
Newsgroups linux.kernel
Subject Re: tty: n_gsm: fix closing multiplexer mode
Date 2017-05-23 10:00 +0200
Message-ID <tKcTv-a4-5@gated-at.bofh.it> (permalink)
References <tJQJk-31p-3@gated-at.bofh.it> <tK05Y-Dl-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 |

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

tty: n_gsm: fix closing multiplexer mode Sascha Hauer <s.hauer@pengutronix.de> - 2017-05-22 10:20 +0200
  [PATCH 1/2] tty: n_gsm: do not send/receive in ldisc close path Sascha Hauer <s.hauer@pengutronix.de> - 2017-05-22 10:20 +0200
  [PATCH 2/2] tty: n_gsm: Add GSMIOC_DISCONNECT ioctl to disconnect the multiplexer Sascha Hauer <s.hauer@pengutronix.de> - 2017-05-22 10:20 +0200
    Re: [PATCH 2/2] tty: n_gsm: Add GSMIOC_DISCONNECT ioctl to  disconnect the multiplexer Sascha Hauer <s.hauer@pengutronix.de> - 2017-05-22 11:30 +0200
    Re: [PATCH 2/2] tty: n_gsm: Add GSMIOC_DISCONNECT ioctl to  disconnect the multiplexer Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-22 11:30 +0200
  Re: tty: n_gsm: fix closing multiplexer mode Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-05-22 20:20 +0200
    Re: tty: n_gsm: fix closing multiplexer mode Sascha Hauer <s.hauer@pengutronix.de> - 2017-05-23 10:00 +0200

csiph-web