summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'tty-3.19-rc1' of ↵Linus Torvalds2014-12-15102-1596/+4755
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here's the big tty/serial driver update for 3.19-rc1. There are a number of TTY core changes/fixes in here from Peter Hurley that have all been teted in linux-next for a long time now. There are also the normal serial driver updates as well, full details in the changelog below" * tag 'tty-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (219 commits) serial: pxa: hold port.lock when reporting modem line changes tty-hvsi_lib: Deletion of an unnecessary check before the function call "tty_kref_put" tty: Deletion of unnecessary checks before two function calls n_tty: Fix read_buf race condition, increment read_head after pushing data serial: of-serial: add PM suspend/resume support Revert "serial: of-serial: add PM suspend/resume support" Revert "serial: of-serial: fix up PM ops on no_console_suspend and port type" serial: 8250: don't attempt a trylock if in sysrq serial: core: Add big-endian iotype serial: samsung: use port->fifosize instead of hardcoded values serial: samsung: prefer to use fifosize from driver data serial: samsung: fix style problems serial: samsung: wait for transfer completion before clock disable serial: icom: fix error return code serial: tegra: clean up tty-flag assignments serial: Fix io address assign flow with Fintek PCI-to-UART Product serial: mxs-auart: fix tx_empty against shift register serial: mxs-auart: fix gpio change detection on interrupt serial: mxs-auart: Fix mxs_auart_set_ldisc() serial: 8250_dw: Use 64-bit access for OCTEON. ...
| * Merge 3.18-rc7 into tty-nextGreg Kroah-Hartman2014-12-06592-2554/+5504
| |\ | | | | | | | | | | | | | | | This resolves the merge issue with drivers/tty/serial/of_serial.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: pxa: hold port.lock when reporting modem line changesDmitry Eremin-Solenikov2014-11-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both uart_handle_dcd_change() and uart_handle_cts_change() require a port lock to be held and will emit a warning when lockdep is enabled. Held corresponding lock. This fixes the following warnings: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at drivers/tty/serial/serial_core.c:2760 uart_handle_dcd_change+0xc8/0xf8() Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 3.18.0-rc5+ #26 [<c000dff8>] (unwind_backtrace) from [<c000bc70>] (show_stack+0x10/0x14) [<c000bc70>] (show_stack) from [<c00192ac>] (warn_slowpath_common+0x6c/0x8c) [<c00192ac>] (warn_slowpath_common) from [<c00192e8>] (warn_slowpath_null+0x1c/0x24) [<c00192e8>] (warn_slowpath_null) from [<c0182984>] (uart_handle_dcd_change+0xc8/0xf8) [<c0182984>] (uart_handle_dcd_change) from [<c018625c>] (serial_pxa_irq+0x268/0x3b0) [<c018625c>] (serial_pxa_irq) from [<c004d0d4>] (handle_irq_event_percpu+0x50/0x16c) [<c004d0d4>] (handle_irq_event_percpu) from [<c004d22c>] (handle_irq_event+0x3c/0x5c) [<c004d22c>] (handle_irq_event) from [<c004f7d0>] (handle_level_irq+0x94/0x118) [<c004f7d0>] (handle_level_irq) from [<c004ca0c>] (generic_handle_irq+0x20/0x30) [<c004ca0c>] (generic_handle_irq) from [<c004cbe0>] (__handle_domain_irq+0x38/0x70) [<c004cbe0>] (__handle_domain_irq) from [<c00085c4>] (ichp_handle_irq+0x24/0x34) [<c00085c4>] (ichp_handle_irq) from [<c000c7e4>] (__irq_svc+0x44/0x54) Exception stack(0xc07c7f58 to 0xc07c7fa0) 7f40: 00000001 00000001 7f60: 00000000 20000013 c07c6000 00000000 00000000 c07ce0a4 c07d7798 00000000 7f80: c07e8fb8 0000004c 00000000 c07c7fa0 c0044798 c0009f20 20000013 ffffffff [<c000c7e4>] (__irq_svc) from [<c0009f20>] (arch_cpu_idle+0x28/0x38) [<c0009f20>] (arch_cpu_idle) from [<c003c974>] (cpu_startup_entry+0x1b8/0x220) [<c003c974>] (cpu_startup_entry) from [<c0338c54>] (start_kernel+0x39c/0x40c) ---[ end trace 4c1b7ae03f6d9d30 ]--- ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at drivers/tty/serial/serial_core.c:2791 uart_handle_cts_change+0xa0/0xdc() Modules linked in: CPU: 0 PID: 0 Comm: swapper Tainted: G W 3.18.0-rc5+ #26 [<c000dff8>] (unwind_backtrace) from [<c000bc70>] (show_stack+0x10/0x14) [<c000bc70>] (show_stack) from [<c00192ac>] (warn_slowpath_common+0x6c/0x8c) [<c00192ac>] (warn_slowpath_common) from [<c00192e8>] (warn_slowpath_null+0x1c/0x24) [<c00192e8>] (warn_slowpath_null) from [<c018528c>] (uart_handle_cts_change+0xa0/0xdc) [<c018528c>] (uart_handle_cts_change) from [<c018624c>] (serial_pxa_irq+0x258/0x3b0) [<c018624c>] (serial_pxa_irq) from [<c004d0d4>] (handle_irq_event_percpu+0x50/0x16c) [<c004d0d4>] (handle_irq_event_percpu) from [<c004d22c>] (handle_irq_event+0x3c/0x5c) [<c004d22c>] (handle_irq_event) from [<c004f7d0>] (handle_level_irq+0x94/0x118) [<c004f7d0>] (handle_level_irq) from [<c004ca0c>] (generic_handle_irq+0x20/0x30) [<c004ca0c>] (generic_handle_irq) from [<c004cbe0>] (__handle_domain_irq+0x38/0x70) [<c004cbe0>] (__handle_domain_irq) from [<c00085c4>] (ichp_handle_irq+0x24/0x34) [<c00085c4>] (ichp_handle_irq) from [<c000c7e4>] (__irq_svc+0x44/0x54) Exception stack(0xc07c7f58 to 0xc07c7fa0) 7f40: 00000001 00000001 7f60: 00000000 20000013 c07c6000 00000000 00000000 c07ce0a4 c07d7798 00000000 7f80: c07e8fb8 0000004c 00000000 c07c7fa0 c0044798 c0009f20 20000013 ffffffff [<c000c7e4>] (__irq_svc) from [<c0009f20>] (arch_cpu_idle+0x28/0x38) [<c0009f20>] (arch_cpu_idle) from [<c003c974>] (cpu_startup_entry+0x1b8/0x220) [<c003c974>] (cpu_startup_entry) from [<c0338c54>] (start_kernel+0x39c/0x40c) ---[ end trace 4c1b7ae03f6d9d31 ]--- Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty-hvsi_lib: Deletion of an unnecessary check before the function call ↵Markus Elfring2014-11-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "tty_kref_put" The tty_kref_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: Deletion of unnecessary checks before two function callsMarkus Elfring2014-11-272-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functions put_device() and tty_kref_put() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | n_tty: Fix read_buf race condition, increment read_head after pushing dataChristian Riesch2014-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 19e2ad6a09f0c06dbca19c98e5f4584269d913dd ("n_tty: Remove overflow tests from receive_buf() path") moved the increment of read_head into the arguments list of read_buf_addr(). Function calls represent a sequence point in C. Therefore read_head is incremented before the character c is placed in the buffer. Since the circular read buffer is a lock-less design since commit 6d76bd2618535c581f1673047b8341fd291abc67 ("n_tty: Make N_TTY ldisc receive path lockless"), this creates a race condition that leads to communication errors. This patch modifies the code to increment read_head _after_ the data is placed in the buffer and thus fixes the race for non-SMP machines. To fix the problem for SMP machines, memory barriers must be added in a separate patch. Signed-off-by: Christian Riesch <christian.riesch@omicron.at> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: of-serial: add PM suspend/resume supportJingchang Lu2014-11-261-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds suspend/resume support for the of-serial driver to provide power management support on devices attatched. The handling may vary since not every of_serial device is an 8250 port. Currently only 8250 port handling is added in the suspend/resume function based on the type switch. Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Joseph Lo <josephl@nvidia.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Tested-by: Florina Fainelli <f.fainelli@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Revert "serial: of-serial: add PM suspend/resume support"Greg Kroah-Hartman2014-11-261-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2dea53bf57783f243c892e99c10c6921e956aa7e. Turns out to be broken :( Cc: Jingchang Lu <jingchang.lu@freescale.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Revert "serial: of-serial: fix up PM ops on no_console_suspend and port type"Greg Kroah-Hartman2014-11-261-46/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 513e438581020334e0345561adeeeaefa36701be. It's broken :( Cc: Jingchang Lu <jingchang.lu@freescale.com> Cc: Joseph Lo <josephl@nvidia.com> Cc: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250: don't attempt a trylock if in sysrqRabin Vincent2014-11-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Attempting to use SysRq via the 8250 serial port with spin lock debugging on on a uniprocessor system results in the following splat: SysRq : BUG: spinlock trylock failure on UP on CPU#0, swapper/0 lock: serial8250_ports+0x0/0x8c0, .magic: dead4ead, .owner: swapper/0, .owner_cpu: 0 CPU: 0 PID: 0 Comm: swapper Not tainted 3.18.0-rc4+ #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014 ffffffff8245ba00 ffffffff81628b28 ffffffff812c8d27 ffffffff81628b48 ffffffff8106812e ffffffff8245ba00 ffffffff814e22ed ffffffff81628b68 ffffffff810681a6 0000000000000000 0000000000000000 ffffffff81628b88 Call Trace: <IRQ> [<ffffffff812c8d27>] dump_stack+0x19/0x1b [<ffffffff8106812e>] spin_dump+0x7e/0xd0 [<ffffffff810681a6>] spin_bug+0x26/0x30 [<ffffffff8106843c>] do_raw_spin_trylock+0x4c/0x60 [<ffffffff812cdb1d>] _raw_spin_trylock+0x1d/0x60 [<ffffffff812336d8>] serial8250_console_write+0x68/0x190 [<ffffffff811eb0b0>] ? sprintf+0x40/0x50 [<ffffffff8106ab5e>] call_console_drivers.constprop.11+0x9e/0xf0 [<ffffffff8106b276>] console_unlock+0x3e6/0x490 [<ffffffff8106b595>] vprintk_emit+0x275/0x530 [<ffffffff812c869a>] printk+0x4d/0x4f [<ffffffff8121e612>] __handle_sysrq+0x62/0x1b0 [<ffffffff8121e5b5>] ? __handle_sysrq+0x5/0x1b0 [<ffffffff8121ebc6>] handle_sysrq+0x26/0x30 [<ffffffff81233157>] serial8250_rx_chars+0x1d7/0x250 [<ffffffff812338bb>] serial8250_handle_irq+0x7b/0x90 [<ffffffff812338f3>] serial8250_default_handle_irq+0x23/0x30 [<ffffffff812318b3>] serial8250_interrupt+0x63/0xe0 [<ffffffff8106d80e>] handle_irq_event_percpu+0x4e/0x200 [<ffffffff8106da01>] handle_irq_event+0x41/0x70 [<ffffffff810701ee>] ? handle_edge_irq+0x1e/0x110 [<ffffffff8107026e>] handle_edge_irq+0x9e/0x110 [<ffffffff810041c2>] handle_irq+0x22/0x40 [<ffffffff812d096e>] do_IRQ+0x4e/0xf0 [<ffffffff812cf4ed>] common_interrupt+0x6d/0x6d <EOI> [<ffffffff8100acbf>] ? default_idle+0x1f/0xd0 [<ffffffff8100acbd>] ? default_idle+0x1d/0xd0 [<ffffffff8100b61f>] arch_cpu_idle+0xf/0x20 [<ffffffff8105c1db>] cpu_startup_entry+0x25b/0x360 [<ffffffff812c726e>] rest_init+0xbe/0xd0 [<ffffffff816a4dcb>] start_kernel+0x339/0x346 [<ffffffff816a4495>] x86_64_start_reservations+0x2a/0x2c [<ffffffff816a4589>] x86_64_start_kernel+0xf2/0xf6 HELP : loglevel(0-9) reboot(b) crash(c) show-all-locks(d) te... Before ebade5e833eda30 ("serial: 8250: Clean up the locking for -rt") this was handled by not even attempting to try the lock if port->sysrq, since it is known to be taken by the interrupt handler; see https://bugzilla.kernel.org/show_bug.cgi?id=6716#c1. Restore that behavior. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: core: Add big-endian iotypeKevin Cernekee2014-11-262-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since most drivers interpret UPIO_MEM32 to mean "little-endian" and use readl/writel to access the registers, add a parallel UPIO_MEM32BE to request the use of big-endian MMIO accessors (ioread32be/iowrite32be). Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: samsung: use port->fifosize instead of hardcoded valuesRobert Baldyga2014-11-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Hardcoded FIFO size can cause hardware performance limitation. Using real size value provides better FIFO usage. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: samsung: prefer to use fifosize from driver dataRobert Baldyga2014-11-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have fifosize set in driver data we prefer to use it instead of default fifosize value (which is always 16). If there is defined fifosize for particular serial we prefer to use it, otherwise we use value from info, which is common for all serials on given platform. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: samsung: fix style problemsRobert Baldyga2014-11-261-18/+28
| | | | | | | | | | | | | | | | | | | | | Split lines longer than 80 chars and remove unnecessary whitespaces. Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: samsung: wait for transfer completion before clock disableRobert Baldyga2014-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds waiting until transmit buffer and shifter will be empty before clock disabling. Without this fix it's possible to have clock disabled while data was not transmited yet, which causes unproper state of TX line and problems in following data transfers. Cc: <stable@vger.kernel.org> # v2.6.26+ Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: icom: fix error return codeJulia Lawall2014-11-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a negative error code on failure. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e1,e2; @@ ( if (\(ret < 0\|ret != 0\)) { ... return ret; } | ret = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: tegra: clean up tty-flag assignmentsJohan Hovold2014-11-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tty break and error flags are not bit masks so do not to use bitwise OR when assigning them. Note that there is no functional change due to the if-else construct and flag having been initialised to zero (TTY_NORMAL). Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: Fix io address assign flow with Fintek PCI-to-UART ProductPeter Hung2014-11-261-15/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original driver fixed the io address with 0xe000+idx*8, but real io address assigned from BIOS is dynamically from read PCI configure space 0x24, 0x20, 0x1c. The Fintek F81504/F81508/F81512 maybe malfunction without this patch and malfunction surely when more then 1 PCI card. Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: mxs-auart: fix tx_empty against shift registerJanusz Uzycki2014-11-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tx_empty() should test whether both the transmitter fifo and shifter for the port is empty, ie. the whole last char was transmitted. The shift register is empty if AUART_STAT_BUSY is cleared. The patch fixes the function against the shift register. According to i.MX23 and i.MX28 Reference Manual: AUART_STAT_TXFE: TX FIFO or transmit holding register is empty. AUART_STAT_BUSY: AUART still transmits bits. The BUSY signal goes HIGH as soon as the data is written to the transmit FIFO (that is, the FIFO is non-empty) and remains asserted HIGH while data is being transmitted. BUSY is negated only when the transmit FIFO is empty, and the last character has been transmitted from the shift register, including the stop bits. Signed-off-by: Janusz Uzycki <j.uzycki@elproma.com.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: mxs-auart: fix gpio change detection on interruptJanusz Uzycki2014-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | mxs_auart_modem_status() did't detect gpio's state change because s->mctrl_prev was modified before by mctrl_gpio_get(). The patch introduces mctrl_temp variable to fix the bug. Signed-off-by: Janusz Uzycki <j.uzycki@elproma.com.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: mxs-auart: Fix mxs_auart_set_ldisc()Fabio Estevam2014-11-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 732a84a037a4 ("serial: core: Pass termios to set_ldisc() notifications") changed the set_ldisc prototype. At the time of this commit the mxs_auart driver did not implement set_ldisc, so that's why it has not been converted. Adapt also mxs_auart_set_ldisc() so that the following build warning can be fixed: drivers/tty/serial/mxs-auart.c:962:2: warning: initialization from incompatible pointer type .set_ldisc = mxs_auart_set_ldisc, ^ drivers/tty/serial/mxs-auart.c:962:2: warning: (near initialization for 'mxs_auart_ops.set_ldisc') Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Tested-by: Janusz Uzycki <j.uzycki@elproma.com.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: 8250_dw: Use 64-bit access for OCTEON.David Daney2014-11-261-14/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the existing code appears to work on most hardware, the hardware designers tell us that 8-bit access to the registers is not guaranteed to be reliable. Also the OCTEON simulation environments prohibit 8-bit accesses. For these reasons, we use __raw_readq/__raw_writeq for OCTEON. This code is protected with #ifdef CONFIG_64BIT so it still builds under configurations lacking readq/writeq. We can get rid of the #ifdef __BIG_ENDIAN, as under 64-bit accesses, OCTEON is byte order invariant. Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Aleksey Makarov <aleksey.makarov@auriga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: imx: Fix warning when building 'allmodconfig'Fabio Estevam2014-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_SERIAL_IMX_CONSOLE=n and CONFIG_CONSOLE_POLL=y we get the following build warning: drivers/tty/serial/imx.c:306:13: warning: 'imx_port_ucrs_save' defined but not used [-Wunused-function] drivers/tty/serial/imx.c:315:13: warning: 'imx_port_ucrs_restore' defined but not used [-Wunused-function] imx_port_ucrs_save/restore are only used under CONFIG_SERIAL_IMX_CONSOLE, so their definitions should be also be protected only by CONFIG_SERIAL_IMX_CONSOLE. This was detected when building 'allmodconfig'. Reported-by: Olof's autobuilder <build@lixom.net> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: bfin, define inlined structuresJiri Slaby2014-11-261-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct bfin_serial_port contains structs circ_buf, timer_list, and work_struct directly (not pointers). This means that these structures have to be defined completely to be inlined in struct bfin_serial_port. So instead of struct declarations, define the structures by including proper headers. They were pulled in by linux/serial_core.h or others until now. But experimenting with circ_buf removal from serial_core, struct circ_buf becomes undefined in bfin_serial: In file included from arch/blackfin/kernel/debug-mmrs.c:21:0: arch/blackfin/include/asm/bfin_serial.h:44:18: error: field 'rx_dma_buf' has incomplete type Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: omap_serial: line is unsigned, don't check < 0Sebastian Andrzej Siewior2014-11-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dan Carpenter reported: |drivers/tty/serial/8250/8250_omap.c:1025 omap8250_probe() |warn: unsigned 'up.port.line' is never less than zero. |1025 if (up.port.line < 0) { Since of_alias_get_id() and pdev->id can get negative I check for the error via ret variable. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: 8250: omap: line is unsigned, don't check < 0Sebastian Andrzej Siewior2014-11-261-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dan Carpenter reported: |drivers/tty/serial/8250/8250_omap.c:1025 omap8250_probe() |warn: unsigned 'up.port.line' is never less than zero. |1025 if (up.port.line < 0) { I (wrongly) assumed that line is an int and compiler didn't complain nor did sparse. Since of_alias_get_id() and pdev->id can get negative I check for the error via ret variable. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: men_z135_uart: Add terminating entry for men_z135_idsAxel Lin2014-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The mcb_device_id table is supposed to be zero-terminated. Signed-off-by: Axel Lin <axel.lin@ingics.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sirf: add a new uart type supportQipan Li2014-11-263-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in CSR A7DA SoC, uart6 located at BT module and it need multiple clock sources, so for "sirf,marco-bt-uart" compatible uarts, drivers take 3 clock sources and enable them. this patch also replaces clk_get by devm_clk_get function and fix DT binding document in which we missed to fix when we added marco platform in commit 909102db44f "serial: sirf: add support for Marco chip". Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: pr_warning->pr_warn and logging neateningJoe Perches2014-11-267-32/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the pr_warning to the more common pr_warn. Other miscellanea: o Convert unusual PR_FMT define and uses to pr_fmt o Remove unnecessary OOM message o Fix grammar in an error message o Convert a pr_warning with a KERN_ERR to pr_err Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: jsm: Fix unnecessary space before function ptr argumentsKonrad Zapalowicz2014-11-261-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | This commit deals with the checkpatch warning "Unnecessary space before function pointer arguments". Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: jsm: Replace magic value with the proper defineKonrad Zapalowicz2014-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The changed function flushes the tx UART and the '4' corresponds to the UART_FCR_CLEAR_XMIT value. This commit replaces the magic number with this define. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: jsm: Fix the alignment of the switch satementKonrad Zapalowicz2014-11-261-12/+12
| | | | | | | | | | | | | | | | | | | | | This commit fixes the alignment of the 'case's i the switch statement. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: jsm: Remove unnecessary if statementKonrad Zapalowicz2014-11-262-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The flow of {neo,cls}_param() shows that at this stage the baud rate has a non-zero value. This fact makes the if clausule obsolete and acknowledges it's removal. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: jsm: Remove unnecessary parameter from clear_break()Konrad Zapalowicz2014-11-264-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'force' parameter to the {cls,neo}_send_break() function has been removed because it has not been used. The client to this API (the tty code) always called this function with only one value. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sh-sci: Change checking for error rate of HSCIFNobuhiro Iwamatsu2014-11-261-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes negative values of error rate to be checked, because these values are valid as error rate. And this changes in the process of adopting a value close to 0. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sh-sci: Add device tree support for r7s72100Geert Uytterhoeven2014-11-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Simply document the new compat string (and keep the list sorted by SoC). There appears to be no need for a driver update. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | serial: sh-sci: Add device tree support for r8a7794Ulrich Hecht2014-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simply document the new compat string. There appears to be no need for a driver update. Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com> [geert: Reworded to match previous commits] Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: msm_serial: document DT aliasFrank Rowand2014-11-241-22/+47
| | | | | | | | | | | | | | | | | | | | | | | | Update devicetree binding for msm_serial to reflect msm_serial_probe() getting line id (port number) from the serialN alias. Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | tty: serial: msm_serial: Don't require DT aliasesStephen Boyd2014-11-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there isn't a DT alias then of_alias_get_id() will return -ENODEV. This will cause the msm_serial driver to fail probe, when we want to keep the previous behavior where we generated a dynamic line number at probe time. Restore this behavior by generating a dynamic id if the line number is still negative after checking for an alias or in the non-DT case looking at the .id field of the platform device. Reported-by: Kevin Hilman <khilman@kernel.org> Tested-by: Kevin Hilman <khilman@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | vt: Fix build breakage when !CONFIG_VT_CONSOLEPeter Hurley2014-11-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 68952076e9226cc23ebce66d3fc2fdb8b6c04c30 ("vt: Remove vt_get_kmsg_redirect() from uapi header") fails to compile if !CONFIG_VT_CONSOLE. Move macro definition for vt_get_kmsg_redirect() up with file-scope function declarations. Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Revert "serial: of-serial: fetch line number from DT"Greg Kroah-Hartman2014-11-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1bd8324535ec1ff44aef55c0e40b9e7d56b310fb. To quote Olof: This commit broke a whole lot of tegra boards in last night's -next here. In particular, I've been looking at tegra20-seaboard, which now doesn't boot with console any more. Breaking existing systems is bad. Reported-by: Olof Johansson <olof@lixom.net> Cc: Lucas Stach <dev@lynxeye.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | Merge 3.18-rc4 into tty-next.Greg Kroah-Hartman2014-11-10203-1466/+1527
| |\ \ | | | | | | | | | | | | | | | | | | | | This resolves a merge issue with drivers/tty/serial/8250/8250_mtk.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: pl011: Add device tree support for RX DMA pollingAndrew Jackson2014-11-072-10/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add equivalent attributes to those provided in the platform data for use when RX DMA is enabled. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: pl011: Don't enable RX DMA if residue processing not supportedAndrew Jackson2014-11-071-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the DMA engine doesn't support residue processing then the RX DMA handling won't work terribly well if polling is enabled. So, disable RX DMA if residue handling isn't available. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: pl011: Set length of DMA transferAndrew Jackson2014-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DMA engines on some systems require that the dma_length is set when using scatter gather lists. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: pl011: Avoid assumptions about buffer size when refilling TX DMAAndrew Jackson2014-11-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code assumed that PL011_DMA_BUFFER_SIZE == UART_XMIT_SIZE, which may not always be the case. This allows for these two being different sizes and not copying too much data. Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: pl011: Allocate TX DMA buffer from DMA capable memoryAndrew Jackson2014-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocating with __GFP_DMA avoids the need for bounce buffers Signed-off-by: Andrew Jackson <Andrew.Jackson@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: fsl_lpuart: Remove unneeded registration messageFabio Estevam2014-11-071-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no real value in displaying "serial: Freescale lpuart driver" in every boot. The uart_register_driver() can fail and even so the "serial: Freescale lpuart driver" will be displayed, which is not really helpful. This is particularly annoying when booting multi_v7_defconfig kernel on a SoC that is not a Vybrid/Layerscape and even though this message gets displayed. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Jingchang Lu <jingchang.lu@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | serial: fsl_lpuart: Remove unneeded check for 'res'Fabio Estevam2014-11-071-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'res' will be automatically checked inside devm_ioremap_resource(), so there is no need to explicitly perform a NULL check. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Jingchang Lu <jingchang.lu@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | | drivers: serial: jsm: Remove FSF address from the file documentation/headerKonrad Zapalowicz2014-11-075-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the address of Free Software Foundation from each of the mentioned file in order to suppress the checkpatch warning. Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>