aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | USB serial: update the console driverAlan Stern2009-09-191-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1292) modifies the USB serial console driver, to make it compatible with the recent changes to the USB serial core. The most important change is that serial->disc_mutex now has to be unlocked following a successful call to usb_serial_get_by_index(). Other less notable changes include: Use the requested port number instead of port 0 always. Prevent the serial device from being autosuspended. Use the ASYNCB_INITIALIZED flag bit to indicate when the port hardware has been initialized. In spite of these changes, there's no question that the USB serial console code is still a big hack. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: straighten out serial_openAlan Stern2009-09-191-37/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1291) removes a bunch of code from serial_open(), things that were rendered unnecessary by earlier patches. A missing spinlock is added to protect port->port.count, which needs to be incremented even if the open fails but not if the tty has gotten a hangup. The test for whether the hardware has been initialized, based on the use count, is replaced by a more transparent test of the ASYNCB_INITIALIZED bit in the port flags. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: add missing tests and debug linesAlan Stern2009-09-191-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1290) adds some missing tests. serial_down() isn't supposed to do anything if the hardware hasn't been initialized, and serial_close() isn't supposed to do anything if the tty has gotten a hangup (because serial_hangup() takes care of shutting down the hardware). The patch also updates and adds a few debugging lines. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: rename subroutinesAlan Stern2009-09-191-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1289) renames serial_do_down() to serial_down() and serial_do_free() to serial_release(). It also adds a missing call to tty_shutdown() in serial_release(). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: fix termios initialization logicAlan Stern2009-09-191-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1288) fixes the initialization logic in serial_install(). A new tty always needs to have a termios initialized no matter what, not just in the case where the lower driver will override the termios settings. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: acquire references when a new tty is installedAlan Stern2009-09-191-64/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1287) makes serial_install() be reponsible for acquiring references to the usb_serial structure and the driver module when a tty is first used. This is more sensible than having serial_open() do it, because a tty can be opened many times whereas it is installed only once, when it is created. (Not to mention that these actions are reversed when the tty is released, not when it is closed.) Finally, it is at install time that the TTY core takes its own reference to the usb_serial module, so it is only fitting that we should act the same way in regard to the lower-level serial driver. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: change logic of serial lookupsAlan Stern2009-09-191-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1286) changes usb_serial_get_by_index(). Now the routine will check whether the serial device has been disconnected; if it has then the return value will be NULL. If the device hasn't been disconnected then the routine will return with serial->disc_mutex held, so that the caller can use the structure without fear of racing against driver unloads. This permits the scope of table_mutex in destroy_serial() to be reduced. Instead of protecting the entire function, it suffices to protect the part that actually uses serial_table[], i.e., the call to return_serial(). There's no longer any danger of the refcount being incremented after it reaches 0 (which was the reason for having the large scope previously), because it can't reach 0 until the serial device has been disconnected. Also, the patch makes serial_install() check that serial is non-NULL before attempting to use it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: put subroutines in logical orderAlan Stern2009-09-191-77/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1285) rearranges the subroutines in usb-serial.c concerned with tty lifetimes into a more logical order: install, open, hangup, close, release. It also updates the formatting of the kerneldoc comments. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | usb-serial: change referencing of port and serial structuresAlan Stern2009-09-191-75/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1284) changes the referencing of the usb_serial and usb_serial_port structures in usb-serial.c. It's not feasible to make the port structures keep a reference to the serial structure, because the ports need to remain in existence when serial is released -- quite a few of the drivers expect this. Consequently taking a reference to the port when the device file is open is insufficient; such a reference would not pin serial. To fix this, we now take a reference to serial when the device file is opened. The final put_device() for the ports occurs in destroy_serial(), so that the ports will last as long as they are needed. The patch initializes all the port devices, including those in the unused "fake" ports. This makes the code more uniform because they can all be released in the same way. The error handling code in usb_serial_probe() is much simplified by this approach; instead of freeing everything by hand we can use a single usb_serial_put() call. Also simplified is the port-release mechanism. Instead of being two separate routines, port_release() and port_free() can be combined into one. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: Char: mxser, use THRE for ASPP_OQUEUE ioctlJiri Slaby2009-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In moxa specific ASPP_OQUEUE ioctl command, they apparently want only know whether there is space in transmitter hold register. So switch UART_LSR_TEMT to UART_LSR_THRE in that specific case according to the change in 1.14 moxa drivers. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: Char: mxser, add support for CP112ULJiri Slaby2009-09-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for MOXA:0x1120 pci device. It's a 2-port device and differs in no way from the others. So this turns out to be a trivial pci_device_id change. Increase also the version number. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | uartlite: support shared interrupt linesPeter Korsgaard2009-09-191-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | Adapt isr to work with shared interrupt lines. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: USB: serial/mct_u232, fix tty refcntJiri Slaby2009-09-191-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stanse found a tty refcnt leak in read_int_callback. In fact it's handled wrong altogether. tty_port_tty_get can return NULL and it's not checked in that manner. Fix that by checking the tty_port_tty_get retval and put tty kref properly. http://stanse.fi.muni.cz/ Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: riscom8, fix tty refcntJiri Slaby2009-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stanse found a tty refcnt leak on one fail path in rc_transmit. Fix that by jumping to the 'out' label. http://stanse.fi.muni.cz/ Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: riscom8, fix shutdown declarationJiri Slaby2009-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tty_port_ops.shutdown takes only one parameter: tty port. Remove the second one and use port->tty where needed instead. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | TTY: fix typosAlan Stern2009-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1282) fixes some obvious typos in the TTY core. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: Power: fix suspend vt regressionJiri Slaby2009-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vt_waitactive no longer accepts console parameter as console-1 since commit "vt: add an event interface". It expects console number directly (as viewed by userspace -- counting from 1). Fix a deadlock suspend regression by redefining adding one to vt in vt_move_to_console. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: vt: use printk_onceMarcin Slusarz2009-09-192-8/+2
| | | | | | | | | | | | | | | | | | Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: handle VT specific compat ioctls in vt driverArnd Bergmann2009-09-193-0/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VT specific compat_ioctl handlers are the only ones in common code that require the BKL. Moving them into the vt driver lets us remove the BKL from the other handlers and cleans up the code. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | n_tty: move echoctl check and clean up logicJoe Peterson2009-09-191-28/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check L_ECHOCTL before insertting a character in the echo buffer (rather than as the buffer is processed), to be more consistent with when all other L_ flags are checked. Also cleaned up the related logic. Note that this and the previous patch ("n_tty: honor opost flag for echoes") were verified together by the reporters of the bug that patch addresses (http://bugs.linuxbase.org/show_bug.cgi?id=2692), and the test now passes. Signed-off-by: Joe Peterson <joe@skyrush.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | n_tty: honor opost flag for echoesJoe Peterson2009-09-191-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following bug: http://bugs.linuxbase.org/show_bug.cgi?id=2692 Causes processing of echoed characters (output from the echo buffer) to honor the O_OPOST flag, which is consistent with the old behavior. Note that this and the next patch ("n_tty: move echoctl check and clean up logic") were verified together by the bug reporters, and the test now passes. Signed-off-by: Joe Peterson <joe@skyrush.com> Cc: Linux Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: USB serial termios bitsAlan Cox2009-09-1911-107/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | Various drivers have hacks to mangle termios structures. This stems from the fact there is no nice setup hook for configuring the termios settings when the port is created Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | Set proper console speed on resume if console suspend is disabledDeepak Saxena2009-09-191-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b5b82df6, from May 2007, breaks no_console_suspend on the OLPC XO laptop. Basically what happens is that upon returning from resume, serial8250_resume_port() will reconfigure the port for high speed mode and all console output will be garbled, making debug of the resume path painful. This patch modifies uart_resume_port() to reset the port to the state it was in before we suspended. Original patch by Marcelo Tosatti Second patch by Deepak then reworked by Alan to fit with the tty changes before it got submitted. Also fixed the console path to set c_i/ospeed as some drivers require the termios fields are valid Signed-off-by: Deepak Saxena <dsaxena@laptop.org> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: introduce tty krefsAlan Cox2009-09-191-3/+3
| | | | | | | | | | | | | | | | | | | | | Initially just use the helper and thus krefs when we set and clear the port values. Signed-off-by: Alan Cox <alan@linux.intel.com>
| * | serial: kill USF_CLOSING_* definitionsAlan Cox2009-09-192-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The serial layer for some reason uses different defines for the special case close delays and then conditionally switches to/from the normal ones in the ioctls. Remove this rather pointless abstraction Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: move port users helperAlan Cox2009-09-192-4/+7
| | | | | | | | | | | | | | | | | | | | | This little helper is now tty_port specific and useful generally so move it Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: move delta_msr_wait into the tty_portAlan Cox2009-09-1932-54/+54
| | | | | | | | | | | | | | | | | | | | | This is used by various drivers not just serial and can be extracted as commonality Signed-off-by: Alan Cox <alan@linux.intel.com>
| * | serial: replace the state mutex with the tty port mutexAlan Cox2009-09-193-114/+123
| | | | | | | | | | | | | | | | | | | | | | | | They cover essentially the same stuff and we can therefore fold it into the tty_port one. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: kill off uif_tAlan Cox2009-09-191-11/+0
| | | | | | | | | | | | | | | | | | | | | This typedef is now extinct Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: move the flags into the tty_port fieldAlan Cox2009-09-193-105/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fortunately the serial layer was designed to use the same flag values but with different names. It has its own SUSPENDED flag which is a free slot in the ASYNC flags so we allocate it in the ASYNC flags instead. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: move count into the tty_port versionAlan Cox2009-09-192-19/+20
| | | | | | | | | | | | | | | | | | | | | Remove more stuff from the serial special case code Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: use tty_port pointers in the core codeAlan Cox2009-09-191-142/+146
| | | | | | | | | | | | | | | | | | | | | | | | Extract out a lot of the x.port. uses and also show up where there are things left to be isolated that prevent use using the port helpers in the serial layer at this point Signed-off-by: Alan Cox <alan@linux.intel.com>
| * | serial: Fold closing_* fields into the tty_port onesAlan Cox2009-09-193-17/+15
| | | | | | | | | | | | | | | | | | | | | Remove some more serial specific use Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | serial: kill off uart_infoAlan Cox2009-09-1950-432/+422
| | | | | | | | | | | | | | | | | | | | | | | | We moved this into uart_state, now move the fields out of the separate structure and kill it off. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | isicom: split the open method for the isicom deviceAlan Cox2009-09-191-8/+24
| | | | | | | | | | | | | | | | | | Again moving towards being able to add a common open method Signed-off-by: Alan Cox <alan@linux.intel.com>
| * | tty: USB does not need the filp argument in the driversAlan Cox2009-09-1941-131/+68
| | | | | | | | | | | | | | | | | | | | | | | | And indeed none of them use it. Clean this up as it will make moving to a standard open method rather easier. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | vt: add an activate and lockAlan Cox2009-09-192-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | X and other graphical interfaces need to be able to flip to a console and lock it into graphics mode without races. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | vt: move kernel stuff out of vt.hAlan Cox2009-09-192-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | We have vt_kern.h for this Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | vt: remove power stuff from kernel/powerAlan Cox2009-09-193-58/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | In the past someone gratuitiously borrowed chunks of kernel internal vt code and dumped them in kernel/power. They have all sorts of deep relations with the vt code so put them in the vt tree instead Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | vt: add an event interfaceAlan Cox2009-09-194-52/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed and requested in various forms for ConsoleKit, screenblank handling and the like so do the job with a single interface. Also build the interface so that unlike VT_WAITACTIVE and friends it won't miss events. FIXME: Should this be a waitactive ioctl or a new device file you can poll and read events from. We need the code anyway to fix up the existing broken wait for console switch logic but the ConsoleKit people would prefer the new device to the ioctl we have here Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: USB can now use the shutdown method for kref based freeing of portsAlan Cox2009-09-191-21/+7
| | | | | | | | | | | | | | | | | | Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: remove dtr/rts use from the driver open methodsAlan Cox2009-09-191-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | These are handled by the tty_port core code which will raise and lower the carrier correctly in tty_wait_until_ready Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: USB hangup is racyAlan Cox2009-09-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB layer uses tty_hangup to deal with unplugs of the physical hardware (analogous to loss of carrier) and then frees the resources. However the tty_hangup is asynchronous. As the hangup can sleep we can use tty_vhangup which is the non async version to avoid freeing resources too early. Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | cdc_acm: Fix to use modern speed interfacesAlan Cox2009-09-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | This changed in 2006 so its about time the ACM driver caught up Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: make the kref destructor occur asynchronouslyAlan Cox2009-09-191-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | We want to be able to sleep in the destructor for USB at least. It isn't a hot path so just pushing it to a work queue doesn't really cause any difficulty. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | cyclades: use the full port_close functionAlan Cox2009-09-191-19/+17
| | | | | | | | | | | | | | | | | | | | | Convert cyclades to use the full tty_port_close helper Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | tty: riscom8 kref and tty_port_closeAlan Cox2009-09-191-72/+59
| | | | | | | | | | | | | | | | | | | | | We need to kref this driver in order to use port_close Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * | isicom: Split the close hardware bits outAlan Cox2009-09-191-11/+14
| | | | | | | | | | | | | | | | | | Start to extract and build a model for a common tty_port_close() Signed-off-by: Alan Cox <alan@linux.intel.com>
| * | mxser: Split close ready for a standard tty_port_close methodAlan Cox2009-09-191-22/+23
| | | | | | | | | | | | | | | | | | Prepare for the tty_port_close function by splitting out methods Signed-off-by: Alan Cox <alan@linux.intel.com>
| * | riscom8: split open and close methods upAlan Cox2009-09-191-21/+26
| | | | | | | | | | | | | | | | | | | | | Moving towards a tty_port method for open/close Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>