- 10 Jul, 2014 40 commits
-
-
Peter Hurley authored
tty->closing cannot be set on ipw_open() because the ipwireless tty driver does not call any functions that set tty->closing. CC: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: David Sterba <dsterba@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
tty->closing informs the line discipline that the hardware will be shutting down imminently, and to disable further input other than soft flow control (but to still allow additional output). However, the tty lock is the necessary lock for preventing concurrent changes to tty->closing. As shown by the call-tree audit [1] of functions that modify tty->closing, the tty lock is already held for those functions. [1] Call-tree audit of functions that modify tty->closing * does not include call tree to tty_port_close(), tty_port_close_start(), or tty_port_close_end() which is already documented in 'tty: Document locking for tty_port_close{,start,end}' that shows callers to those 3 functions hold the tty lock tty_release() tty->ops->close() --+ | __tty_hangup() | tty->ops->close() --+ | mp_close():drivers/staging/sb105x/sb_pci_mp.c dngc_tty_close():drivers/staging/dgnc/dgnc_tty.c dgap_tty_close():drivers/staging/dgap/dgap_tty.c dgrp_tty_close():drivers/staging/dgrp/dgrp_tty.c rp_close():drivers/tty/rocket.c hvsi_close():drivers/tty/hvc/hvsi.c rs_close():drivers/tty/serial/68328serial.c rs_close():drivers/tty/serial/crisv10.c uart_close():drivers/tty/serial/serial_core.c isdn_tty_close():drivers/isdn/i4l/isdn_tty.c tty3215_close():drivers/s390/char/con3215.c tty_open() tty_ldisc_setup() ----+ | __tty_hangup() | tty_ldisc_hangup() ---+ | tty_set_ldisc() --------+ tty_ldisc_restore() --+ | +- tty_ldisc_open() ld->ops->open() --+ | +- n_tty_open() Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
The tty lock is held when the tty driver's hangup() method is called (from the lone call-site, __tty_hangup()). The call-tree audit [1] of tty_port_hangup() is a closed graph of the callers of tty_port_hangup(); ie., all callers originate only from __tty_hangup(). Of these callers, none drop the tty lock prior to calling tty_port_hangup(). [1] Call-tree audit of tty_port_hangup() __tty_hangup() tty->ops->hangup() --+ | rs_hangup():arch/ia64/hp/sim/simserial.c line_hangup():arch/um/drivers/line.c gdm_tty_hangup():drivers/staging/gdm724x/gdm_tty.c fwtty_hangup():drivers/staging/fwserial/fwserial.c acm_tty_hangup():drivers/usb/class/cdc-acm.c serial_hangup():drivers/usb/serial/usb-serial.c ipoctal_hangup():drivers/ipack/devices/ipoctal.c cy_hangup():drivers/tty/cyclades.c isicom_hangup():drivers/tty/isicom.c rp_hangup():drivers/tty/rocket.c dashtty_hangup():drivers/tty/metag_da.c moxa_hangup():drivers/tty/moxa.c gsmtty_hangup():drivers/tty/n_gsm.c goldfish_tty_hangup():drivers/tty/goldfish.c ehv_bc_tty_hangup():drivers/tty/ehv_bytechan.c mxser_hangup():drivers/tty/mxser.c kgdb_nmi_tty_hangup():drivers/tty/serial/kgdb_nmi.c ifx_spi_hangup():drivers/tty/serial/ifx6x60.c ntty_hangup():drivers/tty/nozomi.c capinc_tty_hangup():drivers/isdn/capi/capi.c mgslpc_hangup():drivers/char/pcmcia/synclink_cs.c sdio_uart_hangup():drivers/mmc/card/sdio_uart.c rfcomm_tty_hangup():net/bluetooth/rfcomm/tty.c | +- tty_port_hangup() Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
The tty lock is held when the tty driver's open() method is called (from tty_open()). The call-tree audit [1] of tty_port_block_til_ready() is a closed graph of the callers of tty_port_block_til_ready(); ie., all callers originate only from tty_open(). Of these callers, none drop the tty lock. Also, document tty_port_block_til_ready() may drop and reacquire the tty lock when blocking, which means the tty or tty_port may have changed state. [1] Call-tree audit of tty_port_block_til_ready() * does not include call tree of tty_port_open() which is already documented in 'tty: Document locking from tty_port_open()' tty_open() tty->ops->open() --+ | cy_open():drivers/tty/cyclades.c rp_open():drivers/tty/rocket.c rs_open():drivers/tty/amiserial.c moxa_open():drivers/tty/moxa.c gsmtty_open():drivers/tty/n_gsm.c rs_open():drivers/tty/serial/68328serial.c uart_open():drivers/tty/serial/serial_core.c isdn_tty_open():drivers/isdn/i4l/isdn_tty.c mgslpc_open():drivers/char/pcmcia/synclink_cs.c | +- tty_port_block_til_ready() Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
The tty lock is held when the tty driver's open method is called (from the lone call-site, tty_open()). The call-tree audit [1] of tty_port_open() is a closed graph of the callers of tty_port_open(); ie., all callers originate from only tty_open(). Of these callers, none drop the tty lock. Also, document that tty_port_block_til_ready() may drop and reacquire the tty lock when blocking, which means the tty or tty_port may have changed state. [1] Call-tree audit of tty_port_open() tty_open() tty->ops->open() --+ | rs_open():arch/ia64/hp/sim/simserial.c *line_open():arch/um/drivers/line.c gdm_tty_open():drivers/staging/gdm724x/gdm_tty.c fwtty_open():drivers/staging/fwserial/fwserial.c acm_tty_open():drivers/usb/class/cdc-acm.c serial_open():drivers/usb/serial/usb-serial.c pti_tty_driver_open():drivers/misc/pti.c ipoctal_open():drivers/ipack/devices/ipoctal.c isicom_open():drivers/tty/isicom.c dashtty_open():drivers/tty/metag_da.c goldfish_tty_open():drivers/tty/goldfish.c ehv_bc_tty_open():drivers/tty/ehv_bytechan.c mxser_open():drivers/tty/mxser.c kgdb_nmi_tty_open():drivers/tty/serial/kgdb_nmi.c ifx_spi_open():drivers/tty/serial/ifx6x60.c smd_tty_open():drivers/tty/serial/msm_smd_tty.c ntty_open():drivers/tty/nozomi.c capinc_tty_open():drivers/isdn/capi/capi.c tpk_open():drivers/char/ttyprintk.c sdio_uart_open():drivers/mmc/card/sdio_uart.c rfcomm_tty_open():net/bluetooth/rfcomm/tty.c | +- tty_port_open() * line_open() is the .open method for 2 um drivers declared in ./arch/um/drivers/stdio_console.c and in ./arch/um/drivers/ssl.c, and not called directly Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
The tty lock is held when the tty driver's .close method is called (from the two lone call-sites of tty_release() and __tty_hangup()). The call-tree audit[1] of tty_port_close(), tty_port_close_start, and tty_port_close_end() is a closed graph of the callers of these 3 functions; ie., all callers originate from only tty_release() or __tty_hangup(). Of these callers, none drop the tty lock. Also, document tty_port_close_start() may drop and reacquire the tty lock in tty_wait_until_sent_from_close(), which means the tty or tty_port may have changed state (but not reopened or hung up). [1] Call-tree audit of tty_port_close, tty_port_close_start, and tty_port_close_end() tty_release() tty->ops->close() --+ | __tty_hangup() | tty->ops->close() --+ | +- rp_close():drivers/tty/rocket.c -------------------+ +- uart_close():drivers/tty/serial/serial_core.c -----+ | +- tty_port_close_start() | | +- close():drivers/tty/synclinkmp.c ------------------+ +- rs_close():drivers/tty/amiserial.c ----------------+ +- gsmtty_close():drivers/tty/n_gsm.c ----------------+ +- mxser_close():drivers/tty/mxser.c -----------------+ +- close():drivers/tty/synclink_gt.c -----------------+ +- mgsl_close():drivers/tty/synclink.c ---------------+ +- isdn_tty_close():drivers/isdn/i4l/isdn_tty.c ------+ +- mgslpc_close():drivers/char/pcmcia/synclink_cs.c --+ +- ircomm_tty_close():net/irda/ircomm/ircomm_tty.c ---+ | | rs_close():arch/ia64/hp/sim/simserial.c | *line_close():arch/um/drivers/line.c | gdm_tty_close():drivers/staging/gdm724x/gdm_tty.c fwtty_close():drivers/staging/fwserial/fwserial.c acm_tty_close():drivers/usb/class/cdc-acm.c serial_close():drivers/usb/serial/usb-serial.c pti_tty_driver_close():drivers/misc/pti.c ipoctal_close():drivers/ipack/devices/ipoctal.c cy_close():drivers/tty/cyclades.c isicom_close():drivers/tty/isicom.c dashtty_close():drivers/tty/metag_da.c moxa_close():drivers/tty/moxa.c goldfish_tty_close():drivers/tty/goldfish.c ehv_bc_tty_close():drivers/tty/ehv_bytechan.c kgdb_nmi_tty_close():drivers/tty/serial/kgdb_nmi.c ifx_spi_close():drivers/tty/serial/ifx6x60.c smd_tty_close():drivers/tty/serial/msm_smd_tty.c ntty_close():drivers/tty/nozomi.c capinc_tty_close():drivers/isdn/capi/capi.c tpk_close():drivers/char/ttyprintk.c sdio_uart_close():drivers/mmc/card/sdio_uart.c | rfcomm_tty_close():net/bluetooth/rfcomm/tty.c | | | +- tty_port_close():drivers/tty/tty_port.c -----------+ | +- tty_port_close_start() +- tty_port_close_end() * line_close() is the .close method for 2 um drivers, declared in ./arch/um/drivers/stdio_console.c and in ./arch/um/drivers/ssl.c, and not called directly Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
The tty core calls the tty driver's open, close and hangup methods holding the tty lock. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Stefan Agner authored
The DMA burst size must match the transmit FIFO depth in order to make sure all character are transmitted. This patch calculates DMA burst size by using FIFO depth rather than use the hardcoded 16 bytes. This is required since some UARTs (e.g. UART2 on Vybrid) have a FIFO depth of 8 bytes. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Stefan Agner authored
The DMA RX timeout calculation is done based on FIFO buffer size and port timeout when setting up DMA. However, both variables are not necessarily initialized at DMA initialization time, which can lead to a division by zero. Move the timeout calculation to set_termios where both variables are initialized. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Peter Hurley authored
When a tty is opened for the serial console, the termios c_cflag settings are inherited from the console line settings. However, if the tty is subsequently closed, the termios settings are lost. This results in a garbled console if the console is later suspended and resumed. Preserve the termios c_cflag for the serial console when the tty is shutdown; this reflects the most recent line settings. Fixes: Bugzilla #69751, 'serial console does not wake from S3' Reported-by: Valerio Vanni <valerio.vanni@inwind.it> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Pradeep Goudagunta authored
The Rx dma descriptor allocated without the DMA_ACK flags so that once after tarnsfer done or terminated, client can ack the descriptor to free it for later use. If the Rx DMA is terminated for some reason then rx-dma descriptor is not getting acked which causes the memory leak and list of usage desc to grow continuously. Hence, acknowledge the rx-dma descriptor once transfer is terminated to avoid memory leak and desc list to grow. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Pradeep Goudagunta authored
When channel is require to stop transmit then update the Tx circular buffer only when DMA based transfer is in progress. If there is no DMA based transfer then no need to update the Tx buffer. Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Arnd Bergmann authored
Every uart driver that provides a console driver needs to be built-in for the console code to work, we get a build error for modular console drivers. This changes the SERIAL_HS_LPC32XX_CONSOLE symbol to depend on the SERIAL_HS_LPC32XX driver being built-in, just like we do for all the other uart drivers. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Arnd Bergmann authored
When CONFIG_SERIAL_PXA_CONSOLE is disabled, the serial_pxa_get_poll_char and serial_pxa_put_poll_char functions are not defined, and we can't reference them. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
With recent improvements to serial/of core from Grant and Rob, stdout-path alone suffices for setting up earlycon/console. arc_uart driver is already equipped to handle that, switch the DT now. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
This allows a param less earlycon to pick up the earlyconsole from chosen/stdout-path Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
With ARC uart driver switching to generic earlycon, we no longer need this ugliness. You won't be missed. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
With this change both earlyprintk and earlycon coexist We switch over to latter in next patch Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
The ARC UART MMIO helpers would take arc_uart_port and then reference generic uart_port->membase member. So change them to difrectly refer to uart_port and fix call sites accordingly. This removes the need for to_arc_port() converion almost eveeywhere and makes code a bit easier to read. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vineet Gupta authored
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Heiko Stübner authored
First try to find the named clock variants then fall back to the already existing handling of a nameless declared baudclk. This also adds the missing documentation for this already existing variant. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Andy Shevchenko authored
The flags member has upf_t type and corresponding macros to define them. This patch converts ASYNC_SKIP_TEST to UPF_SKIP_TEST in 8250_dw.c. Otherwise we got a sparse warning: drivers/tty/serial/8250/8250_dw.c:302:46: warning: restricted upf_t degrades to integer drivers/tty/serial/8250/8250_dw.c:302:62: warning: restricted upf_t degrades to integer drivers/tty/serial/8250/8250_dw.c:302:26: warning: incorrect type in assignment (different base types) drivers/tty/serial/8250/8250_dw.c:302:26: expected restricted upf_t [usertype] flags drivers/tty/serial/8250/8250_dw.c:302:26: got unsigned int Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Heikki Krogerus authored
This replaces the Baytrail specific custom set_termios hook with a more generic one where the clock framework is used to set the rate. The method also doesn't need to be limited to just Baytrail, so it's used with all ACPI platforms. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Fabio Estevam authored
When building multi_v7_defconfig with CONFIG_ARM_LPAE=y the following warning is seen: drivers/tty/serial/samsung.c: In function 's3c24xx_serial_init_port': drivers/tty/serial/samsung.c:1229:2: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' [-Wformat] Use %pa to print 'resource_size_t' type to fix the warning. Reported-by: Olof's autobuilder <build@lixom.net> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Rickard Strandqvist authored
There is a risk that the variable will be used without being initialized. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Qipan Li authored
the current codes send 1 bytes, then after getting TX done interrupt, send subsequent bytes. it causes redundant interrupts. for example, if we have 3 bytes in TX buffer, the TX flow is: 1. send 1 byte 2. get TX down interrupt 3. send the left 2 bytes 4. get TX down interrupt this patch moves to send more bytes and decrease interrupts, the new flow is: 1. send 3 bytes 2. get TX down interrupt 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>
-
Johannes Thumshirn authored
Call uart_write_wakeup() after writing the hardware FIFO and updateing the FIFO pointers. This fixes high latency and jitter on PPP over Serial links. Reported-by: Jun Shih <Jun.Shih@pason.com> Tested-by: Jun Shih <Jun.Shih@pason.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alexander Shiyan authored
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alexander Shiyan authored
This patch makes enable_ms() optional, so we can eliminate a lot of empty enable_ms() implementations from driver code. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kukjin Kim authored
This patch removes s5pc100 related serial. Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kukjin Kim authored
This patch removes s5p64x0 related serial because of removing support for s5p64x0 SoCs. Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tomasz Figa authored
This patch adds alias entries for UART nodes of all SoCs using samsung-uart compatible UART controllers, so that the dependency on probe order is removed and deterministic device naming is assured. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tomasz Figa authored
Current driver code relies on probe order of particular samsung-uart instances, which makes it impossible to get proper initialization of ports when not all ports are available on board, not even saying of deterministic device naming. This patch fixes this on DT-enabled systems by using DT aliases for ports as instance ID, if specified, or falling back to legacy method otherwise to provide backwards compatibility. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tomasz Figa authored
The primary purpose of this patch is to add information about (now required) aliases of UART ports. However the documentation currently is heavily outdated and so this patch also takes care of this. Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tushar Behera authored
Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and devm_clk_get. Signed-off-by: Tushar Behera <tushar.b@samsung.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tushar Behera authored
The label 'out' is only used to return the error code. We can return the error code directly and remove 'out' label. Signed-off-by: Tushar Behera <tushar.b@samsung.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-