summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_core.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serialLinus Torvalds2006-10-031-6/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial: (21 commits) [SERIAL] add PNP IDs for FPI based touchscreens [SERIAL] Magic SysRq SAK does nothing on serial consoles [SERIAL] tickle NMI watchdog on serial output. [SERIAL] Fix oops when removing suspended serial port [SERIAL] Fix resume handling bug [SERIAL] Remove wrong asm/serial.h inclusions [SERIAL] CONFIG_PM=n slim: drivers/serial/8250_pci.c [SERIAL] OMAP1510 serial fix for 115200 baud [SERIAL] returning proper error from serial core driver [SERIAL] Make uart_line_info() correctly tell MMIO from I/O port [SERIAL] suspend/resume handlers don't have level arg anymore [SERIAL] 8250 resourse management fixes [SERIAL] serial_cs: Add quirk for brainboxes 2-port RS232 card [SERIAL] serial_cs: handle Nokia multi->single port bodge via config quirk [SERIAL] serial_cs: add configuration quirk [SERIAL] serial_cs: Convert Oxford 950 / Possio GCC wakeup quirk [SERIAL] serial_cs: convert IBM post-init handling to a quirk [SERIAL] serial_cs: allow wildcarded quirks [SERIAL] serial_cs: convert multi-port table to quirk table [SERIAL] serial_cs: Use clean up multiport card detection ...
| * [SERIAL] Fix oops when removing suspended serial portRussell King2006-10-011-2/+7
| | | | | | | | | | | | | | | | | | | | A serial card might have been removed when the system is resumed. This results in a suspended port being shut down, which results in the ports shutdown method being called twice in a row. This causes BUGs. Avoid this by tracking the suspended state separately from the initialised state. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * [SERIAL] returning proper error from serial core driverRam Gupta2006-10-011-0/+1
| | | | | | | | | | | | | | | | | | Fix the issue of returning 0 even in case of error from uart_set_info function. Now it returns the error EBUSY when it can not set new port. Signed-off-by: Ram Gupta <r.gupta@astronautics.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| * [SERIAL] Make uart_line_info() correctly tell MMIO from I/O portSergei Shtylyov2006-10-011-4/+4
| | | | | | | | | | | | | | | | /proc/tty/driver/serial incorrectly claims that UARTs having iotype of UPIO_MEM32, UPIO_AU, or UPIO_TSI are I/O mapped. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | [PATCH] const struct tty_operationsJeff Dike2006-10-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | As part of an SMP cleanliness pass over UML, I consted a bunch of structures in order to not have to document their locking. One of these structures was a struct tty_operations. In order to const it in UML without introducing compiler complaints, the declaration of tty_set_operations needs to be changed, and then all of its callers need to be fixed. This patch declares all struct tty_operations in the tree as const. In all cases, they are static and used only as input to tty_set_operations. As an extra check, I ran an i386 allyesconfig build which produced no extra warnings. 53 drivers are affected. I checked the history of a bunch of them, and in most cases, there have been only a handful of maintenance changes in the last six months. serial_core.c was the busiest one that I looked at. Signed-off-by: Jeff Dike <jdike@addtoit.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] suspend: make it possible to disable serial console suspendRafael J. Wysocki2006-09-261-0/+14
| | | | | | | | | | | | | | Hack uart_suspend_port() and uart_resume_port() so that serial console ports are not suspended if CONFIG_DISABLE_CONSOLE_SUSPEND is set. This makes it possible to debug the suspend and resume routines of all device drivers as well as the lowest-level swsusp code with the help of the serial console. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [SERIAL] Make uart_match_port() work with all memory mapped UARTsSergei Shtylyov2006-08-301-0/+3
| | | | | | | | | uart_match_port() always fails with UPIO_MEM32, UPIO_AU, and UPIO_TSI cases. Since they match to the memory mapped UARTs, they should be handled just like UPIO_MEM case. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] 8250: add tsi108 serial supportZang Roy-r619112006-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The following patch gets rid of CONFIG_TSI108_BRIDGE. I add UPIO_TSI to handle IIR and IER register in serial_in and serial_out. (1) the reason to rewrite serial_in: TSI108 rev Z1 version ERRATA. Reading the UART's Interrupt Identification Register (IIR) clears the Transmit Holding Register Empty (THRE) and Transmit buffer Empty (TEMP) interrupts even if they are not enabled in the Interrupt Enable Register (IER). This leads to loss of the interrupts. Interrupts are not cleared when reading UART registers as 32-bit word. (2) the reason to rewrite serial_out: Check for UART_IER_UUE bit in the autoconfig routine. This section of autoconfig is excluded for Tsi108/109 because bits 7 and 6 are reserved for internal use. They are R/W bits. In addition to incorrect identification, changing these bits (from 00) will make Tsi108/109 UART non-functional. Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serialLinus Torvalds2006-07-031-2/+4
|\ | | | | | | | | | | * 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial: [SERIAL] Ensure 8250_pci quirks are not marked __devinit [SERIAL] Convert fifosize to an unsigned int
| * [SERIAL] Convert fifosize to an unsigned intRussell King2006-07-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | Some UARTs have more than 255 bytes of FIFO, which can't be represented by an unsigned char. Change the kernel's internal structure to be an unsigned int, but still export an unsigned char via the TIOCGSERIAL ioctl. If the TIOCSSERIAL ioctl provides a fifo size of 0, assume this means "don't change" otherwise we'll corrupt the larger fifo sizes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | [PATCH] lockdep: annotate serialIngo Molnar2006-07-031-1/+10
| | | | | | | | | | | | | | | | | | | | | | Teach special (dual-initialized) locking code to the lock validator. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* | Remove obsolete #include <linux/config.h>Jörn Engel2006-06-301-1/+0
| | | | | | | | | | Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* | [PATCH] devfs: Rename TTY_DRIVER_NO_DEVFS to TTY_DRIVER_DYNAMIC_DEVGreg Kroah-Hartman2006-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | I've always found this flag confusing. Now that devfs is no longer around, it has been renamed, and the documentation for when this flag should be used has been updated. Also fixes all drivers that use this flag. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | [PATCH] devfs: Remove devfs support from the serial subsystemGreg Kroah-Hartman2006-06-261-2/+1
|/ | | | | | Also fixes all serial drivers. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [ARM] 3523/1: Serial core pm_stateAndrew Victor2006-05-161-3/+6
| | | | | | | | | | | | | Patch from Andrew Victor The serial_core already manages the power state of the UARTs, and therefore it shouldn't suspend a UART which was previously suspended. This patch modifies serial_core only call the UART-specific power-management function if the PM state is actually changing. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Clean up serial locking when obtaining a reference to a portRussell King2006-04-301-54/+60
| | | | | | | | | | | | | The locking for the uart_port is over complicated, and can be simplified if we introduce a flag to indicate that a port is "dead" and will be removed. This also helps the validator because it removes a case of non-nested unlock ordering. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org>
* [SERIAL] kernel console should send CRLF not LFCRRussell King2006-03-201-0/+21
| | | | | | | | | | | Glen Turner reported that writing LFCR rather than the more traditional CRLF causes issues with some terminals. Since this aflicts many serial drivers, extract the common code to a library function (uart_console_write) and arrange for each driver to supply a "putchar" function. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [PATCH] serial core: work around sub-driver bugsPavel Machek2006-03-081-3/+29
| | | | | | | | | | | | | | | We're presently getting oopses because Bluetooth (and possibly other) drivers are calling core functions after things have been shut down. So rather than oopsing, let's drop a warning then take avoiding action, so the machine survives. Once all the sub-drivers are fixed up we can remove the take-avoiding-action part. Signed-off-by: Pavel Machek <pavel@suse.cz> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [SERIAL] initialize spinlock for port failed to setup consoleAtsushi Nemoto2006-02-021-1/+1
| | | | | | | | | | | | | | | | | | It seems serial_core intend to initialize port->lock just once for each ports. This is done in uart_set_options() for console, and in uart_add_one_port() for other ports. But there is a case the port->lock is not initialized by serial_core. If the setup function for the console was failed, it will not call uart_set_options() but the port is marked as console (uart_console(port) returns 1). It can happen if console was PCI port which can not detected at the time of register_console. This patch is to initialize port->lock for such console port. With this change, most of spin_lock_init() (some of them are labeled "Temporary fix.") in low-level serial drivers can be omitted. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Make uart_port flags a bitwise typeRussell King2006-01-211-5/+7
| | | | | | | | | | Same reasoning as commit 747c8a55946ed037bf7d62454c3c599c02af2262 but this time we're making uart_port flags a bitwise type - not all of these flags correspond with the old ASYNC_ flags, so there is the possibility for bugs if the wrong ASYNC_* constants are used. Always use UPF_* constants for uart_port->flags. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Make port->ops constantRussell King2006-01-211-2/+2
| | | | | | No one should write to the port->ops structure, so make it constant. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] convert uart_state.sem to uart_state.mutexIngo Molnar2006-01-131-30/+30
| | | | | | | | | | | | semaphore to mutex conversion. the conversion was generated via scripts, and the result was validated automatically via a script as well. build and boot tested. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] turn serial semaphores into mutexesArjan van de Ven2006-01-121-7/+8
| | | | | | | Turn several drivers/serial/ semaphores-used-as-mutex into mutexes Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Fix clocal wakeup problemRussell King2006-01-071-0/+1
| | | | | | | | | | | | | | Jim Alexander reported a problem where "if one calls open() in blocking mode with CLOCAL off, the 8250.c driver under the 2.6 kernel (or at least 2.6.8 and 2.6.10) does not wake up the blocked process when DCD is asserted." Fix this by enabling modem status interrupts immediately before we read the carrier detect status. Thanks to Jim for reporting the problem and testing the fix. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Fix matching of MMIO portsBenjamin Herrenschmidt2006-01-041-1/+1
| | | | | | | | | The function uart_match_port() incorrectly compares the ioremap'd virtual addresses of ports instead of the physical address to find duplicate ports for MMIO based UARTs. This fixes it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] mark several serial tables constArjan van de Ven2005-11-281-1/+1
| | | | | | | | | This patch marks a few serial data structures const, moving them to .rodata where they won't false-share cachelines with things that get written to. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Fix Bug 4900: S3 resume oops with irattach - Thinkpad A21mRussell King2005-11-131-35/+49
| | | | | | | If we fail to re-startup a serial port on resume, shut it down immediately and mark it as an error condition. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Support Au1x00 8250 UARTs using the generic 8250 driver.Pantelis Antoniou2005-11-061-0/+1
| | | | | | | | The offsets of the registers are in a different place, and some parts cannot handle a full set of modem control signals. Signed-off-by: Pantelis Antoniou <pantelis@embeddedalley.ocm> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Arrange better identification of portsRussell King2005-10-311-1/+3
| | | | | | | | | | Folk seem to get confused when they see two or more ttyS0 ports appearing at boot time. One comes from the legacy table, and one from PNP. Hence, display the bus ID of the device which supplied the port. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] remove unneeded code from serial_core.cJayachandran C2005-10-301-2/+1
| | | | | | | | | | | | | | This patch fixes an issue reported by Coverity in serial/serial_core.c Error reported: Variable "&((info)->tty)->flags" tracked as NULL was passed to a function that dereferences it. The later statements in the function assumes 'info->tty != NULL', so this check is not necessary. Probably a 'BUG_ON(info->tty == NULL)' can be added. Signed-off-by: Jayachandran C. <c.jayachandran at gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Prefix serial printks with KERN_INFO and pre-formatRussell King2005-09-031-6/+14
| | | | | | | Pre-format the IO part of the ttyS printks, and prefix them with KERN_INFO to avoid bootsplash corruption. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 2866/1: add i.MX set_mctrl / get_mctrl functionsSascha Hauer2005-08-311-132/+0
| | | | | | | | | | Patch from Sascha Hauer This patch adds support for setting and getting RTS / CTS via set_mtctrl / get_mctrl functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [SERIAL] Clean up and fix tty transmission start/stopingRussell King2005-08-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | The start_tx and stop_tx methods were passed a flag to indicate whether the start/stop was from the tty start/stop callbacks, and some drivers used this flag to decide whether to ask the UART to immediately stop transmission (where the UART supports such a feature.) There are other cases when we wish this to occur - when CTS is lowered, or if we change from soft to hard flow control and CTS is inactive. In these cases, this flag was false, and we would allow the transmitter to drain before stopping. There is really only one case where we want to let the transmitter drain before disabling, and that's when we run out of characters to send. Hence, re-jig the start_tx and stop_tx methods to eliminate this flag, and introduce new functions for the special "disable and allow transmitter to drain" case. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [PATCH] Serial: Fix console port spinlock initialisationRussell King2005-07-031-1/+13
| | | | | | | Initialise the spinlock for port being used by the console early, but don't re-initialise it again later. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [PATCH] Serial: Check status of CTS when using flow controlRussell King2005-06-291-0/+17
| | | | | | | | | Fix bugme #4712: read the CTS status and set hw_stopped if CTS is not active when opening the port and/or enabling CRTSCTS Thanks to Stefan Wolff for spotting this problem. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [PATCH] Serial: Adjust serial lockingRussell King2005-06-291-1/+10
| | | | | | | | This patch changes the way serial ports are locked when getting modem status. This change is necessary because we will need to atomically read the modem status and take action depending on the CTS status. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-161-0/+2395
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
OpenPOWER on IntegriCloud