From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id AB3EA1EF219; Thu, 13 Jul 2017 07:25:59 -0400 (EDT) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by befuddled.reisers.ca (Postfix) with ESMTPS id 3708D1EF10A for ; Thu, 13 Jul 2017 07:25:58 -0400 (EDT) Received: by mail-wm0-f68.google.com with SMTP id j85so4435983wmj.0 for ; Thu, 13 Jul 2017 04:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=sOy3E68RC7pGv0B5D8gfbgb70CW6GdI3gv65e7OVcQs=; b=EjYDwaJejLbPleO1FW1m5cngvnxB9cz5UTsUPIKLb4fHu3VmtHhKCWP0eNTgBAX3Bs CPYhWoC3mHPLh/t/a+RO9oAO7c1Bf2gEBLhloPDOn4gzWiU1va+WNQ1N6vrAkAbIJAQH +onO5rQ03uSVdCFvDwZk/yhoNISgcfozleAWoLnKJKdu4rohdg6b3Xzflq8pFIxjwxin X43tjmmXtGmrsxo+xsqrQSI5LFLCyyArbrypOKGN3hShrnAifBuqyEu0zCxvdom85AwU +oK8QkO2vqBcH+xssDpm6HLUj6T016MomYIf/U1Bda25BYSQKx3aZnPMGdegIGM8kG2M VcqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=sOy3E68RC7pGv0B5D8gfbgb70CW6GdI3gv65e7OVcQs=; b=cp+GzEzjuQtdhFA+Y3ZolyG6+7t0l7RjlYqUwqVgH3Vp1xNXmyHpRTpLQY1KH5IjKd RIrnH6tAvUElCcFx68clcetHE77SbbV5t0qlM9zoFGLcVhW7pbWYmoO11fYR6BhSU0Xp qOhJ59BjFoLpq0EODziF6VyP1WkazRc60C9Q2+qe93ZgyiHhqO+ROwMAKiSRXGiwONe8 D16lpyax9EveJSfRuHzgJz8UddNAx2TXmndnzeJC56NX0JYcByayD0B/tBzxbOXVBiQB q9K7BQxN4K+VLLDHZQiPe5yu+JARznPwIQMoaUbuhaVh18HClJjgQXd/2EISUpeMVnWC FI5g== X-Gm-Message-State: AIVw11248G0Z2fG4oxgSHMuETlTHFNocQGsLJ1GRBZlcaeHyDCbGwaXF RI9eJqUv9yjfAw== X-Received: by 10.28.142.138 with SMTP id q132mr1748759wmd.75.1499945087922; Thu, 13 Jul 2017 04:24:47 -0700 (PDT) Received: from sanghar ([2a00:23c4:7320:5900:224:d6ff:fe76:7136]) by smtp.gmail.com with ESMTPSA id 9sm6432959wml.25.2017.07.13.04.24.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 04:24:47 -0700 (PDT) Date: Thu, 13 Jul 2017 12:24:45 +0100 From: Okash Khawaja To: Alan Cox 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: <20170713112445.GA2696@sanghar> References: <20170707191301.GA3798@sanghar> <20170710125544.2aa4d12a@alans-desktop> <20170711103913.GA561@sanghar> <20170712192522.34f65e3b@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712192522.34f65e3b@alans-desktop> User-Agent: Mutt/1.8.3 (2017-05-23) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 11:25:59 -0000 On Wed, Jul 12, 2017 at 07:25:22PM +0100, Alan Cox wrote: > > 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. Right, I understand now. Thanks. I will update and resend this patch.