summaryrefslogtreecommitdiff
path: root/drivers/tty
AgeCommit message (Collapse)AuthorFilesLines
2015-08-15serial: imx: save and restore context in the suspend pathEduardo Valentin1-21/+37
This change teaches the imx serial driver to save its context and restore it across suspend and resume path. To do so, it introduces serial_imx_restore_context() and serial_imx_save_context() functions. They use a shadow set of registers to save key registers and restore them accordingly. These functions can be reused on other situations, when the device context is lost. Cc: Fabio Estevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: imx: allow waking up on RTSDEduardo Valentin1-0/+7
This patch sets RTSDEN bit when going into idle (Stop mode). We add the RTSDEN for the case RTS is sent from the remote connection. This way we allow the system to wakeup when RTS is received. Cc: Fabio Stevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: imx: introduce serial_imx_enable_wakeup()Eduardo Valentin1-8/+14
This change is a code reorganization. Here we introduce serial_imx_enable_wakeup() helper function to do the job of configuring and preparing wakeup sources on imx serial device. The idea is to allow other parts of the code to call this function whenever the device is known to go to idle. Cc: Fabio Estevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: imx: remove unbalanced clk_prepareEduardo Valentin1-14/+6
The current code attempts to prepare clk_per and clk_ipg before using the device. However, the result is an extra prepare call on each clock. Here is the output of uart clocks (only uart enabled and used as console): $ grep uart /sys/kernel/debug/clk/clk_summary uart_serial 1 2 80000000 0 0 uart 1 2 66000000 0 0 This patch balances the calls of prepares. The result is: $ grep uart /sys/kernel/debug/clk/clk_summary uart_serial 1 1 80000000 0 0 uart 1 1 66000000 0 0 Cc: Fabio Estevam <festevam@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: 8250: move rx_running out of the bitfieldJohn Ogness1-3/+3
That bitfield is modified by read + or + write operation. If someone sets any of the other two bits it might render the lock useless. While at it, remove other bitfields as well to avoid more such errors. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15tty: serial: 8250_omap: do not use RX DMA if pause is not supportedSebastian Andrzej Siewior1-1/+13
The 8250-omap driver requires the DMA-engine driver to support the pause command in order to properly turn off programmed RX transfer before the driver stars manually reading from the FIFO. The lacking support of the requirement has been discovered recently. In order to stay safe here we disable RX-DMA completly on probe. The rx_dma_broken assignment on probe could be removed once we working pause function in omap-dma. Cc: <stable@vger.kernel.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial:8250_dw: do not alter CTS and DCTS since AFE is enabledQipeng Zha1-22/+0
Since the serial core is informed that this device is doing automatic flow control, it is not necessary to alter CTS and DCTS of the MSR as the core no longer attempts stop the port in uart_handle_cts_change(). Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com> Signed-off-by: Qipeng Zha <qipeng.zha@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15tty: serial: men_z135_uart.c: Don't initialize port->lockJohannes Thumshirn1-1/+0
port->lock get's initialized in uart_add_one_port(), no need to do it in men_z135_probe(). Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15tty: serial: men_z135_uart.c: Fix race between IRQ and set_termios()Johannes Thumshirn1-5/+4
Fix panic caused by a race between men_z135_intr() and men_z135_set_termios(). men_z135_intr() and men_z135_set_termios() both hold the struct uart_port::lock spinlock, but men_z135_intr() does a spin_lock_irqsave() and men_z135_set_termios() does a normal spin_lock(), which can lead to a deadlock when an interrupt is called while the lock is being helt by men_z135_set_termios(). This was discovered using a insmod, hardware looppback send/receive, rmmod stress test. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Cc: Andreas Werner <andreas.werner@men.de> Cc: stable@vger.kernel.org # v4.0+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: 8250: bind to ALi Fast Infrared Controller (ALI5123)Maciej S. Szmigiero1-0/+6
This way this device can be used with irtty-sir - at least on Toshiba Satellite A20-S103 it is not configured by default and needs PNP activation before it starts to respond on I/O ports. This device has actually its own driver (ali-ircc), but this driver seems to be non-functional for a very long time (see http://permalink.gmane.org/gmane.linux.irda.general/484 http://permalink.gmane.org/gmane.network.protocols.obex.openobex.user/943 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535070 ). Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: 8250: don't bind to SMSC IrCC IR portMaciej S. Szmigiero1-0/+5
SMSC IrCC SIR/FIR port should not be bound to by (legacy) serial driver so its own driver (smsc-ircc2) can bind to it. Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: mxs-auart: fix baud rate rangeStefan Wahren1-2/+6
Currently mxs-auart doesn't care correctly about the baud rate divisor. According to reference manual the baud rate divisor must be between 0x000000EC and 0x003FFFC0. So calculate the possible baud rate range and use it for uart_get_baud_rate(). Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: mxs-auart: keep the AUART unit in reset state when not in useJuergen Borleis1-7/+39
Whenever the UART device driver gets closed from userland, the driver disables the UART unit and then stops the clocks to save power. The bit which disabled the UART unit is described as:  "UART Enable. If this bit is set to 1, the UART is enabled. Data transmission and reception occurs for the UART signals. When the UART is disabled in the middle of transmission or reception, it completes the current character before stopping." The important part is the "it completes the current character". Whenever a reception is ongoing when the UART gets disabled (including the clock off) the statemachine freezes and "remembers" this state on the next open() when re-enabling the unit's clock. In this case we end up receiving an additional bogus character immediately. The solution in this change is to switch the AUART unit into its reset state on close() and only release it from its reset state on the next open(). Note: when the unit is also used as system console it is always 'in use', so we cannot reset it on close(). Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-15serial: mxs-auart: use a function name to reflect what it really doesJuergen Borleis1-2/+2
This function clears the reset the AUART unit is in after system start to make it work. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: 8250_pci: fix mode after S3/S4 resume for F81504/508/512Peter Hung1-4/+21
Fix RS232/485 mode incorrect setting after S3/S4 resume for F81504/508/512 We had add RS232/485 RTS control with fecf27a373f5. But when it resume from S3/S4, the mode register 0x40 + 0x08 * idx + 7 will rewrite to 0x01 (RS232 mode). This patch will modify 2 sections. One is pci_fintek_init(), if it called when first init, it will write mode register with 0x01. If it called from S3/S4 resume, it's will get the relative port data and pass it to pci_fintek_rs485_config() with NULL rs485 parameter. The another modification is in pci_fintek_rs485_config(). It'll re-apply old configuration when the parameter rs485 is NULL. Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05sc16is7xx: constify devtypeJakub Kicinski1-4/+4
devtype structures are all declared as const. Compiler does not complain because we cast their pointers to save them in .driver_data. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05sc16is7xx: support multiple devicesJakub Kicinski1-24/+49
We currently register the uart driver during device probe which makes it hard to support more than one chip. Move the driver registration to module init/exit time and preallocate space for up to 8 lines (4-8 chips). Reported-by: Michael Allwright <michael.allwright@upb.de> Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05sc16is7xx: save and use per-chip line numberJakub Kicinski1-10/+21
In preparation of supporting multiple devices we should save the per-chip line number (0 or 1), because the uart_port line will reflect system-wide uart number and will be offseted for chips other than the first to register. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05uart: pl011: Add support to ZTE ZX296702 uartJun Nie2-16/+183
Support ZTE uart with some registers differing offset. Probe as platform device for not AMBA IP ID is available on ZTE uart. Signed-off-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05uart: pl011: Improve LCRH register access decisionJun Nie1-2/+7
Improve LCRH register access decision as ARM PL011 lcrh register serve as both TX and RX, while other SOC may implement TX and RX function with separated register. Signed-off-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05uart: pl011: Introduce register look up tableJun Nie1-5/+50
Introduce register look up table as different SOC venders may have different register offset for the some register. Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05uart: pl011: Introduce register accessorJun Nie1-122/+141
Introduce register accessor to ease loop up table access in later patch. Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05uart: pl011: Rename regs with enumerationJun Nie1-93/+114
Rename regs with enumeration to generalize register names. Signed-off-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: 8250_pci: Add support for Pericom PI7C9X795[1248]Adam Lee1-21/+61
Pericom PI7C9X795[1248] are Uno/Dual/Quad/Octal UART devices, this patch enables them, also defines PCI_VENDOR_ID_PERICOM here. Signed-off-by: Adam Lee <adam.lee@canonical.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: samsung: fix DMA for FIFO smaller than cache line sizeRobert Baldyga1-15/+21
So far DMA mode were activated when only number of bytes to send was equal or greater than min_dma_size. Due to requirement that DMA transaction buffer should be aligned to cache line size, the excessive bytes were written to FIFO before starting DMA transaction. The problem occurred when FIFO size were smaller than cache alignment, because writing all excessive bytes to FIFO would fail. It happened in DMA mode when PIO interrupts disabled, which caused driver hung. The solution is to test if buffer is alligned to cache line size before activating DMA mode, and if it's not, running PIO mode to align buffer and then starting DMA transaction. In PIO mode, when interrupts are enabled, lack of space in FIFO isn't the problem, so buffer aligning will always finish with success. Cc: <stable@vger.kernel.org> # v3.18+ Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: samsung: fix DMA mode enter condition for small FIFO sizesMarek Szyprowski2-2/+12
Due to some of serial ports can have FIFO size smaller than cache line size, and because of need to align DMA buffer address to cache line size, it's necessary to calculate minimum number of bytes for which we want to start DMA transaction to be at least cache line size. The simplest way to meet this requirement is to get maximum of cache line size and FIFO size. Cc: <stable@vger.kernel.org> # v3.18+ Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: core: Remove tty port activate() and shutdown() methodsPeter Hurley1-7/+0
serial core does not use tty_port_open() or tty_port_close(); serial core defines and extends it's own tty open() and close() methods (uart_open() and uart_close(), respectively). Remove the tty_port activate() and shutdown() initializations, and the uart_port_activate() function, which is never called. NB: uart_port_shutdown() is used by uart_close() => uart_shutdown() call chain (but not via the tty_port methods). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: core: Use proper spinlock flavor in uart_close()Peter Hurley1-10/+8
uart_close() runs in non-atomic context only; use spin_lock/unlock_irq instead of saving the interrupt state (which == on). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05tty/serial: at91: fix I/O accesses on RHR and THR for AVR32Cyrille Pitchen1-10/+27
This patch fixes I/O accesses on the Receiver Holding Register and on the Transmitter Holding Register. Indeed AVR32 can only perform 32bit I/O accesses on registers: using 8bit I/O accesses would read or write garbage data. Fixes: commit b5199d468177 ("tty/serial: at91: add support to FIFOs") Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: Allow compile test of GPIO consumers if !GPIOLIBGeert Uytterhoeven1-1/+2
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer functionality only, can still be compiled if GPIOLIB is not enabled. Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where appropriate. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: 8250: Auto CTS control by HW if AFE enabledQipeng Zha2-0/+9
According to DesignWare 8250 spec, if auto flow control mode is enabled, a change in CTS does not cause an interrupt, so sw-assisted CTS flow control mode will not work properly. There reported an GPS firmware download failure issue, and we verified the root cause is, the default sw-assisted CTS flow control mode can not work properly since no interrupt when got CTS signal. This patch is to enable auto CTS mode by defaut if CRTSCTS is enable for DesignWare 8250 controller. Signed-off-by: Huiquan Zhong <huiquan.zhong@intel.com> Signed-off-by: Qipeng Zha <qipeng.zha@intel.com> Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: mpc52xx: let tx_empty callback return either 0 or TIOCSER_TEMTUwe Kleine-König1-2/+3
Documenation/serial/driver requests that the tx_empty callback should return 0 if there are still chars in the fifo or shifter or TIOCSER_TEMT (0x01) if no character is pending to be sent. Fix the mpc52xx serial driver to not return MPC52xx_PSC_SR_TXEMP (i.e. 0x0800) but TIOCSER_TEMT as documented. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: etraxfs-uart: use mctrl_gpio helpers for handling modem signalsNiklas Cassel2-30/+11
In order to use the mctrl_gpio helpers, we change the DT bindings: ri-gpios renamed to rng-gpios. cd-gpios renamed to dcd-gpios. However, no in-tree dts/dtsi specifies these, so no worries. Signed-off-by: Niklas Cassel <nks@flawful.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-05serial: etraxfs-uart: remove empty functionsNiklas Cassel1-10/+0
Implementing enable_ms is optional by serial_core. check_modem_status is just an empty local function. Signed-off-by: Niklas Cassel <nks@flawful.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04Serial: imx: add dev_pm_ops to support suspend to ram/diskShenwei Wang1-32/+94
When system goes into low power states like SUSPEND_MEM and HIBERNATION, the hardware IP block may be powered off to reduce the power consumption. This power down may cause problems on some imx platforms, because the hardware settings are reset to its power on default values which may differ from the ones when it power off. This patch added the dev_pm_ops and implemented two callbacks: suspend_noirq and resume_noirq, which will save the necessory hardware parameters right before power down and recover them before system uses the hardware. Because added the dev_pm_ops, the old suspend/resume callbacks under platform_driver will not be called any more. Changed their prototypes and moved those two callbacks into dev_pm_ops too. Signed-off-by: Shenwei Wang <shenwei.wang@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04serial: 8250_uniphier: call clk_disable_unprepare() on failure pathMasahiro Yamada1-0/+1
If serial8250_register_8250_port() fails, disable and unprepare the clock before exiting. Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04serial: 8250_pci: add RS485 for F81504/508/512Peter Hung1-0/+61
Add RS485 control for Fintek F81504/508/512 F81504/508/512 can control their RTS with H/W mode. PCI configuration space for each port is 0x40 + idx * 8 + 7. When it set with 0x01, it's configured with RS232 mode. RTS is controlled by MCR. When it set with 0x11, it's configured with RS485 mode. RTS is controlled by H/W, RTS low with idle & RX, high with TX. When it set with 0x31, it's configured with RS485 mode. RTS is controlled by H/W, RTS high with idle & RX, low with TX. We will force 0x01 on pci_fintek_setup(). Signed-off-by: Peter Hung <hpeter+linux_kernel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-04Avoid usb reset crashes by making tty_io cdevs truly dynamicRichard Watts1-8/+16
Avoid usb reset crashes by making tty_io cdevs truly dynamic Signed-off-by: Richard Watts <rrw@kynesim.co.uk> Reported-by: Duncan Mackintosh <DMackintosh@cbnl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-27Revert "tty: serial: imx.c: Reset UART before activating interrupts"Fabio Estevam1-23/+9
This reverts commit e95044ba4fee93f5ea8a1a24b2d921e148503833. Commit e95044ba4fee93 ("tty: serial: imx.c: Reset UART before activating interrupts") terribly messes up with the console on mx6 boards, so let's revert it. Reported-by: kernelci.org bot <bot@kernelci.org> Cc: David Jander <david@protonic.nl> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-27Merge 4.2-rc4 into tty-nextGreg Kroah-Hartman9-23/+52
Other serial driver work wants to build on patches now in 4.2-rc4 so merge the branch so this can properly happen. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24pty: Add debug message for ptmx openPeter Hurley1-0/+8
Opens of /dev/ptmx don't use tty_open() so debug messages are not printed for those opens; print a debug message with the open count (which must always be 1) if TTY_DEBUG_HANGUP is defined. NB: Each tty core source file undefs support for debug messages. The relevant source file must be patched/edited to enable these messages. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24tty: core: Improve ldisc debug messagesPeter Hurley1-5/+6
Add debug messages for ldisc open and close, and remove "closing ldisc" message from tty_ldisc_release(), because a close message is now printed for both ldiscs; always print ldisc pointer first so ldisc changes are easier to identify. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24tty: Replace inline #ifdef TTY_DEBUG_WAIT_UNTIL_SENTPeter Hurley1-3/+8
Add tty_debug_wait_until_sent() macro which uses tty_debug() to print the debug message; remove inlined #ifdef. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24tty: Use tty_debug() for tty_ldisc_debug()Peter Hurley1-3/+1
Replace tty_ldisc_debug() macro definition; substitute with equivalent tty_debug() invocation. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24tty: Replace #ifdef TTY_DEBUG_HANGUP with tty_debug_hangup()Peter Hurley1-29/+18
Add tty_debug_hangup() macro which uses tty_debug to print the debug message; remove inlined #ifdefs. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24tty: core: Add tty_debug() for printk(KERN_DEBUG) messagesPeter Hurley1-24/+17
Introduce tty_debug() macro to output uniform debug information for tty core debug messages (function name and tty name). Note: printk(KERN_DEBUG) is retained here over pr_debug() since messages can be enabled in non-DEBUG builds. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24tty: core: Improve debug message contentPeter Hurley1-13/+16
Output the function name, tty name, and invariant failure (if applicable). Add the tty count to the tty_open() message. Fix the disassociate_ctty() message, which printed the NULL pointer and the wrong message. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24drivers/tty: make serial/sunhv.c driver explicitly non-modularPaul Gortmaker1-10/+3
The Kconfig for this driver is currently: config SERIAL_SUNHV bool "Sun4v Hypervisor Console support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular and unused code here, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't swap module.h for init.h since this file has init.h already. We leave some tags like MODULE_LICENSE for documentation purposes, and for the "git blame" value. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code, so we remove that too. Cc: "David S. Miller" <davem@davemloft.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: sparclinux@vger.kernel.org Cc: linux-serial@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24drivers/tty: make serial/suncore.c driver explicitly non-modularPaul Gortmaker1-8/+3
The Kconfig for this driver is currently: config SERIAL_SUNCORE bool ...meaning that it currently is not being built as a module by anyone. Lets remove the modular and unused code here, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't swap module.h for init.h since this file has init.h already. We leave some tags like MODULE_LICENSE for documentation purposes, and for the "git blame" value. Cc: "David S. Miller" <davem@davemloft.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: sparclinux@vger.kernel.org Cc: linux-serial@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24drivers/tty: make serial/lantic.c driver explicitly non-modularPaul Gortmaker1-7/+1
The Kconfig for this option is currently: config SERIAL_LANTIQ bool "Lantiq serial driver" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modularity, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We delete the MODULE_DESCRIPTION and LICENSE tags since they are not adding any new information above and beyond what is at the top of the file. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code, so we remove that as well. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: linux-serial@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>