From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936140AbdEWHz0 (ORCPT ); Tue, 23 May 2017 03:55:26 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:59943 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934878AbdEWHzZ (ORCPT ); Tue, 23 May 2017 03:55:25 -0400 Date: Tue, 23 May 2017 09:55:21 +0200 From: Sascha Hauer To: Alan Cox Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , kernel@pengutronix.de Subject: Re: tty: n_gsm: fix closing multiplexer mode Message-ID: <20170523075521.asva3wqq7vb2pnhp@pengutronix.de> References: <20170522081500.21335-1-s.hauer@pengutronix.de> <20170522191617.35dd508f@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170522191617.35dd508f@alans-desktop> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:47:03 up 50 days, 29 min, 29 users, load average: 0.02, 0.03, 0.00 User-Agent: Mutt/1.6.2-neo (2016-06-11) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 |