aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/tty_port.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-18TTY: add tty_port_tty_wakeup helperJiri Slaby1-0/+16
It allows for cleaning up on a considerable amount of places. They did port_get, wakeup, kref_put. Now the only thing needed is to call tty_port_tty_wakeup which does exactly that. One exception is ifx6x60 where tty_wakeup was open-coded. We now call tty_wakeup properly there. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-15TTY: introduce tty_port_destroyJiri Slaby1-1/+15
After commit "TTY: move tty buffers to tty_port", the tty buffers are not freed in some drivers. This is because tty_port_destructor is not called whenever a tty_port is freed. This was an assumption I counted with but was unfortunately untrue. Those using refcounting are safe now, but for those which do not we introduce a function to be called right before the tty_port is freed by the drivers. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-15TTY: pty, fix tty buffers leakJiri Slaby1-1/+1
After commit "TTY: move tty buffers to tty_port", the tty buffers are not freed in some drivers. This is because tty_port_destructor is not called whenever a tty_port is freed. This was an assumption I counted with but was unfortunately untrue. So fix the drivers to fulfil this assumption. PTY is one of those, here we just need to use tty_port_put instead of kfree. (Assuming tty_port_destructor does not need port->ops to be set which we change here too.) Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-10-22TTY: move tty buffers to tty_portJiri Slaby1-0/+2
So this is it. The big step why we did all the work over the past kernel releases. Now everything is prepared, so nothing protects us from doing that big step. | | \ \ nnnn/^l | | | | \ / / | | | '-,.__ => \/ ,-` => | '-,.__ | O __.´´) ( .` | O __.´´) ~~~ ~~ `` ~~~ ~~ The buffers are now in the tty_port structure and we can start teaching the buffer helpers (insert char/string, flip etc.) to use tty_port instead of tty_struct all around. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-06tty_register_device_attr updated for tty-nextTomas Hlavacek1-0/+24
Added tty_device_create_release() and bound to dev->release in tty_register_device_attr(). Added tty_port_register_device_attr() and used in uart_add_one_port() instead of tty_register_device_attr(). Signed-off-by: Tomas Hlavacek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-08-13TTY: add tty_port_link_deviceJiri Slaby1-1/+21
This is for those drivers which do not have dynamic device creation (do not call tty_port_register_device) and do not want to implement tty->ops->install (will not call tty_port_install). They still have to provide the link somehow though. And this newly added function is exactly to serve that purpose. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-08-13TTY: tty_port, add some documentationJiri Slaby1-0/+21
I forgot to document tty_port_register_device and tty_port_install when they were added. Fix it now. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-08-10tty: localise the lockAlan Cox1-3/+3
The termios and other changes mean the other protections needed on the driver tty arrays should be adequate. Turn it all back on. This contains pieces folded in from the fixes made to the original patches | From: Geert Uytterhoeven <[email protected]> (fix m68k) | From: Paul Gortmaker <[email protected]> (fix cris) | From: Jiri Kosina <[email protected]> (lockdep) | From: Eric Dumazet <[email protected]> (lockdep) Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-16tty: move the termios object into the ttyAlan Cox1-3/+3
This will let us sort out a whole pile of tty related races. The alternative would be to keep points and refcount the termios objects. However 1. They are tiny anyway 2. Many devices don't use the stored copies 3. We can remove a pty special case Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-16tty: revert incorrectly applied lock patchAlan Cox1-3/+3
I sent GregKH this after the pre-requisites. He dropped the pre-requesites for good reason and unfortunately then applied this patch. Without this reverted you get random kernel memory corruption which will make bisecting anything between it and the properly applied patches a complete sod. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-07-06tty: localise the lockAlan Cox1-3/+3
The termios and other changes mean the other protections needed on the driver tty arrays should be adequate. Turn it all back on. This contains pieces folded in from the fixes made to the original patches | From: Geert Uytterhoeven <[email protected]> (fix m68k) | From: Paul Gortmaker <[email protected]> (fix cris) | From: Jiri Kosina <[email protected]> (lockdep) | From: Eric Dumazet <[email protected]> (lockdep) Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-13TTY: add tty_port_register_device helperJiri Slaby1-0/+9
This will automatically assign tty_port to tty_driver's port array for later recall in tty_init_dev. This is intended to be called instead of tty_register_device. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-13TTY: provide drivers with tty_port_installJiri Slaby1-0/+8
This will be used in tty_ops->install to set tty->port (and to call tty_standard_install). Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-06-02tty: Revert the tty locking series, it needs more workLinus Torvalds1-3/+3
This reverts the tty layer change to use per-tty locking, because it's not correct yet, and fixing it will require some more deep surgery. The main revert is d29f3ef39be4 ("tty_lock: Localise the lock"), but there are several smaller commits that built upon it, they also get reverted here. The list of reverted commits is: fde86d310886 - tty: add lockdep annotations 8f6576ad476b - tty: fix ldisc lock inversion trace d3ca8b64b97e - pty: Fix lock inversion b1d679afd766 - tty: drop the pty lock during hangup abcefe5fc357 - tty/amiserial: Add missing argument for tty_unlock() fd11b42e3598 - cris: fix missing tty arg in wait_event_interruptible_tty call d29f3ef39be4 - tty_lock: Localise the lock The revert had a trivial conflict in the 68360serial.c staging driver that got removed in the meantime. Signed-off-by: Linus Torvalds <[email protected]>
2012-05-04tty_lock: Localise the lockAlan Cox1-3/+3
In each remaining case the tty_lock is associated with a specific tty. This means we can now lock on a per tty basis. We do need tty_lock_pair() for the pty case. Uglier but still a step in the right direction. [fixed up calls in 3 missing drivers - gregkh] Signed-off-by: Alan Cox <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-01-24TTY: fix UV serial console regressionJiri Slaby1-5/+7
Commit 74c2107759d (serial: Use block_til_ready helper) and its fixup 3f582b8c110 (serial: fix termios settings in open) introduced a regression on UV systems. The serial eventually freezes while being used. It's completely unpredictable and sometimes needs a heap of traffic to happen first. To reproduce this, yast installation was used as it turned out to be pretty reliable in reproducing. Especially during installation process where one doesn't have an SSH daemon running. And no monitor as the HW is completely headless. So this was fun to find. Given the machine doesn't boot on vanilla before 2.6.36 final. (And the commits above are older.) Unless there is some bad race in the code, the hardware seems to be pretty broken. Otherwise pure MSR read should not cause such a bug, or? So to prevent the bug, revert to the old behavior. I.e. read modem status only if we really have to -- for non-CLOCAL set serials. Non-CLOCAL works on this hardware OK, I tried. See? I don't. And document that shit. Signed-off-by: Jiri Slaby <[email protected]> Cc: stable <[email protected]> References: https://lkml.org/lkml/2011/12/6/573 References: https://bugzilla.novell.com/show_bug.cgi?id=718518 Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-08-25TTY: use tty_wait_until_sent_from_close in tty_port_close_startJiri Slaby1-1/+1
Let's use the newly added helper to avoid stalls in drivers which are already ported to tty_port helpers. We have to ensure here, that there is no user of tty_port_close_start and tty_port_close which holds port->mutex (or other) lock over them. And sure, there is none. Signed-off-by: Jiri Slaby <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-11-05TTY: create drivers/tty and move the tty core files thereGreg Kroah-Hartman1-0/+446
The tty code should be in its own subdirectory and not in the char driver with all of the cruft that is currently there. Based on work done by Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Alan Cox <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>