Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753844AbcCATBs (ORCPT ); Tue, 1 Mar 2016 14:01:48 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:33770 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450AbcCATBp (ORCPT ); Tue, 1 Mar 2016 14:01:45 -0500 Subject: Re: [PATCH] serial: flush ldisc after hangup To: Josef Bacik , gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <1456855375-17175-1-git-send-email-jbacik@fb.com> <56D5DCA0.2040201@hurleysoftware.com> <56D5DDA6.5080605@fb.com> From: Peter Hurley Message-ID: <56D5E714.7030900@hurleysoftware.com> Date: Tue, 1 Mar 2016 11:01:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56D5DDA6.5080605@fb.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1651 Lines: 43 On 03/01/2016 10:21 AM, Josef Bacik wrote: > On 03/01/2016 01:17 PM, Peter Hurley wrote: >> Yeah, the race is that the ldisc should not be attempting i/o to >> the driver at all. This problem is fixed in -next already, but in >> the tty core rather than in each individual tty driver. >> > > Great! Which patch/patches fix this? I looked at linux-next and > there's a lot of refactoring stuff, do I need all the things or is > there a specific one that fixes this problem? Thanks, The series that fixes this design problem introduce in 3.10 are these patches: staging: digi: Replace open-coded tty_wakeup() serial: 68328: Remove bogus ldisc reset bluetooth: hci_ldisc: Remove dead code NFC: nci: Remove dead code tty: Remove chars_in_buffer() line discipline method tty: Fix unsafe ldisc reference via ioctl(TIOCGETD) n_tty: Fix unsafe reference to "other" ldisc tty: Reset c_line from driver's init_termios staging/speakup: Use tty_ldisc_ref() for paste kworker tty: Fix comments for tty_ldisc_get() tty: Fix comments for tty_ldisc_release() tty: Prepare for destroying line discipline on hangup tty: Handle NULL tty->ldisc tty: Move tty_ldisc_kill() tty: Use 'disc' for line discipline index name tty: Refactor tty_ldisc_reinit() for reuse tty: Destroy ldisc instance on hangup 'tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)' and 'tty: Fix unsafe reference to "other" ldisc' have already made their way to most stable trees, afaict. I doubt I'll submit any more of this series for stable; it's just too invasive. I'll probably do it per-driver, like your patch. Just an fyi. Regards, Peter Hurley