summaryrefslogtreecommitdiffstats
path: root/drivers/tty
Commit message (Collapse)AuthorAgeFilesLines
* tty: Fix merge of "tty: Refactor tty_open()"Peter Hurley2016-03-311-2/+1
| | | | | | | | | | | | | Commit e9036d066236 ("tty: Drop krefs for interrupted tty lock") fixed a tty reference counting problem introduced in commit 0bfd464d3fdd ("tty: Wait interruptibly for tty lock on reopen"), so v4.5.0 is correct. However, commit d6203d0c7b73 ("tty: Refactor tty_open()") moved the relevant code for 4.6-rc1; correct the merge. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* tty: Fix UML console breakagePeter Hurley2016-03-311-1/+1
| | | | | | | | | | | User-Mode Linux supplies an alternate TTY_MAJOR driver for stdio console, so the noctty check in tty_open() must apply only to VT driver tty0 devnode and not the UML console driver tty0 devnode. Fixes: 11e1d4aa4da1 ("tty: Consolidate noctty checks in tty_open()") Reported-by: Richard Weinberger <richard.weinberger@gmail.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'for-linus-4.6-rc0-tag' of ↵Linus Torvalds2016-03-221-17/+58
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from David Vrabel: "Features and fixes for 4.6: - Make earlyprintk=xen work for HVM guests - Remove module support for things never built as modules" * tag 'for-linus-4.6-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: drivers/xen: make platform-pci.c explicitly non-modular drivers/xen: make sys-hypervisor.c explicitly non-modular drivers/xen: make xenbus_dev_[front/back]end explicitly non-modular drivers/xen: make [xen-]ballon explicitly non-modular xen: audit usages of module.h ; remove unnecessary instances xen/x86: Drop mode-selecting ifdefs in startup_xen() xen/x86: Zero out .bss for PV guests hvc_xen: make early_printk work with HVM guests hvc_xen: fix xenboot for DomUs hvc_xen: add earlycon support
| * hvc_xen: make early_printk work with HVM guestsStefano Stabellini2016-02-261-11/+16
| | | | | | | | | | | | | | | | | | | | | | Refactor the existing code in xen_raw_console_write to get the generic early_printk console work with HVM guests. Take the opportunity to replace the outb loop with a single outsb call to reduce the number of vmexit. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
| * hvc_xen: fix xenboot for DomUsStefano Stabellini2016-02-261-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The xenboot early console has been partially broken for DomU for a long time: the output would only go to the hypervisor via hypercall (HYPERVISOR_console_io), while it wouldn't actually go to the DomU console. The reason is that domU_write_console would return early as no xencons structs are configured for it. Add an appropriate xencons struct for xenboot from the xenboot setup callback. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
| * hvc_xen: add earlycon supportStefano Stabellini2016-02-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce EARLYCON support in hvc_xen, useful for early debugging on arm and arm64, where xen early_printk is not available. It is different from xenboot_write_console on x86 in two ways: - it does not return if !xen_pv_domain(), not only because ARM guests are xen_hvm_domain(), but also because we want to capture all the early boot messages, before xen support is discovered - it does not try to print to the domU console at all, because xen support will only be discovered at a later point Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
* | serial: 8250: describe CONFIG_SERIAL_8250_RSAMaciej S. Szmigiero2016-03-071-1/+6
| | | | | | | | | | | | | | | | | | CONFIG_SERIAL_8250_RSA has waited for a long time to have meaningful help text so let's finally describe what this option actually does. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: samsung: optimize UART rx fifo access routineYoungmin Nam2016-03-071-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch optimizes UART rx fifo access routine by reading UART SFR when necessary. At first, the "fifocnt" variable will be initialized as Rx FIFO count. So we don't need to access UFSTAT(FIFO status) register every time to check FIFO count because we know that count with "fifocnt". After all data were read out from Rx FIFO, the "fifocnt" will be set as 0. Lastly, UFSTAT will be accessed again to check whether the data remains by any chance. Signed-off-by: Youngmin Nam <ym0914@gmail.com> Reviewed-by: Jung-Ick Guack <ji.guack@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: pl011: add mark/space parity supportEd Spiridonov2016-03-071-0/+2
| | | | | | | | | | | | | | | | PL011 UART has hardware mark/space parity ability, this trivial patch adds support for it. Tested on Raspberry Pi v1, v2 (BCM2835 and BCM2836) Signed-off-by: Ed Spiridonov <edo.rus@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: serial: 8250: add MOXA Smartio MUE boards supportMathieu OTHACEHE2016-03-074-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for : - CP-102E: 2 ports RS232 PCIE card - CP-102EL: 2 ports RS232 PCIE card - CP-132EL: 2 ports RS422/485 PCIE card - CP-114EL: 4 ports RS232/422/485 PCIE card - CP-104EL-A: 4 ports RS232 PCIE card - CP-168EL-A: 8 ports RS232 PCIE card - CP-118EL-A: 8 ports RS232/422/485 PCIE card - CP-118E-A: 8 ports RS422/485 PCIE card - CP-138E-A: 8 ports RS422/485 PCIE card - CP-134EL-A: 4 ports RS422/485 PCIE card - CP-116E-A (A): 8 ports RS232/422/485 PCIE card - CP-116E-A (B): 8 ports RS232/422/485 PCIE card This patch is based on information extracted from vendor mxupcie driver available on MOXA website. I was able to test it on a CP-168EL-A on PC. Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250: convert drivers to use up_to_u8250p()Andy Shevchenko2016-03-073-15/+7
| | | | | | | | | | | | | | | | up_to_u8250p() casts struct uart_port * to struct uart_8250_port *. Update code to use it instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250/mediatek: fix building with SERIAL_8250=mArnd Bergmann2016-03-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that breaks when SERIAL_8250 is a loadable module: drivers/tty/built-in.o: In function `mtk8250_set_termios': :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios' :(.text+0x1bf10): undefined reference to `uart_get_baud_rate' :(.text+0x1c09c): undefined reference to `uart_get_divisor' drivers/tty/built-in.o: In function `mtk8250_do_pm': :(.text+0x1c0d0): undefined reference to `serial8250_do_pm' drivers/tty/built-in.o: In function `mtk8250_probe': :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port' serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror] serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function] This changes the symbol to a 'tristate', so the dependency on SERIAL_8250 also works when that is set to 'm'. To actually build the driver, we also need to include <linux/module.h>. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250/ingenic: fix building with SERIAL_8250=mArnd Bergmann2016-03-072-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ingenic 8250 driver has a 'bool' Kconfig symbol, but that breaks when SERIAL_8250 is a loadable module: drivers/tty/built-in.o: In function `ingenic_uart_probe': 8250_ingenic.c:(.text+0x1c1a0): undefined reference to `serial8250_register_8250_port' This changes the symbol to a 'tristate', plus a dependency on SERIAL_8250, which makes it work again. Unlike the other soc-specific backends, this one has no dependency on an architecture or a platform. I'm adding a dependency on MIPS || COMPILE_TEST as well here, to avoid showing the driver on architectures that are not interested in it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250/uniphier: fix modular buildArnd Bergmann2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly added uniphier serial port driver fails to build as a loadable module when the base 8250 driver is built-in and its console support enabled: ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined! This changes the driver to only provide the early console support if it is built-in itself as well. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular"Arnd Bergmann2016-03-071-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cafe1ac64023 ("drivers/tty: make serial 8250_ingenic.c explicitly non-modular"), which attempted to remove dead code but did not have the desired effect when the main 8250 driver was a loadable module itself. This would normally result in a link error, but as the entire drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250 is set, we never notice that the driver does not get built in this configuration. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"Arnd Bergmann2016-03-071-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d72d391c126e ("drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"), which intended to remove dead code but did not have the desired effect when the main 8250 driver was a module itself. This would normally result in a link error, but as the entire drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250 is set, we never notice that the driver does not get built in this configuration. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: mvebu-uart: initial support for Armada-3700 serial portWilson Ding2016-03-073-0/+673
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Armada-3700's uart is a simple serial port, which doesn't support. Configuring the modem control lines. The uart port has a 32 bytes Tx FIFO and a 64 bytes Rx FIFO The uart driver implements the uart core operations. It also support the system (early) console based on Armada-3700's serial port. Known Issue: The uart driver currently doesn't support clock programming, which means the baud-rate stays with the default value configured by the bootloader at boot time [gregory.clement@free-electrons.com: Rewrite many part which are too long to enumerate] Signed-off-by: Wilson Ding <dingwei@marvell.com> Signed-off-by: Nadav Haklai <nadavh@marvell.com> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: mctrl_gpio: Add missing module licenseRomain Izard2016-03-071-0/+3
| | | | | | | | | | | | | | | | | | | | As the mctrl_gpio driver can be built as a module, it needs to have its license specified with MODULE_LICENSE. Otherwise, it cannot access required symbols exported through EXPORT_SYMBOL_GPL. Signed-off-by: Romain Izard <romain.izard.pro@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: ifx6x60: avoid uninitialized variable useArnd Bergmann2016-03-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc warns about a potential use of an uninitialized variable in this driver: drivers/tty/serial/ifx6x60.c: In function 'ifx_spi_complete': drivers/tty/serial/ifx6x60.c:713:6: warning: 'more' may be used uninitialized in this function [-Wmaybe-uninitialized] if (more || ifx_dev->spi_more || queue_length > 0 || Unlike a lot of other such warnings, this one is correct and describes an actual problem in the handling of the "IFX_SPI_HEADER_F" result code. This appears to be a result from a restructuring of the driver that dates back to before it was merged in the kernel, so it's impossible to know where it went wrong. I also don't know what that result code means, so I have no idea if setting 'more' to zero is the correct solution, but at least it makes the behavior reproducible rather than depending on whatever happens to be on the kernel stack. This patch initializes the 'more' variable to zero in each of the three code paths that could result in undefined behavior before, which is more explicit than initializing it at the start of the function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty/serial: at91: fix bad offset for UART timeout registerLudovic Desroches2016-03-071-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | With SAMA5D2, the UART has hw timeout but the offset of the register to define this value is not the same as the one for USART. When using the new UART, the value of this register was 0 so we never get timeout irqs. It involves that when using DMA, we were stuck until the execution of the dma callback which happens when a buffer is full (so after receiving 2048 bytes). Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty/serial: at91: restore dynamic driver bindingRomain Izard2016-03-071-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit c39dfebc7798956fd2140ae6321786ff35da30c3, the modular support code for atmel_serial was removed, as the driver cannot be built as a module. Because no use case was proposed, the dynamic driver binding support was removed as well. The atmel_serial driver can manage up to 7 serial controllers, which are multiplexed with other functions. For example, in the Atmel SAMA5D2, the Flexcom controllers can work as USART, SPI or I2C controllers, and on all Atmel devices serial lines can be reconfigured as GPIOs. My use case uses GPIOs to transfer a firmware update using a custom protocol on the lines used as a serial port during the normal life of the device. If it is not possible to unbind the atmel_serial driver, the GPIO lines remain reserved and prevent this case from working. This patch reinstates the atmel_serial_remove function, and fixes it as it failed to clear the "clk" field on removal, triggering an oops when a device was bound again after being unbound. Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250: Add hardware dependency to RT288X optionJean Delvare2016-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Kconfig option SERIAL_8250_RT288X seems to be only relevant on MIPS platforms, so do not present it on other architectures, unless build-testing. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Mans Rullgard <mans@mansr.com> Cc: Jiri Slaby <jslaby@suse.com> Acked-by: John Crispin <blogic@openwrt.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: goldfish: support platform_device with id -1Greg Hackmann2016-03-071-12/+18
| | | | | | | | | | | | | | | | | | | | When the platform bus sets the platform_device id to -1 (PLATFORM_DEVID_NONE), use an incrementing counter for the TTY index instead Signed-off-by: Greg Hackmann <ghackmann@google.com> Signed-off-by: Jin Qian <jinqian@android.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | drivers: tty: goldfish: Add device tree bindingsMiodrag Dinic2016-03-071-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable support for registering this device using the device tree. Device tree node example for registering Goldfish TTY device : goldfish_tty@1f004000 { interrupts = <0xc>; reg = <0x1f004000 0x1000>; compatible = "google,goldfish-tty"; }; Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com> Signed-off-by: Jin Qian <jinqian@android.com> Signed-off-by: Alan <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial-uartlite: Configure for rising edge irq trigger.Maarten Brock2016-03-071-1/+2
| | | | | | | | | | | | | | This device generates a short rising pulse on the interrupt request line. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial-uartlite: Spinlock inside the loop.Maarten Brock2016-03-071-5/+4
| | | | | | | | | | | | | | Better to hold the spinlock as short as possible. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial-uartlite: Constify uartlite_be/uartlite_leMaarten Brock2016-03-071-4/+4
| | | | | | | | | | | | | | Made uartlite_be and uartlite_le constants. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial-uartlite: Enlarge maximum nr of devices to 16.Maarten Brock2016-03-071-1/+1
| | | | | | | | | | | | | | | | This device is ideal to use when you need a lot of uarts in your FPGA. Try not to force all those users to patch their kernel. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250_pci: all known Braswell ports are 1 channelAndy Shevchenko2016-03-071-5/+0
| | | | | | | | | | | | | | | | | | | | There is no need to have channel offset defined since all BayTrail and Braswell ports are 1 channel. Remove unneeded definition. While here, remove comment which has no value. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250_pci: convert to pcim_*() APIAndy Shevchenko2016-03-071-24/+8
| | | | | | | | | | | | | | | | The managed API provides a better approach to help with acquiring and releasing resources. Besides that error handling becomes simpler. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250_dw: remove leftover definitionsAndy Shevchenko2016-03-071-6/+0
| | | | | | | | | | | | | | | | The clocks are managed through clk-fractional-divider.c module, and thus CLK framework takes care about it. Remove letfovers from this driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250_dw: remove redundant 'else' keywordAndy Shevchenko2016-03-071-2/+3
| | | | | | | | | | | | | | | | When the main branch contains return statement the 'else' keyword is not needed. Remove it here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: xuartps: Enable OF earlycon supportMichal Simek2016-03-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Support early console setup via DT for all listed compatible strings. Remove EARLYCON_DECLARE which was done by: "Use common framework for earlycon declarations" (sha1: 2eaa790989e03900298ad24f77f1086dbbc1aebd) when OF_EARLYCON_DECLARE is defined. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: sh-sci: Use ARCH_RENESASSimon Horman2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Make use of ARCH_RENESAS in place of ARCH_SHMOBILE. This is part of an ongoing process to migrate from ARCH_SHMOBILE to ARCH_RENESAS the motivation for which being that RENESAS seems to be a more appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: sh-sci: Remove redundant instances of EARLYCON_DECLARE()Geert Uytterhoeven2016-03-071-5/+0
| | | | | | | | | | | | | | | | | | | | As of commit 2eaa790989e03900 ("earlycon: Use common framework for earlycon declarations") it is no longer needer to specify both EARLYCON_DECLARE() and OF_EARLYCON_DECLARE(). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: amba-pl011: don't dereference NULL platform dataRobin Murphy2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | When only a TX DMA channel is specified in DT, pl011_dma_probe() falls back to looking for the optional RX channel in platform data. What it doesn't do is check whether that platform data actually exists... Add the missing check to avoid crashing the kernel. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: serial: Use GFP_ATOMIC instead of GFP_KERNEL in serial8250_em485_init()Matwey V. Kornilov2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | serial8250_em485_init() is supposed to be protected with p->port.lock spinlock. This may lead to issues when kmalloc sleeps, so it is better to use GFP_ATOMIC in this spinlocked context. Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") Reported-by: Ильяс Гасанов <torso.nafi@gmail.com> Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: serial: 8250: Cleanup p->em485 in serial8250_unregister_portMatwey V. Kornilov2016-03-071-0/+9
| | | | | | | | | | | | | | | | | | | | Formally, currently there is no memory leak, but if serial8250_ports[line] is reused with other 8250 driver, then em485 will be already activated and it will cause issues. Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: audit: remove unused variableSudip Mukherjee2016-03-071-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | While building with W=1 we were getting build warning: drivers/tty/tty_audit.c:149:16: warning: variable 'sessionid' set but not used The local variable sessionid was only assigned the value of current->sessionid but was never reused. On further inspection it turned out that there is no need of audit_get_loginuid() also. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Revert "sc16is7xx: implemented get_mctrl"Greg Kroah-Hartman2016-03-071-10/+4
| | | | | | | | | | | | | | | | | | | | | | This reverts commit a3f0b77f36ca5c5871fb8daf7e66fa409abe1ed5. Maarten writes: It appears to be wrong and I don't have a good idea how to fix it yet. Cc: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org
* | sc16is7xx: implemented get_mctrlMaarten Brock2016-02-141-4/+10
| | | | | | | | | | | | | | Add support for manual getting the modem control lines. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | sc16is7xx: implemented set_mctrlMaarten Brock2016-02-141-2/+10
| | | | | | | | | | | | | | Add support for manual setting the modem control lines. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty/serial: digicolor: Fix bad usage of IS_ERR_VALUEGuenter Roeck2016-02-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS_ERR_VALUE() assumes that its parameter is an unsigned long. It can not be used to check if an unsigned int reflects an error. Doing so can result in the following build warning. drivers/tty/serial/digicolor-usart.c: In function ‘digicolor_uart_probe’: include/linux/err.h:21:38: warning: comparison is always false due to limited range of data type drivers/tty/serial/digicolor-usart.c:485:6: note: in expansion of macro ‘IS_ERR_VALUE’ If that warning is seen, an error return from platform_get_irq() is missed. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: clps711x: Fix bad usage of IS_ERR_VALUEGuenter Roeck2016-02-141-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS_ERR_VALUE() assumes that its parameter is an unsigned long. It can not be used to check if an unsigned int reflects an error. Doing so can result in the following build warning. drivers/tty/serial/clps711x.c: In function ‘uart_clps711x_probe’: include/linux/err.h:21:38: warning: comparison is always false due to limited range of data type drivers/tty/serial/clps711x.c:471:6: note: in expansion of macro ‘IS_ERR_VALUE’ If that warning is seen, an error return from platform_get_irq() is missed. Use a temporary variable to check for errors from platform_get_irq(). Also don't use IS_ERR_VALUE() to check if an integer variable is < 0. The variable can be checked directly in that case. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: bcm2835: fix unsigned int issue with irqMartin Sperl2016-02-141-5/+5
| | | | | | | | | | | | | | | | | | | | Fixes error condition check when requesting the irq, that would not trigger because of uart_port.irq being defined as unsigned int. Reported by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | serial: 8250_early: Add earlycon support for TegraJon Hunter2016-02-141-0/+1
| | | | | | | | | | | | | | | | Declare an OF early console for Tegra so that the early console device can be specified via the "stdout-path" property in device-tree. Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | 8250: mediatek: mark PM functions as __maybe_unusedArnd Bergmann2016-02-141-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mtk8250_runtime_suspend function is not used when runtime PM is disabled, so we get a warning about an unused function: drivers/tty/serial/8250/8250_mtk.c:119:12: error: 'mtk8250_runtime_suspend' defined but not used [-Werror=unused-function] static int mtk8250_runtime_suspend(struct device *dev) This marks all the PM functions as __maybe_unused to avoid the warning, and removes the #ifdef around the PM_SLEEP functions for consistency. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | tty: serial: meson: Add support for XTAL clock inputAndreas Färber2016-02-141-1/+7
| | | | | | | | | | | | | | | | Fix the baudrate calculation for 24 MHz XTAL clock found on gxbb platforms. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | Merge 4.5-rc4 into tty-nextGreg Kroah-Hartman2016-02-144-5/+54
|\ \ | |/ | | | | | | | | We want the fixes in here, and this resolves a merge error in tty_io.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * Revert "8250: uniphier: allow modular build with 8250 console"Greg Kroah-Hartman2016-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit d56edd7ed0ed46a8043ee3040ededbd190818ccf, it shouldn't have been applied, it was fixed properly with commit 71f50c6d9a2276f3ec85384bffe2aee1962f4669 ("of: drop symbols declared by _OF_DECLARE() from modules") Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud