Re: [PATCH 0/9] tty: tty_struct dependency clean-ups

2016-09-15 Thread Greg Kroah-Hartman
On Fri, Sep 09, 2016 at 05:37:01PM -0500, Rob Herring wrote:
> This patch series removes or prepares to remove some of the dependencies 
> on tty_struct within tty_port drivers. This will allow using tty_ports 
> directly for so called UART slave devices. 
> 
> The first patch fixes a regression from the last round with tty 
> closing. Patches 2-4 are mechanical conversions generated with 
> coccinelle. This is my first adventure into coccinelle, so hopefully I 
> didn't screw things up. :) Only serial_core has some of its tty_struct 
> dependencies removed as those are the drivers we immediately care about 
> supporting slave devices with.
> 
> Next up after this are moving some functions to the tty_port ops. I've 
> got some WIP patches for some of that, but nothing ready to send out 
> quite yet.

I've applied the first patch here, and wanted to apply patch 3, but it
depended on #2, so I'll wait for your next round of patches.

thanks,

greg k-h


Re: [PATCH 0/9] tty: tty_struct dependency clean-ups

2016-09-12 Thread One Thousand Gnomes
On Sun, 11 Sep 2016 22:05:07 -0500
Rob Herring  wrote:

> On Sun, Sep 11, 2016 at 4:14 PM, One Thousand Gnomes
>  wrote:
> > On Fri,  9 Sep 2016 17:37:01 -0500
> > Rob Herring  wrote:
> >  
> >> This patch series removes or prepares to remove some of the dependencies
> >> on tty_struct within tty_port drivers. This will allow using tty_ports
> >> directly for so called UART slave devices.  
> >
> > You can create a tty_struct kernel side with the two tiny changes I
> > posted before. Why do you want to do invasive tree wide changes when you
> > can do simple ones ?  
> 
> Well, I don't want to do invasive changes, but I thought the idea was
> to use tty_port struct without a tty_struct.

I posted some tiny patches to break the file/tty requirement in the base
tty code for comment a while ago and they were very tiny for most ldiscs
(n_tty unsurprisingly wouldn't work this way but does anyone need kernel
mode n_tty ?)

Moving termios into the tty_port is IMHO a good thing to do whichever
approach is taken.

> I was planning to keep termios out of tty_port and make clients of
> tty_port carry it if for nothing else not quite understanding all the
> details around the lifetime, init and locking of it. If there's always
> a tty_struct then there's not much point moving it other than which
> struct makes more sense. But that would cause some churn.

The termios lifetime is the lifetime of the port, although it may get
reset at some times.

Alan


Re: [PATCH 0/9] tty: tty_struct dependency clean-ups

2016-09-11 Thread Rob Herring
On Sun, Sep 11, 2016 at 4:14 PM, One Thousand Gnomes
 wrote:
> On Fri,  9 Sep 2016 17:37:01 -0500
> Rob Herring  wrote:
>
>> This patch series removes or prepares to remove some of the dependencies
>> on tty_struct within tty_port drivers. This will allow using tty_ports
>> directly for so called UART slave devices.
>
> You can create a tty_struct kernel side with the two tiny changes I
> posted before. Why do you want to do invasive tree wide changes when you
> can do simple ones ?

Well, I don't want to do invasive changes, but I thought the idea was
to use tty_port struct without a tty_struct.

>> Next up after this are moving some functions to the tty_port ops. I've
>> got some WIP patches for some of that, but nothing ready to send out
>> quite yet.
>
> I think before this lot happens you need to decide where these structures
> belong. Termios and termios_locked for example could live in the tty_port
> as the physical tty is incapable of having multiple sets of terminal data
> at once.

I was planning to keep termios out of tty_port and make clients of
tty_port carry it if for nothing else not quite understanding all the
details around the lifetime, init and locking of it. If there's always
a tty_struct then there's not much point moving it other than which
struct makes more sense. But that would cause some churn.

Rob


Re: [PATCH 0/9] tty: tty_struct dependency clean-ups

2016-09-11 Thread One Thousand Gnomes
On Fri,  9 Sep 2016 17:37:01 -0500
Rob Herring  wrote:

> This patch series removes or prepares to remove some of the dependencies 
> on tty_struct within tty_port drivers. This will allow using tty_ports 
> directly for so called UART slave devices. 

You can create a tty_struct kernel side with the two tiny changes I
posted before. Why do you want to do invasive tree wide changes when you
can do simple ones ?

> Next up after this are moving some functions to the tty_port ops. I've 
> got some WIP patches for some of that, but nothing ready to send out 
> quite yet.

I think before this lot happens you need to decide where these structures
belong. Termios and termios_locked for example could live in the tty_port
as the physical tty is incapable of having multiple sets of terminal data
at once.

Really though this looks to me like *MASSIVE* churn for now purpose.
Create a tty_struct kernel side, and use that, the needed patch is then
tiny.

so IMHO NAK

Alan