aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty
AgeCommit message (Collapse)AuthorFilesLines
2013-10-16serial: imx: check the DMA for imx_tx_emptyHuang Shijie1-1/+8
Assume the following situation: If the DMA is enabled, and the a TX DMA operation is working, But we have not issued the TX DMA operation (or we have issued the TX DMA operation with dma_async_issue_pending(), but the DMA has not started to move the data from the memory to the TXFIFO). At this time, we may get the wrong status of the transmitter when we call the imx_tx_empty. In such situation, only check the USR2_TXDC does not enough for us. This patch checks the DMA's situation, and return 0 when the TX DMA is working. Signed-off-by: Huang Shijie <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: imx: implement the flush_buffer hookHuang Shijie1-0/+11
The current driver does not implement the flush_buffer hook for uart_ops. When we enable the DMA for the driver, and test it with Bluetooth, we may meet the following bug for TX: [1] User application may call the flush operation at any time. The uart_flush_buffer() calls the uart_circ_clear() to set the xmit->head and xmit->tail with 0. [2] The TX DMA callback can be called at any time too. The dma_tx_call() will update the xmit->tail. If [2] occurs just after the [1], we will get the wrong xmit->tail. This patch implements the flush_buffer hook to fix this issue. Signed-off-by: Huang Shijie <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: pch_uart: remove reference to .set_wake()Linus Walleij1-1/+0
This callback is gone and not coming back, so will not be supported later. Cc: Johan Hovold <[email protected]> Acked-by: Darren Hart <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: mpc52xx: remove reference to .set_wake()Linus Walleij1-1/+0
This callback is gone and not coming back, so will not be supported later. Cc: Gerhard Sittig <[email protected]> Cc: Anatolij Gustschin <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: sa1100: delete .set_wake callbackLinus Walleij1-1/+4
This callback is unused by the serial core since pre-git days and is not coming back. Delete it. Enabling wakeup on the SA1100 platforms should be done in the suspend() callback so the platform hook is left in the serial port struct for later enablement. Cc: Russell King <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: omap: delete .set_wake callbackLinus Walleij1-10/+0
This callback is unused by the serial core since pre-git days and is not coming back. Delete it. Enabling wakeup on the OMAP serial driver is done through other runpaths these days. Cc: Tony Lindgren <[email protected]> Cc: Kevin Hilman <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16tty: incorrect test of echo_buf() result for ECHO_OP_STARTRoel Kluin1-1/+1
test echo_buf() result for ECHO_OP_START Signed-off-by: Roel Kluin <[email protected]> Acked-by: Peter Hurley <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16tty: Remove unnecessary semicolonsJoe Perches9-14/+14
These aren't necessary after switch and while blocks. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: mrst_max3110: Fix race condition between spi transfersBin Gao1-0/+4
There is a race between termios configuration and xmit that can cause the intel_mid_ssp_spi driver to stall. Serializing spi transactions fixes the problem. Signed-off-by: Bin Gao <[email protected]> Signed-off-by: Feng Tang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial: mrst_max3110: Check the irq number before enable/disabe irq in PM hooksFeng Tang1-2/+4
We should check the validity of the irq number before calling disable_irq() and enable_irq() in the suspend/resume function, as "max->irq == 0" means the irq is not enabled for max3110 device, otherwise it will hurt device whose irq number is really 0. Signed-off-by: Feng Tang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16serial8250-em: convert to clk_prepare/unprepareShinya Kuribayashi1-3/+3
Add calls to clk_prepare and unprepare so that EMMA Mobile EV2 can migrate to the common clock framework. Signed-off-by: Shinya Kuribayashi <[email protected]> [[email protected]: edited for conflicts] Signed-off-by: Takashi Yoshii <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Magnus Damm <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-16sysrq: Allow magic SysRq key functions to be disabled through KconfigBen Hutchings1-1/+1
Turn the initial value of sysctl kernel.sysrq (SYSRQ_DEFAULT_ENABLE) into a Kconfig variable. Original version by Bastian Blank <[email protected]>. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11tty/hvc_opal: powerpc: Make OPAL HVC device tree accesses endian safeBenjamin Herrenschmidt1-2/+2
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2013-10-11powerpc/hvsi: Fix endian issues in HVSI driverBenjamin Herrenschmidt1-13/+12
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2013-10-09drivers: clean-up prom.h implicit includesRob Herring5-0/+8
Powerpc is a mess of implicit includes by prom.h. Add the necessary explicit includes to drivers in preparation of prom.h cleanup. Signed-off-by: Rob Herring <[email protected]> Acked-by: Grant Likely <[email protected]>
2013-10-07Revert "serial: i.MX: evaluate linux,stdout-path property"Greg Kroah-Hartman1-3/+0
This reverts commit f7d2c0bbdb7b784cc035cacb7d36b379ba1c3bef, as it causes build errors when the driver is built as a module. Reported-by: Guenter Roeck <[email protected]> Cc: Sascha Hauer <[email protected]> Cc: Fabio Estevam <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-07serial: bfin_uart: remove deprecated IRQF_DISABLEDMichael Opdenacker1-1/+1
This patch proposes to remove the use of the IRQF_DISABLED flag It's a NOOP since 2.6.35 and it will be removed one day. Signed-off-by: Michael Opdenacker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-07serial: tegra: remove deprecated IRQF_DISABLEDMichael Opdenacker1-1/+1
This patch proposes to remove the use of the IRQF_DISABLED flag It's a NOOP since 2.6.35 and it will be removed one day. Signed-off-by: Michael Opdenacker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-06Merge 3.12-rc4 into tty-nextGreg Kroah-Hartman2-20/+27
We want the tty fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-05serial: mxs-auart: set the FIFO size to DMA buffer sizeHector Palacios1-1/+8
When DMA is enabled (with hardware flow control enabled) the FIFO size must be set to the size of the DMA buffer, as this is the size the tty subsystem can use. Signed-off-by: Hector Palacios <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-03xen/hvc: allow xenboot console to be used againDavid Vrabel1-0/+1
Commit d0380e6c3c0f6edb986d8798a23acfaf33d5df23 (early_printk: consolidate random copies of identical code) added in 3.10 introduced a check for con->index == -1 in early_console_register(). Initialize index to -1 for the xenboot console so earlyprintk=xen works again. Signed-off-by: David Vrabel <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-03serial: Remove unnecessary amba_set_drvdata()Michal Simek2-6/+0
Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here. Driver core change: "device-core: Ensure drvdata = NULL when no driver is bound" (sha1: 0998d0631001288a5974afc0b2a5f568bcdecb4d) Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-03serial: 8250_dw: Improve unwritable LCR workaroundTim Kryger1-9/+32
When configured with UART_16550_COMPATIBLE=NO or in versions prior to the introduction of this option, the Designware UART will ignore writes to the LCR if the UART is busy. The current workaround saves a copy of the last written LCR and re-writes it in the ISR for a special interrupt that is raised when a write was ignored. Unfortunately, interrupts are typically disabled prior to performing a sequence of register writes that include the LCR so the point at which the retry occurs is too late. An example is serial8250_do_set_termios() where an ignored LCR write results in the baud divisor not being set and instead a garbage character is sent out the transmitter. Furthermore, since serial_port_out() offers no way to indicate failure, a serious effort must be made to ensure that the LCR is actually updated before returning back to the caller. This is difficult, however, as a UART that was busy during the first attempt is likely to still be busy when a subsequent attempt is made unless some extra action is taken. This updated workaround reads back the LCR after each write to confirm that the new value was accepted by the hardware. Should the hardware ignore a write, the TX/RX FIFOs are cleared and the receive buffer read before attempting to rewrite the LCR out of the hope that doing so will force the UART into an idle state. While this may seem unnecessarily aggressive, writes to the LCR are used to change the baud rate, parity, stop bit, or data length so the data that may be lost is likely not important. Admittedly, this is far from ideal but it seems to be the best that can be done given the hardware limitations. Lastly, the revised workaround doesn't touch the LCR in the ISR, so it avoids the possibility of a "serial8250: too much work for irq" lock up. This problem is rare in real situations but can be reproduced easily by wiring up two UARTs and running the following commands. # stty -F /dev/ttyS1 echo # stty -F /dev/ttyS2 echo # cat /dev/ttyS1 & [1] 375 # echo asdf > /dev/ttyS1 asdf [ 27.700000] serial8250: too much work for irq96 [ 27.700000] serial8250: too much work for irq96 [ 27.710000] serial8250: too much work for irq96 [ 27.710000] serial8250: too much work for irq96 [ 27.720000] serial8250: too much work for irq96 [ 27.720000] serial8250: too much work for irq96 [ 27.730000] serial8250: too much work for irq96 [ 27.730000] serial8250: too much work for irq96 [ 27.740000] serial8250: too much work for irq96 Signed-off-by: Tim Kryger <[email protected]> Reviewed-by: Matt Porter <[email protected]> Reviewed-by: Markus Mayer <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-30serial: 8250_pci: clean up printk() callsGreg Kroah-Hartman1-21/+19
Move the printk() calls to to dev_*() instead, to tie into the dynamic debugging infrastructure. Also change some "raw" printk() calls to dev_err() to provide a better error message to userspace so it can properly identify the device and not just have to guess. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-30TTY: bfin_jtag_comm: fix incorrect placement of __initdata tagBartlomiej Zolnierkiewicz1-1/+1
__initdata tag should be placed between the variable name and equal sign for the variable to be placed in the intended .init.data section. Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-30tty: Fix pty master read() after slave closesPeter Hurley1-20/+26
Commit f95499c3030fe1bfad57745f2db1959c5b43dca8, n_tty: Don't wait for buffer work in read() loop creates a race window which can cause a pty master read() to miss the last pty slave write(s) and return -EIO instead, thus signalling the pty slave is closed. This can happen when the pty slave is written and immediately closed but before the tty buffer i/o loop receives the new input; the pty master read() is scheduled, sees its read buffer is empty and the pty slave has been closed, and exits. Because tty_flush_to_ldisc() has significant performance impact for parallel i/o, rather than revert the commit, special case this condition (ie., when the read buffer is empty and the 'other' pty has been closed) and, only then, wait for buffer work to complete before re-testing if the read buffer is still empty. As before, subsequent pty master reads return any available data until no more data is available, and then returns -EIO to indicate the pty slave has closed. Reported-by: Mikael Pettersson <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Tested-by: Mikael Pettersson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-30xen/hvc: If we use xen_raw_printk let it also work on HVM guests.Konrad Rzeszutek Wilk1-2/+17
The xen_raw_printk works great for debugging purposes. We use for PV guests and we can also use it for HVM guests. However, for HVM guests we have a fallback of using the 0xe9 port in case the hypervisor does not support an HVM guest of using the console_io hypercall. As such lets use 0xe9 during early bootup, and once the hyper-page is setup and if the console_io hypercall is supported - use that. Otherwise we will fallback to using the 0xe9 after early bootup. We also alter the return value for dom0_write_console to return an error value instead of zero. The HVC API has been supporting returning error values for quite some time. P.S. To use (and to see the output in the Xen ring buffer) one has to build the hypervisor with 'debug=y'. Signed-off-by: Konrad Rzeszutek Wilk <[email protected]> [v1: ifdef xen_cpuid_base as it is X86 specific]
2013-09-29Merge 3.12-rc3 into tty-nextGreg Kroah-Hartman4-13/+10
We want the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-29Merge tag 'tty-3.12-rc3' of ↵Linus Torvalds4-13/+10
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are some serial at tty driver fixes for 3.12-rc3 The serial driver fixes some kref leaks, documentation is moved to the proper places, and the tty and n_tty fixes resolve some reported regressions. There is still one outstanding tty regression fix that isn't in here yet, as I want to test it out some more, it will be sent for 3.12-rc4 if it checks out" * tag 'tty-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: ar933x_uart: move devicetree binding documentation tty: Fix SIGTTOU not sent with tcflush() n_tty: Fix EOF push index when termios changes serial: pch_uart: remove unnecessary tty_port_tty_get serial: pch_uart: fix tty-kref leak in dma-rx path serial: pch_uart: fix tty-kref leak in rx-error path serial: tegra: fix tty-kref leak
2013-09-27serial: 8250_dw: fix broken function callHeikki Krogerus1-1/+2
The stub for dw8250_probe_acpi() is missing an argument. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-27serial: 8250_pci: add support for Intel BayTrailHeikki Krogerus1-0/+145
Intel BayTrail has two HS-UARTs with 64 byte fifo, support for DMA and support for 16750 compatible Auto Flow Control. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26vt: properly ignore xterm-256 colour codesAdam Borowski1-0/+22
This is not a bug on our side, but a misdesign in ITU T.416, yet with all popular terminals supporting these codes, people consider this to be a bug in Linux. By breaking the design principles behind SGR codes (gracefully ignoring unsupported ones should not require knowing about them), 256 colour ones tend to turn blinking on before invoking an arbitrary unrelated command. This commit doesn't add such support, merely skips such codes without ill effects. Signed-off-by: Adam Borowski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26vt: break a couple of obsolete SCOish codes.Adam Borowski1-14/+1
No modern terminal supports them, and SGR 38 conflicts with detecting xterm-256 colours. This also makes SGR 39 consistent with other popular terminals. Neither are used by ncurses' terminfo. Signed-off-by: Adam Borowski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26hvc_vio: Do not override preferred console set by kernel parameterBen Hutchings1-1/+4
The original version of this was done by Bastian Blank, who wrote: > The problem is the following: > - Architecture specific code sets preferred console to something bogus. > - Command line handling tries to set preferred console but is overruled > by the old setting. > > The udbg0 console is a boot console and independant. References: http://bugs.debian.org/492703 Signed-off-by: Ben Hutchings <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: clps711x: drop needless devm_clk_putUwe Kleine-König1-2/+0
The nice thing about devm_* is that the driver doesn't need to free the resources but the driver core takes care about that. These calls were introduced in commit c08f015 (serial: clps711x: Using CPU clock subsystem for getting base UART speed). Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Alexander Shiyan <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: sccnxp: missing uart_unregister_driver() on error in sccnxp_probe()Wei Yongjun1-0/+1
Add the missing uart_unregister_driver() before return from sccnxp_probe() in the error handling case. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26OMAP/serial: Fix Mode13 vs Mode16 priorityAlexey Pelykh1-1/+1
Make Mode16 more preferred than Mode13, to match TRM baudrates table. Signed-off-by: Alexey Pelykh <[email protected]> Cc: Tony Lindgren <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26OMAP/serial: Fix misnamed variableAlexey Pelykh1-4/+4
Fix misnamed variable to eliminate confusion. Signed-off-by: Alexey Pelykh <[email protected]> Cc: Tony Lindgren <[email protected]> Cc: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: sirf: don't submit dma desc after timeout irqs occurQipan Li1-2/+9
In rx timeout ISR and tasklet, we don't issue new dma desc as rx_done ISR will do that. Signed-off-by: Qipan Li <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: 8250_pci: remove unnecessary pci_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: txx9: remove unnecessary pci_set_drvdata()Jingoo Han1-2/+0
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: mfd: remove unnecessary pci_set_drvdata()Jingoo Han1-1/+0
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: imx: Change cast to handle 64-bit resource_size_tOlof Johansson1-1/+1
This resolves a warning where resource_size_t is larger than void *: drivers/tty/serial/imx.c:1542:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Since iomem_base is a void *, casting to unsigned long is safe. It's unclear to me that this comparison is truly needed, but it's there on several other drivers as well. Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: samsung: add support for manual RTS settingJosé Miguel Gonçalves1-3/+17
The Samsung serial driver currently does not support setting the RTS pin with an ioctl(TIOCMSET) call. This patch adds this support. Changes in v2: - Preserve the RTS pin's manual setting in set_termios() also when enabling CRTSCTS. Signed-off-by: José Miguel Gonçalves <[email protected]> Reviewed-by: Tomasz Figa <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: mpc512x: Remove casting the return value which is a void pointerJingoo Han1-2/+2
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: samsung: Remove casting the return value which is a void pointerJingoo Han2-2/+2
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: ifx6x60: Remove casting the return value which is a void pointerJingoo Han1-1/+1
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: bfin_sport_uart: Remove casting the return value which is a void pointerJingoo Han1-7/+4
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: bfin_uart: Remove casting the return value which is a void pointerJingoo Han1-9/+6
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Sonic Zhang <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-09-26serial: mpsc: Remove casting the return value which is a void pointerJingoo Han1-1/+1
Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language. Signed-off-by: Jingoo Han <[email protected]> Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>