From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753573AbbJARZ7 (ORCPT ); Thu, 1 Oct 2015 13:25:59 -0400 Received: from www.eclis.ch ([217.162.2.166]:42871 "EHLO mail.eclis.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751649AbbJARZ6 (ORCPT ); Thu, 1 Oct 2015 13:25:58 -0400 X-Greylist: delayed 1755 seconds by postgrey-1.27 at vger.kernel.org; Thu, 01 Oct 2015 13:25:57 EDT Message-ID: <560D65C7.30707@eclis.ch> Date: Thu, 01 Oct 2015 18:56:39 +0200 From: Jean-Christian de Rivaz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: Greg Kroah-Hartman , Jiri Slaby Cc: Thomas Osterried , David Ranch , Ralf Baechle DL5RB , linux-hams@trinnet.net, linux-hams@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Force mkiss to reset the line discipline when serial device is removed References: <20151001073117.GA31401@linux-mips.org> <1443691088-30478-1-git-send-email-jc@eclis.ch> In-Reply-To: <1443691088-30478-1-git-send-email-jc@eclis.ch> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg and Jiri, I try to fix a kernel panic bug related to the AX25 (and probably SLIP) line discipline when the corresponding serial device is removed [1]. I proposed some patches [2] [3] on the linux-hams mailing list but I think there raise more questions about how tty_ldisc_hangup() should work when a serial device is removed [4]. I actually see the following options: a) Let the specific line discipline set the TTY_DRIVER_RESET_TERMIOS flag in tty->driver as in [2] but this is suspected bad practice [5]. b) Let the specific line discipline set the TTY_OTHER_CLOSED flag in tty and check it in tty_ldisc_hangup() as in [3]. c) Let the specific line discipline set the TTY_LDISC_HALTED flag in tty and check it in tty_ldisc_hangup(). d) Let the specific line discipline set a new flag for that purpose, for example TTY_LDISC_RESET, and check it in tty_ldisc_hangup(). e) Close the tty earlier so that tty_ldisc_reinit() is not even called. Need some advise on how this should be done. f) That's all wrong, something other need to be changed. I would appreciate some comments from tty subsystem experts about this issue. [1] http://www.spinics.net/lists/linux-hams/msg03500.html [2] http://www.spinics.net/lists/linux-hams/msg03511.html [3] http://www.spinics.net/lists/linux-hams/msg03513.html [4] http://www.spinics.net/lists/linux-hams/msg03509.html [5] http://www.spinics.net/lists/linux-hams/msg03512.html Best Regards, Jean-Christian de Rivaz