summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'tty-3.5-rc1' of ↵Linus Torvalds2012-05-2267-1956/+1876
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull TTY updates from Greg Kroah-Hartman: "Here's the big TTY/serial driver pull request for the 3.5-rc1 merge window. Nothing major in here, just lots of incremental changes from Alan and Jiri reworking some tty core things to behave better and to get a more solid grasp on some of the nasty tty locking issues. There are a few tty and serial driver updates in here as well. All of this has been in the linux-next releases for a while with no problems. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'tty-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (115 commits) serial: bfin_uart: Make MMR access compatible with 32 bits bf609 style controller. serial: bfin_uart: RTS and CTS MMRs can be either 16-bit width or 32-bit width. serial: bfin_uart: narrow the reboot condition in DMA tx interrupt serial: bfin_uart: Adapt bf5xx serial driver to bf60x serial4 controller. Revert "serial_core: Update buffer overrun statistics." tty: hvc_xen: NULL dereference on allocation failure tty: Fix LED error return tty: Allow uart_register/unregister/register tty: move global ldisc idle waitqueue to the individual ldisc serial8250-em: Add DT support serial8250-em: clk_get() IS_ERR() error handling fix serial_core: Update buffer overrun statistics. tty: drop the pty lock during hangup cris: fix missing tty arg in wait_event_interruptible_tty call tty/amiserial: Add missing argument for tty_unlock() tty_lock: Localise the lock pty: Lock the devpts bits privately tty_lock: undo the old tty_lock use on the ctty serial8250-em: Emma Mobile UART driver V2 Add missing call to uart_update_timeout() ...
| * serial: bfin_uart: Make MMR access compatible with 32 bits bf609 style ↵Sonic Zhang2012-05-171-16/+4
| | | | | | | | | | | | | | | | | | controller. Simplify serial data width calculation and adapt to bf609 LCR bit mask. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: bfin_uart: RTS and CTS MMRs can be either 16-bit width or 32-bit width.Sonic Zhang2012-05-171-12/+10
| | | | | | | | | | | | | | | | | | Change hardware flow control code to adapt to both bf5xx and bf60x. Disabled serial device before set termios for bf60x. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: bfin_uart: narrow the reboot condition in DMA tx interruptSonic Zhang2012-05-171-1/+1
| | | | | | | | | | | | | | Check if xmit buffer pointers are set to zero. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial: bfin_uart: Adapt bf5xx serial driver to bf60x serial4 controller.Sonic Zhang2012-05-171-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | The serial4 controller on bf60x is an enhanced version of serial controller on bf5xx. MMR size is 32 bits other than 16 bits. MMR GCTL, MCR and LCR are combined into one control MMR. MSR and LSR are combined into one status MMR. This patch adapts current bf5xx serial driver to serial4 controller on bf60x. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bob Liu <lliubbo@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Revert "serial_core: Update buffer overrun statistics."Greg Kroah-Hartman2012-05-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 642180871bc91afebb6ccf40d1615a7dd33699a3. Buffer overruns are for hardware reported overruns, not software ones, which will only happen if we run out of memory and you will get lots of -ENOMEM errors at the same time. Thanks to Alan Cox for catching this. Reported-by: Alan Cox <alan@linux.intel.com> Cc: Corbin Atkinson <corbinat@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty: hvc_xen: NULL dereference on allocation failureDan Carpenter2012-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | If kzalloc() returns a NULL here, we pass a NULL to xencons_disconnect_backend() which will cause an Oops. Also I removed the __GFP_ZERO while I was at it since kzalloc() implies __GFP_ZERO. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty: Fix LED error returnAlan Cox2012-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | 3.4-rc introduced a regression when setting the LEDS. We do the right thing but then return an error code. Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=43144 Reported-by: Christian Casteyde Signed-off-by: Alan Cox <alan@linux/intel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty: Allow uart_register/unregister/registerAlan Cox2012-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | This is legitimate but because we don't clear the drv->state pointer in the unregister code causes a bogus BUG(). Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=42880 Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty: move global ldisc idle waitqueue to the individual ldiscIvo Sieben2012-05-102-3/+6
| | | | | | | | | | | | | | | | | | | | | | The global wait_queue that is used for line discipline idle handling is moved to a separate wait_queue for each line instance. This prevents unnecessary blocking on one line, because of idle handling on another line. Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250-em: Add DT supportMagnus Damm2012-05-091-0/+7
| | | | | | | | | | | | | | | | Update the 8250_em driver to support DT. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250-em: clk_get() IS_ERR() error handling fixMagnus Damm2012-05-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | Update the 8250_em driver to correctly handle the case where no clock is associated with the device. The return value of clk_get() needs to be checked with IS_ERR() to avoid NULL pointer referencing. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial_core: Update buffer overrun statistics.Corbin Atkinson2012-05-091-2/+4
| | | | | | | | | | | | | | | | | | | | Currently, serial drivers don't report buffer overruns. When a buffer overrun occurs, tty_insert_flip_char returns 0, and no attempt is made to insert that same character again (i.e. it is lost). This patch reports buffer overruns via the buf_overrun field in the port's icount structure. Signed-off-by: Corbin Atkinson <corbin.atkinson@ni.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty: drop the pty lock during hangupAlan Cox2012-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | In theory we don't need it, in practice we are hitting some ill understood deadlock when we don't drop it. The old code dropped it here so we are not undoing anything problematic for pty. If pty could be unloaded it would be a problem but it can't. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * cris: fix missing tty arg in wait_event_interruptible_tty callPaul Gortmaker2012-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d29f3ef39be4eec0362b985305fc526d9be318cf "tty_lock: Localise the lock" added a tty arg to wait_event_interruptible_tty() but it missed this arch specific instance for cris, causing a compile failure. Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty/amiserial: Add missing argument for tty_unlock()Geert Uytterhoeven2012-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | commit d29f3ef39be4eec0362b985305fc526d9be318cf ("tty_lock: Localise the lock") missed that d3a7b83f865b46bb7b5e1ed18a129ce1af349db4 ("drivers/tty/amiserial.c: add missing tty_unlock") just added a new caller of tty_unlock(): drivers/tty/amiserial.c: In function ‘set_serial_info’: drivers/tty/amiserial.c:1077: error: too few arguments to function ‘tty_unlock’ Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty_lock: Localise the lockAlan Cox2012-05-0415-103/+155
| | | | | | | | | | | | | | | | | | | | | | | | 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 <alan@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * pty: Lock the devpts bits privatelyAlan Cox2012-05-041-4/+15
| | | | | | | | | | | | | | | | | | This is a private pty affair, we don't want to tangle it with the tty_lock any more as we know all the other non tty locking is now handled by the vfs so we too can move. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty_lock: undo the old tty_lock use on the cttyAlan Cox2012-05-041-2/+7
| | | | | | | | | | | | | | | | | | get_current_tty has its own consistent locking. That means a pile of the tty lock cases are not needed. As get_current_tty also keeps a reference the tty object lifetime means we can propogate the lock removal out. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250-em: Emma Mobile UART driver V2Magnus Damm2012-05-043-0/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is V2 of the Emma Mobile 8250 platform driver. The hardware itself has according to the data sheet up to 64 byte FIFOs but at this point we only make use of the 16550 compatible mode. To support this piece of hardware the common UART registers need to be remapped, and the access size differences need to be handled. The DLL and DLM registers can due to offset collision not be remapped easily, and because of that this driver makes use of ->dl_read() and ->dl_write() callbacks. This in turn requires a registration function that takes 8250-specific paramenters. Future potential enhancements include DT support, early platform driver console and fine grained PM. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Alan Cox <alan@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Add missing call to uart_update_timeout()Lothar Waßmann2012-05-041-0/+2
| | | | | | | | | | | | | | | | | | This patch fixes a problem reported here: http://article.gmane.org/gmane.linux.ports.arm.kernel/155242/match=auart Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * tty: mxser: local variables should not be exposed globallyH Hartley Sweeten2012-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The variable 'mxser_port_ops' is only referenced in this file and should be marked static to prevent it from being exposed globally. Quites the sparse warning: warning: symbol 'mxser_port_ops' was not declared. Should it be static? Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Jiri Slaby <jirislaby@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250: Introduce serial8250_register_8250_port()Magnus Damm2012-05-022-32/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce yet another 8250 registration function. This time it is serial8250_register_8250_port() and it allows us to register 8250 hardware instances using struct uart_8250_port. The new function makes it possible to register 8250 hardware that makes use of 8250 specific callbacks such as ->dl_read() and ->dl_write(). Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250: Clean up default map and dl codeMagnus Damm2012-05-021-26/+12
| | | | | | | | | | | | | | | | | | | | Get rid of unused functions and macros now when Alchemy and RM9K are converted over to callbacks. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250: Use dl_read()/dl_write() on RM9KMagnus Damm2012-05-021-33/+29
| | | | | | | | | | | | | | | | | | | | Convert the 8250 RM9K support code to make use of the new dl_read()/dl_write() callbacks. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250: Use dl_read()/dl_write() on AlchemyMagnus Damm2012-05-021-41/+26
| | | | | | | | | | | | | | | | | | | | Convert the 8250 Alchemy support code to make use of the new dl_read()/dl_write() callbacks. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * serial8250: Add dl_read()/dl_write() callbacksMagnus Damm2012-05-022-53/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert serial_dl_read() and serial_dl_write() from macro to 8250 specific callbacks. This change makes it easier to support 8250 hardware with non-standard DLL and DLM register configurations such as Alchemy, RM9K and upcoming Emma Mobile UART hardware. Signed-off-by: Magnus Damm <damm@opensource.se> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * 8250.c: less than 2400 baud fix.Christian Melki2012-05-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We noticed that we were loosing data at speed less than 2400 baud. It turned out our (TI16750 compatible) uart with 64 byte outgoing fifo was truncated to 16 byte (bit 5 sets fifo len) when modifying the fcr reg. The input code still fills the buffer with 64 bytes if I remember correctly and thus data is lost. Our fix was to remove whiping of the fcr content and just add the TRIGGER_1 which we want for latency. I can't see why this would not work on less than 2400 always, for all uarts ... Otherwise one would have to make sure the filling of the fifo re-checks the current state of available fifo size (urrk). Signed-off-by: Christian Melki <christian.melki@ericsson.se> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * 8250_pci: fix pch uart matchingArnaud Patard2012-04-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The rules used to make 8250_pci "ignore" the PCH uarts are lacking pci subids entries, preventing it to match and thus is breaking serial port support for theses systems. This has been tested on a nanoETXexpress-TT, which has a specifici uart clock. Tested-by: Erwan Velu <Erwan.Velu@zodiacaerospace.com> [stable@: please apply to 3.0-stable, 3.2-stable and 3.3-stable] Cc: stable <stable@vger.kernel.org> Signed-off-by: Arnaud Patard <apatard@hupstream.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * TTY: n_tty, do not dereference user bufferJiri Slaby2012-04-291-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | copy_from_read_buf currently copies data to a user buffer and then checks if the data is single EOF. But it checks it by accessing the user buffer. First, the buffer may be changed by other threads of the user program already. Second, it accesses the buffer without any checks. It might be write-only for example. Fix this by inspecting contents of the tty (kernel) buffer instead. Note that "n == 1" is necessary, but not sufficient. But we check later that there is nothing left by "!tty->read_cnt" condition. There is still an issue with the current code that EOF being wrapped to the start of the circular buffer will result in an inappropriate losing of the EOF character. But this is not intended to be fixed by this patch. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Reported-by: Emil Goode <emilgoode@gmail.com> Cc: Howard Chu <hyc@symas.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * vt: push the tty_lock down into the map handlingAlan Cox2012-04-243-53/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | When we do this it becomes clear the lock we should be holding is the vc lock, and in fact many of our other helpers are properly invoked this way. We don't at this point guarantee not to race the keyboard code but the results of that appear harmless and that was true before we started as well. We now have no users of tty_lock in the console driver... Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Merge 3.4-rc4 into tty-nextGreg Kroah-Hartman2012-04-2341-1605/+1191
| |\ | | | | | | | | | | | | | | | | | | This resolves the merge problem with: drivers/tty/serial/pch_uart.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial/8250_pci: fix suspend/resume vs init/exit quirksDan Williams2012-04-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e86ff4a6 "serial/8250_pci: init-quirk msi support for kt serial controller" introduced a regression in suspend/resume by causing msi's to be enabled twice without an intervening disable. 00:16.3 Serial controller: Intel Corporation Patsburg KT Controller (rev 05) (prog-if 02 [16550]) Subsystem: Intel Corporation Device 7270 Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 72 I/O ports at 4080 [size=8] Memory at d1c30000 (32-bit, non-prefetchable) [size=4K] Capabilities: [c8] Power Management version 3 Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Kernel driver in use: serial [ 365.250523] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:16.3/msi_irqs' [ 365.250525] Modules linked in: nls_utf8 ipv6 uinput sg iTCO_wdt iTCO_vendor_support ioatdma dca i2c_i801 i2c_core wmi sd_mod ahci libahci isci libsas libata scsi_transport_sas [last unloaded: scsi_wait_scan] [ 365.250540] Pid: 9030, comm: kworker/u:1 Tainted: G W 3.3.0-isci-3.0.213+ #1 [ 365.250542] Call Trace: [ 365.250545] [<ffffffff8115e955>] ? sysfs_add_one+0x99/0xad [ 365.250548] [<ffffffff8102db8b>] warn_slowpath_common+0x85/0x9e [ 365.250551] [<ffffffff8102dc96>] warn_slowpath_fmt+0x6e/0x70 [ 365.250555] [<ffffffff8115e8fa>] ? sysfs_add_one+0x3e/0xad [ 365.250558] [<ffffffff8115e8b4>] ? sysfs_pathname+0x3c/0x44 [ 365.250561] [<ffffffff8115e8b4>] ? sysfs_pathname+0x3c/0x44 [ 365.250564] [<ffffffff8115e8b4>] ? sysfs_pathname+0x3c/0x44 [ 365.250567] [<ffffffff8115e8b4>] ? sysfs_pathname+0x3c/0x44 [ 365.250570] [<ffffffff8115e955>] sysfs_add_one+0x99/0xad [ 365.250573] [<ffffffff8115f031>] create_dir+0x72/0xa5 [ 365.250577] [<ffffffff8115f194>] sysfs_create_dir+0xa2/0xbe [ 365.250581] [<ffffffff81262463>] kobject_add_internal+0x126/0x1f8 [ 365.250585] [<ffffffff8126255b>] kset_register+0x26/0x3f [ 365.250588] [<ffffffff8126275a>] kset_create_and_add+0x62/0x7c [ 365.250592] [<ffffffff81293619>] populate_msi_sysfs+0x34/0x103 [ 365.250595] [<ffffffff81293e1c>] pci_enable_msi_block+0x1b3/0x216 [ 365.250599] [<ffffffff81303f7c>] try_enable_msi+0x13/0x17 [ 365.250603] [<ffffffff81303fb3>] pciserial_resume_ports+0x21/0x42 [ 365.250607] [<ffffffff81304041>] pciserial_resume_one+0x50/0x57 [ 365.250610] [<ffffffff81283e1a>] pci_legacy_resume+0x38/0x47 [ 365.250613] [<ffffffff81283e7d>] pci_pm_restore+0x54/0x87 [ 365.250616] [<ffffffff81283e29>] ? pci_legacy_resume+0x47/0x47 [ 365.250619] [<ffffffff8131e9e8>] dpm_run_callback+0x48/0x7b [ 365.250623] [<ffffffff8131f39a>] device_resume+0x342/0x394 [ 365.250626] [<ffffffff8131f5b7>] async_resume+0x21/0x49 That patch has since been reverted, but by inspection it seems that pciserial_suspend_ports() should be invoking .exit() quirks to release resources acquired during .init(). Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * serial/8250_pci: Clear FIFOs for Intel ME Serial Over Lan device on BISudhakar Mamillapalli2012-04-183-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Serial Over Lan (SOL) over the virtual serial port in a Intel management engine (ME) device, on device reset the serial FIFOs need to be cleared to keep the FIFO indexes in-sync between the host and the engine. On a reset the serial device assertes BI, so using that as a cue FIFOs are cleared. So for this purpose a new handle_break callback has been added. One other problem is that the serial registers might temporarily go to 0 on reset of this device. So instead of using the IER register read, if 0 returned use the ier value in uart_8250_port. This is hidden under a custom serial_in. Cc: Nhan H Mai <nhan.h.mai@intel.com> Signed-off-by: Sudhakar Mamillapalli <sudhakar@fb.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * Merge 3.4-rc3 into tty-nextGreg Kroah-Hartman2012-04-18362-2650/+3400
| | |\ | | | | | | | | | | | | | | | | | | | | This allows us to pick up some changes needed for other serial patches. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | tegra, serial8250: add ->handle_break() uart_port opDan Williams2012-04-189-31/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "KT" serial port has another use case for a "received break" quirk, so before adding another special case to the 8250 core take this opportunity to push such quirks out of the core and into a uart_port op. Stephen says: "If the callback function is to no longer live in 8250.c itself, arch/arm/mach-tegra/devices.c isn't logically a good place to put it, and that file will be going away once we get rid of all the board files and move solely to device tree." ...so since 8250_pci.c houses all the quirks for pci serial devices this quirk is similarly housed in of_serial.c. Once the open firmware conversion completes the infrastructure details (include/linux/of_serial.h, and the export) can all be removed to make this self contained to of_serial.c. Cc: Nhan H Mai <nhan.h.mai@intel.com> Cc: Colin Cross <ccross@android.com> Cc: Olof Johansson <olof@lixom.net> [stephen: kill CONFIG_SERIAL_TEGRA in favor just using CONFIG_ARCH_TEGRA] Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sudhakar Mamillapalli <sudhakar@fb.com> Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | OMAP2+: UART: Remove cpu checks for populating errata flagsGovindraj.R2012-04-183-10/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the errata is populated based on cpu checks this can be removed and replaced with module version check of uart ip block. MVR reg is provided within the uart reg map use the same to populate the errata and thus now errata population and handling can be managed within the driver itself. Cc: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Govindraj.R <govindraj.raja@ti.com> Reviewed-by: Jon Hunter <jon-hunter@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | serial: pl011: implement workaround for CTS clear event issueRajanikanth H.V2012-04-181-91/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem Observed: - interrupt status is set by rising or falling edge on CTS line - interrupt status is cleared on a .0. to .1. transition of the interrupt-clear register bit 1. - interrupt-clear register is reset by hardware once the interrupt status is .0.. Remark: It seems not possible to read this register back by the CPU though, but internally this register exists. - when simultaneous set and reset event on the interrupt status happens, then the set-event has priority and the status remains .1.. As a result the interrupt-clear register is not reset to .0., and no new .0. to .1. transition can be detected on it when writing a .1. to it. This implies race condition, the clear must be performed at least one UARTCLK the riding edge of CTS RIS interrupt. Fix: Instead of resetting UART as done in commit c16d51a32bbb61ac8fd96f78b5ce2fccfe0fb4c3 "amba pl011: workaround for uart registers lockup" do the following: write .0. and then .1. to the interrupt-clear register to make sure that this transition is detected. According to the datasheet writing a .0. does not have any effect, but actually it allows to reset the internal interrupt-clear register. Take into account: The .0. needs to last at least for one clk_uart clock period (~ 38 MHz, 26.08ns) This way we can do away with the tasklet and keep only a tiny fix triggered by the variant flag introduced in this patch. Signed-off-by: Guillaume Jaunet <guillaume.jaunet@stericsson.com> Signed-off-by: Christophe Arnal <christophe.arnal@stericsson.com> Signed-off-by: Matthias Locher <Matthias.Locher@stericsson.com> Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | tty: add missing tty_port_tty_get() call to raw3215_wakeupHeiko Carstens2012-04-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix compile error caused by "TTY: con3215, use tty from tty_port": CC drivers/s390/char/con3215.o drivers/s390/char/con3215.c: In function 'raw3215_wakeup': drivers/s390/char/con3215.c:339:16: error: 'struct raw3215_info' has no member named 'tty' make[1]: *** [drivers/s390/char/con3215.o] Error 1 make: *** [drivers/s390/char/] Error 2 Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | TTY: con3215, use tty from tty_portJiri Slaby2012-04-131-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtain tty_struct only once in ISR and pass it down to raw3215_next_io. Other than that, we just use the tty with raised reference. And set it properly in open and close. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | TTY: con3215, add tty_portJiri Slaby2012-04-131-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And use flags from that. But first we have to get rid of duplicated flag names. From now on, for the standard ones that are stored in tty_port->flags, we use ASYNC_* ones. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | TTY: hvc, fix TTY refcountingJiri Slaby2012-04-131-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A -next commit "TTY: HVC, use tty from tty_port" switched the driver to use tty_port helper for tty refcounting. But it omitted to remove manual tty refcounting from open, close and hangup. So now we are getting random crashes caused by use-after-free: Unable to handle kernel paging request for data at address 0xc0000003f9d550 Faulting instruction address: 0xc0000000001b7f40 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP: c0000000001b7f40 LR: c0000000001b7f14 CTR: c0000000000e04f0 ... NIP [c0000000001b7f40] .__kmalloc+0x70/0x230 LR [c0000000001b7f14] .__kmalloc+0x44/0x230 Call Trace: [c0000003f68bf930] [c0000003f68bf9b0] 0xc0000003f68bf9b0 (unreliable) [c0000003f68bf9e0] [c0000000001e5424] .alloc_fdmem+0x24/0x70 [c0000003f68bfa60] [c0000000001e54f8] .alloc_fdtable+0x88/0x130 [c0000003f68bfaf0] [c0000000001e5924] .dup_fd+0x384/0x450 [c0000003f68bfbd0] [c00000000009a310] .copy_process+0x880/0x11d0 [c0000003f68bfcd0] [c00000000009aee0] .do_fork+0x70/0x400 [c0000003f68bfdc0] [c0000000000141c4] .sys_clone+0x54/0x70 [c0000003f68bfe30] [c000000000009aa0] .ppc_clone+0x8/0xc Fix that by complete removal of tty_kref_get/put in open/close/hangup paths. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Reported-and-tested-by: Michael Neuling <mikey@neuling.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: ppc-dev <linuxppc-dev@lists.ozlabs.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | ISDN: remove uses of isdn_tty_revisionJiri Slaby2012-04-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit "ISDN: i4l, remove cvs crap" removed definition of isdn_tty_revision, but there is still a user. So this causes linking errors. This was hidden from my radar because the variable was not declared in any header. Instead isdn_common.c declares it locally. So remove this variable also from isdn_common.c, because there is really no way to find out the version. Git commit or tag is... Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | tty: hold lock across tty buffer finding and buffer fillingXiaobing Tu2012-04-091-20/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tty_buffer_request_room is well protected, but while after it returns, it releases the port->lock. tty->buf.tail might be modified by either irq handler or other threads. The patch adds more protection by holding the lock across tty buffer finding and buffer filling. Signed-off-by: Alek Du <alek.du@intel.com> Signed-off-by: Xiaobing Tu <xiaobing.tu@intel.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | tty/vt: handle bad user buffer in {G,P}IO_CMAP ioctlMichael Gehring2012-04-091-36/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set_get_cmap() ignored the result of {get,put}_user(), causing ioctl(vt, {G,P}IO_CMAP, 0xdeadbeef) to silently fail. Another side effect of this: calling the PIO_CMAP ioctl with an invalid buffer would zero the default colormap and the palette for all vts (all colors set to black). Leave the default colormap intact and return -EFAULT when reading/writing to the userspace buffer fails. Signed-off-by: Michael Gehring <mg@ebfe.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | pch_uart: Fix duplicate memory release issueTomoya MORINAGA2012-04-091-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add initialize variable to prevent duplicate free memory. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | pch_uart: Fix return value issueTomoya MORINAGA2012-04-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, occurring line status interrupt, returned value is not set in interrupt handler function. As a result, 0 can be returned. This patch adds setting returned value. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | pch_uart: delete unused data structureTomoya MORINAGA2012-04-091-6/+0
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | pch_uart: Support modem status interruptTomoya MORINAGA2012-04-091-2/+13
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | pch_uart: change type to %d to %02xTomoya MORINAGA2012-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | %02x format is easier to understand better than %d. Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud