Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752551AbdGLSZh (ORCPT ); Wed, 12 Jul 2017 14:25:37 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:45872 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102AbdGLSZg (ORCPT ); Wed, 12 Jul 2017 14:25:36 -0400 Date: Wed, 12 Jul 2017 19:25:22 +0100 From: Alan Cox To: Okash Khawaja Cc: Greg Kroah-Hartman , Samuel Thibault , linux-kernel@vger.kernel.org, William Hubbs , Chris Brannon , Kirk Reiser , speakup@linux-speakup.org, devel@driverdev.osuosl.org Subject: Re: [patch] staging: speakup: safely close tty Message-ID: <20170712192522.34f65e3b@alans-desktop> In-Reply-To: <20170711103913.GA561@sanghar> References: <20170707191301.GA3798@sanghar> <20170710125544.2aa4d12a@alans-desktop> <20170711103913.GA561@sanghar> Organization: Intel Corporation X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 807 Lines: 19 > spk_ttyio_initialise_ldisc is called separately for each module (e.g. > speakup_apollo, speakup_ltlk etc) when it is loaded. spk_ttyio_release > is also called separately for each module when it is unloaded. The ldisc > stays around until the last of the modules is unloaded. What guarantees that someone hasn't decided to set the ldisc on unrelated hardware to speakup (eg on a pty/tty pair). > > > > > I'd also btw strongly recommend putting the ldisc and the speakup tty > > driver as different modules. > Sure, that makes sense. I will do that following these patches. If the ldisc is just unregistered when the module implementing it is unloaded then the ref counts on the ldisc module should do everything needed if the above isn't correctly handled, and if it is will still be cleaner. Alan