Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932260AbdCMWi7 (ORCPT ); Mon, 13 Mar 2017 18:38:59 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36167 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754325AbdCMWiv (ORCPT ); Mon, 13 Mar 2017 18:38:51 -0400 Date: Mon, 13 Mar 2017 22:38:47 +0000 From: Okash Khawaja To: Greg Kroah-Hartman Cc: Jiri Slaby , Samuel Thibault , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Kirk Reiser , speakup@linux-speakup.org, alan@linux.intel.com, Chris Brannon Subject: Re: [patch 1/7] tty_port: allow a port to be opened with a tty that has no file handle Message-ID: <20170313223847.GA337@sanghar> References: <20170313220551.312820470@gmail.com> <20170313220926.390471547@gmail.com> <20170313221247.GA22823@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170313221247.GA22823@kroah.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2072 Lines: 40 On Tue, Mar 14, 2017 at 06:12:47AM +0800, Greg Kroah-Hartman wrote: > On Mon, Mar 13, 2017 at 10:05:52PM +0000, okash.khawaja@gmail.com wrote: > > Allow access to TTY device from kernel. This is based on Alan Cox's patch > > (http://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1215095.html), > > with description quoted below. > > > > "tty_port: allow a port to be opened with a tty that has no file handle > > > > Let us create tty objects entirely in kernel space. > > > > With this a kernel created non file backed tty object could be used to handle > > data, and set terminal modes. Not all ldiscs can cope with this as N_TTY in > > particular has to work back to the fs/tty layer. > > > > The tty_port code is however otherwise clean of file handles as far as I can > > tell as is the low level tty port write path used by the ldisc, the > > configuration low level interfaces and most of the ldiscs. > > > > Currently you don't have any exposure to see tty hangups because those are > > built around the file layer. However a) it's a fixed port so you probably > > don't care about that b) if you do we can add a callback and c) you almost > > certainly don't want the userspace tear down/rebuild behaviour anyway. > > > > This should however be sufficient if we wanted for example to enumerate all > > the bluetooth bound fixed ports via ACPI and make them directly available. > > > > It doesn't deal with the case of a user opening a port that's also kernel > > opened and that would need some locking out (so it returned EBUSY if bound > > to a kernel device of some kind). That needs resolving along with how you > > "up" or "down" your new bluetooth device, or enumerate it while providing > > the existing tty API to avoid regressions (and to debug)." > > > > Signed-off-by: Okash Khawaja > > > > Reviewed-by: Samuel Thibault > > You do know this is already in 4.11-rc1, right? Please rebase your > patch set on 4.11-rc2 at the least and resend. Didn't realise that! Will resend