aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty
AgeCommit message (Collapse)AuthorFilesLines
2016-11-16serial: 8250_dma: power off device after TX is doneAndy Shevchenko1-2/+7
When any 8250 based driver sets up DMA and has UART_CAP_RPM capability enabled the device is left powered on after transfer is done. We need to schedule a device suspend operation when DMA completes the transfer. The patch is based on the work done by the reporter. Reported-by: Huiquan Zhong <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-16serial: 8250_port: export serial8250_rpm_{get|put}_tx()Andy Shevchenko2-2/+9
The following fix of runtime PM use in DMA mode requires at least serial8250_rpm_put_tx() to be available. Export both calls. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-16serial: sunsu: Free memory when probe failsSouptick Joarder1-0/+1
When su_probe() fails it doesn't free *up and we may have a memory leak. Fix this by freeing *up before return. Signed-off-by: Souptick joarder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-16serial: sunhv: Free memory when remove() is calledSouptick Joarder1-1/+2
In each call to hv_remove(), con_read_page and con_write_page is not getting freed and lead to memory leakage. Fix this by freeing both pointers in hv_remove(). Signed-off-by: Souptick joarder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-16vt: fix Scroll Lock LED trigger nameMaciej S. Szmigiero1-1/+1
There is a disagreement between drivers/tty/vt/keyboard.c and drivers/input/input-leds.c with regard to what is a Scroll Lock LED trigger name: input calls it "kbd-scrolllock", but vt calls it "kbd-scrollock" (two l's). This prevents Scroll Lock LED trigger from binding to this LED by default. Since it is a scroLL Lock LED, this interface was introduced only about a year ago and in an Internet search people seem to reference this trigger only to set it to this LED let's simply rename it to "kbd-scrolllock". Also, it looks like this was supposed to be changed before this code was merged: https://lkml.org/lkml/2015/6/9/697 but it was done only on the input side. Signed-off-by: Maciej S. Szmigiero <[email protected]> Acked-by: Samuel Thibault <[email protected]> Cc: stable <[email protected]> # 4.2+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: typo in comments in drivers/tty/vt/keyboard.cAskar Safin1-1/+1
Fixed typo in comments in drivers/tty/vt/keyboard.c Signed-off-by: Askar Safin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: amba-pl011: Add earlycon support for SBSA UARTKefeng Wang1-0/+1
Declare an OF early console for SBSA UART so that the early console device can be specified via the "stdout-path" property in device-tree. Cc: Russell King <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: nozomi: use permission-specific DEVICE_ATTR variantsJulia Lawall1-2/+2
Use DEVICE_ATTR_RO for read only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @ro@ declarer name DEVICE_ATTR; identifier x,x_show; @@ DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); @script:ocaml@ x << ro.x; x_show << ro.x_show; @@ if not (x^"_show" = x_show) then Coccilib.include_match false @@ declarer name DEVICE_ATTR_RO; identifier ro.x,ro.x_show; @@ - DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); + DEVICE_ATTR_RO(x); // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: serial: Make the STM32 serial port depend on it's archPeter Robinson1-1/+1
The STM32 serial port is SoC specific so no point enabling it without the architecture enabled. Signed-off-by: Peter Robinson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: ifx6x60: Free memory when probe failsSouptick Joarder1-0/+1
When spi_setup() fails it doesn't free ifx_dev and we have a memory leak. Fix this by freeing ifx_dev before the return. Signed-off-by: Souptick joarder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: ioc4_serial: Free memory when kzalloc fails during probeSouptick Joarder1-1/+6
Inside ioc4_attach_local() 4 memory was allocated using kzalloc and assign it to ports[] within loop. When kzalloc fails inside loop, it returns error without freeing previously allocated memory and we may have memory leak. Fix this by freeing ports[] before return. Signed-off-by: Souptick joarder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: pxa2xx: mark PM functions as __maybe_unusedArnd Bergmann1-4/+2
The fresh new serial driver for pxa produces warnings when CONFIG_PM_SLEEP is disabled: drivers/tty/serial/8250/8250_pxa.c:50:12: error: 'serial_pxa_resume' defined but not used [-Werror=unused-function] drivers/tty/serial/8250/8250_pxa.c:41:12: error: 'serial_pxa_suspend' defined but not used [-Werror=unused-function] This removes the #ifdef around the two functions and instead marks both as __maybe_unused, which is more robust and avoids the warning. Fixes: ab28f51c77cd ("serial: rewrite pxa2xx-uart to use 8250_core") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: pxa2xx: remove __deprecated annotationArnd Bergmann1-1/+1
An otherwise very nice cleanup of the pxa2xx uart support marked the init function of this driver as __deprecated: drivers/tty/serial/pxa.c:944:1: error: 'serial_pxa_init' is deprecated [-Werror=deprecated-declarations] This seems unhelpful to me, as we now warn for every allmodconfig build, which is otherwise free of warnings on most architectures. Let's remove the annotation again. Fixes: ab28f51c77cd ("serial: rewrite pxa2xx-uart to use 8250_core") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: crisv10: fix invalid user-pointer checkJohan Hovold1-2/+0
Drop invalid user-pointer check from TIOCGSERIAL handler. A NULL-pointer can be valid in user space and copy_to_user() takes care of sanity checking. Cc: Mikael Starvik <[email protected]> Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]> Acked-by: Jesper Nilsson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: rocket: fix invalid user-pointer checksJohan Hovold1-4/+0
Drop invalid user-pointer checks from custom ioctl handlers. A NULL-pointer can be valid in user space and copy_to_user() takes care of sanity checking. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: amiserial: fix invalid user-pointer checkJohan Hovold1-2/+0
Drop invalid user-pointer check from TIOCGSERIAL handler. A NULL-pointer can be valid in user space and copy_to_user() takes care of sanity checking. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-108250: FIX Fourth port offset of Pericom PI7C9X7954 boardsAngelo Butti1-0/+34
Hi, below patch to fix Fourth port offset of Percom PI7C9X7954 boards. I had a problem using Fourth port on a pci express serial board based on Pericom PI7C9X7954. Reading datasheet I notice a "special" offset assign to this port when used in I/O mode. Offset 0x0 -> UART 0 Offset 0x8 -> UART 1 Offset 0x10 -> UART 2 Offset 0x38 -> UART 3 <<---- This don't follow a logical sequence This patch add a different init to last port, to have right offset. I check also Pericom 7952 and 7958 but that devices follow logical sequence, so they are ok. Regards, Angelo Signed-off-by: Angelo Butti <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: sh-sci: Fix deadlock caused by serial output requestTakatoshi Akiyama1-15/+5
While spin is already locked, serial output request causes the deadlock, because serial output process also tries to lock the spin. This patch removes serial output with spin locked. Signed-off-by: Takatoshi Akiyama <[email protected]> Signed-off-by: Takeshi Kihara <[email protected]> Signed-off-by: Simon Horman <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10tty: serial: make crisv10 explicitly non-modularPaul Gortmaker1-4/+2
The Kconfig currently controlling compilation of this code is: arch/cris/arch-v10/drivers/Kconfig:config ETRAX_SERIAL arch/cris/arch-v10/drivers/Kconfig: bool "Serial-port support" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modular infrastructure use, 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 replace module.h with init.h since the file already has that. Cc: Mikael Starvik <[email protected]> Cc: Jesper Nilsson <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: 8250_pxa: hide early console setup when disabledArnd Bergmann1-0/+2
The newly added pxa glue driver for 8250 supports console output, but fails to build if the 8250 console is disabled: drivers/tty/serial/8250/8250_pxa.o: In function `early_serial_pxa_setup': 8250_pxa.c:(.init.text+0x50): undefined reference to `early_serial8250_setup' This adds an #ifdef like the other glue drivers have it. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: 8250_uniphier: avoid locking for FCR register writeMasahiro Yamada1-2/+2
The hardware book says, the FCR is combined with a register called CHAR (it will trigger interrupt when a specific character is received). At first, I used lock/read/modify/write/unlock dance for the FCR to not affect the upper bits, but the CHAR is actually never used. It should not hurt to always clear the CHAR and to handle the FCR as a normal case. It can save the costly locking. Signed-off-by: Masahiro Yamada <[email protected]> Suggested-by: Denys Vlasenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-10serial: 8250_uniphier: hardcode regshift to avoid unneeded memory readMasahiro Yamada1-18/+24
For this driver, uart_port::regshift is always 2. Hardcode the shift value instead of reading ->regshift to get an already known value. (pointed out by Denys Vlasenko) Furthermore, I am using register macros that are already shifted, which will save code a bit. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-11-07tty: serial: make crisv10 explicitly non-modularPaul Gortmaker1-4/+2
The Kconfig currently controlling compilation of this code is: arch/cris/arch-v10/drivers/Kconfig:config ETRAX_SERIAL arch/cris/arch-v10/drivers/Kconfig: bool "Serial-port support" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modular infrastructure use, 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 replace module.h with init.h since the file already has that. Cc: Mikael Starvik <[email protected]> Cc: Jesper Nilsson <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Paul Gortmaker <[email protected]> Signed-off-by: Jesper Nilsson <[email protected]>
2016-10-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller12-18/+49
Mostly simple overlapping changes. For example, David Ahern's adjacency list revamp in 'net-next' conflicted with an adjacency list traversal bug fix in 'net'. Signed-off-by: David S. Miller <[email protected]>
2016-10-30Merge 4.9-rc3 into tty-nextGreg Kroah-Hartman12-18/+49
We want the serial/tty fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-28tty: serial_core: fix NULL struct tty pointer access in uart_write_wakeupRob Herring1-2/+2
Since commit 761ed4a94582ab29 ("tty: serial_core: convert uart_close to use tty_port_close"), the serial console is broken on various systems and typing "reboot" splats the following on the serial console: INIT: Sending p[ 427.863916] BUG: unable to handle kernel NULL pointer dereference at 00000000000001e0 [ 427.885156] IP: [] tty_wakeup+0xc/0x70 [ 427.898337] PGD 0 [ 427.902051] [ 427.907498] Oops: 0000 [#1] PREEMPT SMP [ 427.917635] Modules linked in: nfsv3 nfs_acl nfs fscache lockd sunrpc grace edd af_packet cpufreq_conservative cpufreq_userspace cpufreq_powersave fuse loop md_mod dm_mod joydev hid_generic usbhid ipmi_ssif ohci_pci ohci_hcd ehci_pci ehci_hcd e1000e ptp firewire_ohci edac_core pps_core tpm_infineon sp5100_tco firewire_core acpi_cpufreq serio_raw pcspkr fjes usbcore shpchp edac_mce_amd tpm_tis ipmi_si tpm_tis_core i2c_piix4 k10temp sg ipmi_msghandler tpm sr_mod button cdrom kvm_amd kvm irqbypass crc_itu_t ast ttm drm_kms_helper drm fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit scsi_dh_rdac scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw ata_generic pata_atiixp [ 428.054179] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc1-1.g73e3f23-default #1 [ 428.072868] Hardware name: System manufacturer System Product Name/KGP(M)E-D16, BIOS 0902 12/03/2010 [ 428.094755] task: ffffffffa2c0d500 task.stack: ffffffffa2c00000 [ 428.109717] RIP: 0010:[] [] tty_wakeup+0xc/0x70 [ 428.128407] RSP: 0018:ffff9a1a5fc03df8 EFLAGS: 00010086 [ 428.142184] RAX: ffff9a1857258000 RBX: ffffffffa3050ea0 RCX: 0000000000000000 [ 428.159649] RDX: 000000000000001b RSI: 0000000000000000 RDI: 0000000000000000 [ 428.177109] RBP: ffff9a1a5fc03e08 R08: 0000000000000000 R09: 0000000000000000 [ 428.194547] R10: 0000000000021c77 R11: 0000000000000000 R12: ffff9a1857258000 [ 428.212002] R13: 0000000000000000 R14: 0000000000000020 R15: 0000000000000020 [ 428.229481] FS: 0000000000000000(0000) GS:ffff9a1a5fc00000(0000) knlGS:0000000000000000 [ 428.248938] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 428.263726] CR2: 00000000000001e0 CR3: 0000000390c06000 CR4: 00000000000006f0 [ 428.281331] Stack: [ 428.288696] ffffffffa3050ea0 ffff9a1857258000 ffff9a1a5fc03e18 ffffffffa24e0ab1 [ 428.307064] ffff9a1a5fc03e40 ffffffffa24e8865 ffffffffa3050ea0 00000000000000c2 [ 428.325456] 0000000000000046 ffff9a1a5fc03e78 ffffffffa24e8a5f ffffffffa3050ea0 [ 428.343905] Call Trace: [ 428.352319] [ 428.356216] [] uart_write_wakeup+0x21/0x30 The problem is for console ports, the serial port is not shutdown and interrupts may fire after the struct tty is gone. Simply calling the tty_port helper tty_port_tty_wakeup instead of tty_wakeup directly will ensure there is a valid struct tty. Fixes: 761ed4a94582ab29 ("tty: serial_core: convert uart_close to use tty_port_close") Reported-by: Borislav Petkov <[email protected]> Reported-by: Mike Galbraith <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-28tty: serial_core: Fix serial console crash on port shutdownGeert Uytterhoeven1-0/+2
The port->console flag is always false, as uart_console() is called before the serial console has been registered. Hence for a serial port used as the console, uart_tty_port_shutdown() will still be called when userspace closes the port, powering it down. This may lead to a system lock up when the serial console driver writes to the serial port's registers. To fix this, move the setting of port->console after the call to uart_configure_port(), which registers the serial console. Fixes: 761ed4a94582ab29 ("tty: serial_core: convert uart_close to use tty_port_close") Reported-by: Niklas Söderlund <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Rob Herring <[email protected]> Tested-by: Mugunthan V N <[email protected]> Tested-by: Niklas Söderlund <[email protected]> [robh: rebased on tty-linus] Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-28tty/serial: at91: fix hardware handshake on Atmel platformsRichard Genoud1-4/+22
After commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when hardware handshake is enabled"), the hardware handshake wasn't functional anymore on Atmel platforms (beside SAMA5D2). To understand why, one has to understand the flag ATMEL_US_USMODE_HWHS first: Before commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when hardware handshake is enabled"), this flag was never set. Thus, the CTS/RTS where only handled by serial_core (and everything worked just fine). This commit introduced the use of the ATMEL_US_USMODE_HWHS flag, enabling it for all boards when the user space enables flow control. When the ATMEL_US_USMODE_HWHS is set, the Atmel USART controller handles a part of the flow control job: - disable the transmitter when the CTS pin gets high. - drive the RTS pin high when the DMA buffer transfer is completed or PDC RX buffer full or RX FIFO is beyond threshold. (depending on the controller version). NB: This feature is *not* mandatory for the flow control to work. (Nevertheless, it's very useful if low latencies are needed.) Now, the specifics of the ATMEL_US_USMODE_HWHS flag: - For platforms with DMAC and no FIFOs (sam9x25, sam9x35, sama5D3, sama5D4, sam9g15, sam9g25, sam9g35)* this feature simply doesn't work. ( source: https://lkml.org/lkml/2016/9/7/598 ) Tested it on sam9g35, the RTS pins always stays up, even when RXEN=1 or a new DMA transfer descriptor is set. => ATMEL_US_USMODE_HWHS must not be used for those platforms - For platforms with a PDC (sam926{0,1,3}, sam9g10, sam9g20, sam9g45, sam9g46)*, there's another kind of problem. Once the flag ATMEL_US_USMODE_HWHS is set, the RTS pin can't be driven anymore via RTSEN/RTSDIS in USART Control Register. The RTS pin can only be driven by enabling/disabling the receiver or setting RCR=RNCR=0 in the PDC (Receive (Next) Counter Register). => Doing this is beyond the scope of this patch and could add other bugs, so the original (and working) behaviour should be set for those platforms (meaning ATMEL_US_USMODE_HWHS flag should be unset). - For platforms with a FIFO (sama5d2)*, the RTS pin is driven according to the RX FIFO thresholds, and can be also driven by RTSEN/RTSDIS in USART Control Register. No problem here. (This was the use case of commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when hardware handshake is enabled")) NB: If the CTS pin declared as a GPIO in the DTS, (for instance cts-gpios = <&pioA PIN_PB31 GPIO_ACTIVE_LOW>), the transmitter will be disabled. => ATMEL_US_USMODE_HWHS flag can be set for this platform ONLY IF the CTS pin is not a GPIO. So, the only case when ATMEL_US_USMODE_HWHS can be enabled is when (atmel_use_fifo(port) && !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS)) Tested on all Atmel USART controller flavours: AT91SAM9G35-CM (DMAC flavour), AT91SAM9G20-EK (PDC flavour), SAMA5D2xplained (FIFO flavour). * the list may not be exhaustive Cc: <[email protected]> #4.4+ (beware, missing atmel_port variable) Fixes: 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when hardware handshake is enabled") Signed-off-by: Richard Genoud <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Acked-by: Cyrille Pitchen <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-28serial: fsl_lpuart: remove build warningGreg Kroah-Hartman1-2/+0
commit 2a41bc2a2b05 ("tty: serial: fsl_lpuart: add polled console functions") caused a build warning about an unused variable, so fix it. Reported-by: kbuild test robot <[email protected]> Cc: Nicolae Rosia <[email protected]> Cc: Stefan Golinschi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27vt: clear selection before resizingScot Doyle1-0/+3
When resizing a vt its selection may exceed the new size, resulting in an invalid memory access [1]. Clear the selection before resizing. [1] http://lkml.kernel.org/r/CACT4Y+acDTwy4umEvf5ROBGiRJNrxHN4Cn5szCXE5Jw-d1B=Xw@mail.gmail.com Reported-and-tested-by: Dmitry Vyukov <[email protected]> Signed-off-by: Scot Doyle <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27sc16is7xx: always write state when configuring GPIO as an outputFrancois Berder1-2/+6
The regmap_update first reads the IOState register and then triggers a write if needed. However, GPIOS might be configured as an input so the read to IOState on this GPIO is the current state which might be random. Signed-off-by: Francois Berder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: serial: 8250: 8250_core: NXP SC16C2552 workaroundSteve Shih1-1/+2
NXP SC16C2552 requires that we always write a reset to the RX FIFO and TX FIFO whenever we enable the FIFOs Cc: [email protected] Signed-off-by: Steve Shih <[email protected]> Signed-off-by: David Singleton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: limit terminal size to 4M charsDmitry Vyukov1-0/+2
Size of kmalloc() in vc_do_resize() is controlled by user. Too large kmalloc() size triggers WARNING message on console. Put a reasonable upper bound on terminal size to prevent WARNINGs. Signed-off-by: Dmitry Vyukov <[email protected]> CC: David Rientjes <[email protected]> Cc: One Thousand Gnomes <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jiri Slaby <[email protected]> Cc: Peter Hurley <[email protected]> Cc: [email protected] Cc: [email protected] Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: serial: fsl_lpuart: Fix Tx DMA edge caseAaron Brice1-2/+1
In the case where head == 0 on the circular buffer, there should be one DMA buffer, not two. The second zero-length buffer would break the lpuart driver, transfer would never complete. Signed-off-by: Aaron Brice <[email protected]> Acked-by: Stefan Agner <[email protected]> Tested-by: Stefan Agner <[email protected]> Tested-by: Bhuvanchandra DV <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: vt, rename variables to sane namesJiri Slaby1-13/+13
This makes the code understandable at least. No functional changes. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: vt, compute vc offsets in advanceJiri Slaby1-5/+7
Only improves readability, no functional changes. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: vgacon+sisusb, move scrolldelta to a common helperJiri Slaby1-0/+38
The code is mirrorred in scrolldelta implementations of both vgacon and sisusb. Let's move the code to a separate helper where we will perform a common cleanup and further changes. While we are moving the code, make it linear and save one indentation level. This is done by returning from the "!lines" then-branch immediatelly. This allows flushing the else-branch 1 level to the left, obviously. Few more new lines and comments were added too. And do not forget to export the helper function given sisusb can be built as module. Signed-off-by: Jiri Slaby <[email protected]> Cc: Thomas Winischhofer <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: vt, unify scrolling functionsJiri Slaby1-30/+17
Both scrup and scrdown are copies of the same code except source and destination pointers computation. Unify those functions into a single one named con_scroll. Note that scrdown used step to compute the destination, while scrup did the computation explicitly. We sticked to the latter here. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27tty: vt, cleanup and document con_scrollJiri Slaby1-2/+4
Scrolling helpers scrup and scrdown both accept 'top' and 'bottom' as unsigned int. Number of lines 'nr' is accepted as int, but all callers pass down unsigned too. So change the type of 'nr' to unsigned too. Now, promote unsigned int from the helpers up to the con_scroll hook which actually accepted all those as signed int. Next, the 'dir' parameter can have only two values and we define constants for that: SM_UP and SM_DOWN. Switch them to enum and do proper type checking on 'dir' too. Finally, document the behaviour of the hook. Signed-off-by: Jiri Slaby <[email protected]> Cc: Thomas Winischhofer <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_fintek: Add F81865 SupportJi-Ze Hong (Peter Hong)1-0/+6
Fintek F81865 is a LPC to 6 UARTs SuperIO. It has less functional UARTs likes F81866. It's also need check the IRQ mode with system assigned, but the configuration is not the same with F81216 series. F81865 IRQ Mode setting: 0xf0 Bit1: IRQ_MODE0 Bit0: Share mode (always on) Level/Low: IRQ_MODE0:0 Edge/High: IRQ_MODE0:1 The following list is brief descriptions of F81865: F81865 (0704) 9Bit(not implements with mainline) RS485(implemented) Suggested-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Ji-Ze Hong (Peter Hong) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_fintek: Add F81866 SupportJi-Ze Hong (Peter Hong)1-6/+68
Fintek F81866 is a LPC to 6 UARTs SuperIO. It has fully functional UARTs likes F81216H. It's also need check the IRQ mode with system assigned, but the configuration is not the same with F81216 series. F81866 IRQ Mode setting: 0xf0 Bit1: IRQ_MODE0 Bit0: Share mode (always on) 0xf6 Bit3: IRQ_MODE1 Level/Low: IRQ_MODE0:0, IRQ_MODE1:0 Edge/High: IRQ_MODE0:1, IRQ_MODE1:0 The following list is brief descriptions of F81866: F81866 (1010) 9Bit/High baud rate(not implements with mainline) RS485, 128Bytes FIFO (implemented) Signed-off-by: Ji-Ze Hong (Peter Hong) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_fintek: Add F81216 SupportJi-Ze Hong (Peter Hong)1-2/+24
Fintek F81216 is a LPC to 4 UARTs device. It's the F81216 series but support less functional than F81216AD/F81216H The following list is brief descriptions of F81216 series: F81216H (0105) 9Bit/High baud rate(not implements with mainline) RS485, 128Bytes FIFO (implemented) F81216AD (0216) 9Bit(not implements with mainline) RS485(implemented) F81216 (0208) basically 16550A Suggested-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Ji-Ze Hong (Peter Hong) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_fintek: Set maximum FIFO of F81216HJi-Ze Hong (Peter Hong)1-3/+26
The Fintek F81216H had maximum 128Bytes FIFO, but some BIOS configurated as normal 16Bytes FIFO. This patch will set 128Bytes FIFO and trigger level multiplier as 4x when F81216H detected. Default 16550A trigger level is 8Bytes. When this patch applied, the trigger level will change to 8Byte x 4 = 32Byte. It can be reduce the RX incoming interrupts. Suggested-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Ji-Ze Hong (Peter Hong) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_fintek: Set IRQ Mode when port probedJi-Ze Hong (Peter Hong)1-23/+22
Set IRQ Mode when port probed in probe_setup_port() It should hold the IO port premission via fintek_8250_enter_key() and release via fintek_8250_exit_key() when we configure the SuperIO. This patch will move all SuperIO configure operations to probe_setup_port() to reduce fintek_8250_enter_key() and fintek_8250_exit_key() usage. Suggested-by: Ricardo Ribalda Delgado <[email protected]> Signed-off-by: Ji-Ze Hong (Peter Hong) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_fintek: Refactoring read/write methodJi-Ze Hong (Peter Hong)1-35/+38
If we need to access SuperIO registers, It should write register offset to base_addr and read/write value to base_addr + 1 to perform read/write. We can make it more simply with write/read functions. This patch add sio_read_reg()/sio_write_reg()/sio_write_mask_reg() to reduce SuperIO register operation with lot of outb()/inb(). Signed-off-by: Ji-Ze Hong (Peter Hong) <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250: pxa: add devicetree earlyconsoleRobert Jarzmik2-2/+13
Transfer the device-tree pxa uart handling from 8250_of to the new 8250_pxa. As a corollary, add the early console definition into 8250_pxa. This enables to have the same uart node for the early console and the normal uart. Signed-off-by: Robert Jarzmik <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_lpss: get IRQ via pci_irq_vector()Andy Shevchenko1-1/+1
Instead of a direct assignment use pci_irq_vector() call as it's done for the other case. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27sc16is7xx: Drop bogus use of IRQF_ONESHOTJosh Cartwright1-1/+1
The use of IRQF_ONESHOT when registering an interrupt handler with request_irq() is non-sensical. Not only that, it also prevents the handler from being threaded when it otherwise should be w/ IRQ_FORCED_THREADING is enabled. This causes the following deadlock observed by Sean Nyekjaer on -rt: Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [..] rt_spin_lock_slowlock from queue_kthread_work queue_kthread_work from sc16is7xx_irq sc16is7xx_irq [sc16is7xx] from handle_irq_event_percpu handle_irq_event_percpu from handle_irq_event handle_irq_event from handle_level_irq handle_level_irq from generic_handle_irq generic_handle_irq from mxc_gpio_irq_handler mxc_gpio_irq_handler from mx3_gpio_irq_handler mx3_gpio_irq_handler from generic_handle_irq generic_handle_irq from __handle_domain_irq __handle_domain_irq from gic_handle_irq gic_handle_irq from __irq_svc __irq_svc from rt_spin_unlock rt_spin_unlock from kthread_worker_fn kthread_worker_fn from kthread kthread from ret_from_fork Fixes: 9e6f4ca3e567 ("sc16is7xx: use kthread_worker for tx_work and irq") Reported-by: Sean Nyekjaer <[email protected]> Signed-off-by: Josh Cartwright <[email protected]> Cc: [email protected] Cc: Jakub Kicinski <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Julia Cartwright <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_lpss: Try to enable Memory-Write-InvalidateAndy Shevchenko1-0/+1
Enable MWI mechanism if PCI bus master supports it. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-27serial: 8250_lpss: set PCI master only for private DMAAndy Shevchenko1-2/+2
There is no need to set PCI bus mastering when device is not doing any DMA. Though on Intel Quark DMA is a part of UART IP and thus shares same device in Linux kernel. Enable bus mastering only for Quark case. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>