History

Merge tag 'tty-5.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH: "Here are some small tty/serial fixes for 5.6-rc5 Just some small serial driver fixes, and a vt core fixup, full details are: - vt fixes for issues found by syzbot - serdev fix for Apple boxes - fsl_lpuart serial driver fixes - MAINTAINER update for incorrect serial files - new device ids for 8250_exar driver - mvebu-uart fix All of these have been in linux-next with no reported issues" * tag 'tty-5.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: serial: fsl_lpuart: free IDs allocated by IDA Revert "tty: serial: fsl_lpuart: drop EARLYCON_DECLARE" serdev: Fix detection of UART devices on Apple machines. MAINTAINERS: Add missed files related to Synopsys DesignWare UART serial: 8250_exar: add support for ACCES cards tty:serial:mvebu-uart:fix a wrong return vt: selection, push sel_lock up vt: selection, push console lock down

Linus Torvalds committed 6 years ago

Commit cc432ae2 parents fd3f6cc 2b2e71f8 files · +90 −29Browse files

Unified · Split

8 files
  1. MAINTAINERS +2 −0
  2. drivers/staging/speakup/selection.c +0 −2
  3. drivers/tty/serdev/core.c +10 −0
  4. drivers/tty/serial/8250/8250_exar.c +33 −0
  5. drivers/tty/serial/fsl_lpuart.c +26 −15
  6. drivers/tty/serial/mvebu-uart.c +1 −1
  7. drivers/tty/vt/selection.c +18 −9
  8. drivers/tty/vt/vt.c +0 −2
MAINTAINERS+2−0
@@ -16080,6 +16080,8 @@ SYNOPSYS DESIGNWARE 8250 UART DRIVER · 16079 unmodified lines
16080R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>16080R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
16081S: Maintained16081S: Maintained
16082F: drivers/tty/serial/8250/8250_dw.c16082F: drivers/tty/serial/8250/8250_dw.c
16083F: drivers/tty/serial/8250/8250_dwlib.*
16084F: drivers/tty/serial/8250/8250_lpss.c
16083 16085
16084SYNOPSYS DESIGNWARE APB GPIO DRIVER16086SYNOPSYS DESIGNWARE APB GPIO DRIVER
16085M: Hoan Tran <hoan@os.amperecomputing.com>16087M: Hoan Tran <hoan@os.amperecomputing.com>
drivers/staging/speakup/selection.c+0−2
@@ -51,9 +51,7 @@ static void __speakup_set_selection(struct work_struct *work) · 50 unmodified lines
51 goto unref;51 goto unref;
52 }52 }
53 53
54 console_lock();
55 set_selection_kernel(&sel, tty);54 set_selection_kernel(&sel, tty);
56 console_unlock();
57 55
58unref:56unref:
59 tty_kref_put(tty);57 tty_kref_put(tty);
drivers/tty/serdev/core.c+10−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
18#include <linux/sched.h>18#include <linux/sched.h>
19#include <linux/serdev.h>19#include <linux/serdev.h>
20#include <linux/slab.h>20#include <linux/slab.h>
21#include <linux/platform_data/x86/apple.h>
21 22
22static bool is_registered;23static bool is_registered;
23static DEFINE_IDA(ctrl_ida);24static DEFINE_IDA(ctrl_ida);
@@ -631,6 +632,15 @@ static int acpi_serdev_check_resources(struct serdev_controller *ctrl, · 607 unmodified lines
631 if (ret)632 if (ret)
632 return ret;633 return ret;
633 634
635 /*
636 * Apple machines provide an empty resource template, so on those
637 * machines just look for immediate children with a "baud" property
638 * (from the _DSM method) instead.
639 */
640 if (!lookup.controller_handle && x86_apple_machine &&
641 !acpi_dev_get_property(adev, "baud", ACPI_TYPE_BUFFER, NULL))
642 acpi_get_parent(adev->handle, &lookup.controller_handle);
643
634 /* Make sure controller and ResourceSource handle match */644 /* Make sure controller and ResourceSource handle match */
635 if (ACPI_HANDLE(ctrl->dev.parent) != lookup.controller_handle)645 if (ACPI_HANDLE(ctrl->dev.parent) != lookup.controller_handle)
636 return -ENODEV;646 return -ENODEV;
drivers/tty/serial/8250/8250_exar.c+33−0
@@ -25,6 +25,14 @@ · 24 unmodified lines
25 25
26#include "8250.h"26#include "8250.h"
27 27
28#define PCI_DEVICE_ID_ACCES_COM_2S 0x1052
29#define PCI_DEVICE_ID_ACCES_COM_4S 0x105d
30#define PCI_DEVICE_ID_ACCES_COM_8S 0x106c
31#define PCI_DEVICE_ID_ACCES_COM232_8 0x10a8
32#define PCI_DEVICE_ID_ACCES_COM_2SM 0x10d2
33#define PCI_DEVICE_ID_ACCES_COM_4SM 0x10db
34#define PCI_DEVICE_ID_ACCES_COM_8SM 0x10ea
35
28#define PCI_DEVICE_ID_COMMTECH_4224PCI335 0x000236#define PCI_DEVICE_ID_COMMTECH_4224PCI335 0x0002
29#define PCI_DEVICE_ID_COMMTECH_4222PCI335 0x000437#define PCI_DEVICE_ID_COMMTECH_4222PCI335 0x0004
30#define PCI_DEVICE_ID_COMMTECH_2324PCI335 0x000a38#define PCI_DEVICE_ID_COMMTECH_2324PCI335 0x000a
@@ -677,6 +685,22 @@ static int __maybe_unused exar_resume(struct device *dev) · 646 unmodified lines
677 685
678static SIMPLE_DEV_PM_OPS(exar_pci_pm, exar_suspend, exar_resume);686static SIMPLE_DEV_PM_OPS(exar_pci_pm, exar_suspend, exar_resume);
679 687
688static const struct exar8250_board acces_com_2x = {
689 .num_ports = 2,
690 .setup = pci_xr17c154_setup,
691};
692
693static const struct exar8250_board acces_com_4x = {
694 .num_ports = 4,
695 .setup = pci_xr17c154_setup,
696};
697
698static const struct exar8250_board acces_com_8x = {
699 .num_ports = 8,
700 .setup = pci_xr17c154_setup,
701};
702
703
680static const struct exar8250_board pbn_fastcom335_2 = {704static const struct exar8250_board pbn_fastcom335_2 = {
681 .num_ports = 2,705 .num_ports = 2,
682 .setup = pci_fastcom335_setup,706 .setup = pci_fastcom335_setup,
@@ -745,6 +769,15 @@ static const struct exar8250_board pbn_exar_XR17V8358 = { · 62 unmodified lines
745 }769 }
746 770
747static const struct pci_device_id exar_pci_tbl[] = {771static const struct pci_device_id exar_pci_tbl[] = {
772 EXAR_DEVICE(ACCESSIO, ACCES_COM_2S, acces_com_2x),
773 EXAR_DEVICE(ACCESSIO, ACCES_COM_4S, acces_com_4x),
774 EXAR_DEVICE(ACCESSIO, ACCES_COM_8S, acces_com_8x),
775 EXAR_DEVICE(ACCESSIO, ACCES_COM232_8, acces_com_8x),
776 EXAR_DEVICE(ACCESSIO, ACCES_COM_2SM, acces_com_2x),
777 EXAR_DEVICE(ACCESSIO, ACCES_COM_4SM, acces_com_4x),
778 EXAR_DEVICE(ACCESSIO, ACCES_COM_8SM, acces_com_8x),
779
780
748 CONNECT_DEVICE(XR17C152, UART_2_232, pbn_connect),781 CONNECT_DEVICE(XR17C152, UART_2_232, pbn_connect),
749 CONNECT_DEVICE(XR17C154, UART_4_232, pbn_connect),782 CONNECT_DEVICE(XR17C154, UART_4_232, pbn_connect),
750 CONNECT_DEVICE(XR17C158, UART_8_232, pbn_connect),783 CONNECT_DEVICE(XR17C158, UART_8_232, pbn_connect),
drivers/tty/serial/fsl_lpuart.c+26−15
@@ -264,6 +264,7 @@ struct lpuart_port { · 263 unmodified lines
264 int rx_dma_rng_buf_len;264 int rx_dma_rng_buf_len;
265 unsigned int dma_tx_nents;265 unsigned int dma_tx_nents;
266 wait_queue_head_t dma_wait;266 wait_queue_head_t dma_wait;
267 bool id_allocated;
267};268};
268 269
269struct lpuart_soc_data {270struct lpuart_soc_data {
@@ -2390,6 +2391,8 @@ static int __init lpuart32_imx_early_console_setup(struct earlycon_device *devic · 2120 unmodified lines
2390OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup);2391OF_EARLYCON_DECLARE(lpuart, "fsl,vf610-lpuart", lpuart_early_console_setup);
2391OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup);2392OF_EARLYCON_DECLARE(lpuart32, "fsl,ls1021a-lpuart", lpuart32_early_console_setup);
2392OF_EARLYCON_DECLARE(lpuart32, "fsl,imx7ulp-lpuart", lpuart32_imx_early_console_setup);2393OF_EARLYCON_DECLARE(lpuart32, "fsl,imx7ulp-lpuart", lpuart32_imx_early_console_setup);
2394EARLYCON_DECLARE(lpuart, lpuart_early_console_setup);
2395EARLYCON_DECLARE(lpuart32, lpuart32_early_console_setup);
2393 2396
2394#define LPUART_CONSOLE (&lpuart_console)2397#define LPUART_CONSOLE (&lpuart_console)
2395#define LPUART32_CONSOLE (&lpuart32_console)2398#define LPUART32_CONSOLE (&lpuart32_console)
@@ -2420,19 +2423,6 @@ static int lpuart_probe(struct platform_device *pdev) · 24 unmodified lines
2420 if (!sport)2423 if (!sport)
2421 return -ENOMEM;2424 return -ENOMEM;
2422 2425
2423 ret = of_alias_get_id(np, "serial");
2424 if (ret < 0) {
2425 ret = ida_simple_get(&fsl_lpuart_ida, 0, UART_NR, GFP_KERNEL);
2426 if (ret < 0) {
2427 dev_err(&pdev->dev, "port line is full, add device failed\n");
2428 return ret;
2429 }
2430 }
2431 if (ret >= ARRAY_SIZE(lpuart_ports)) {
2432 dev_err(&pdev->dev, "serial%d out of range\n", ret);
2433 return -EINVAL;
2434 }
2435 sport->port.line = ret;
2436 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);2426 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2437 sport->port.membase = devm_ioremap_resource(&pdev->dev, res);2427 sport->port.membase = devm_ioremap_resource(&pdev->dev, res);
2438 if (IS_ERR(sport->port.membase))2428 if (IS_ERR(sport->port.membase))
@@ -2477,9 +2467,25 @@ static int lpuart_probe(struct platform_device *pdev) · 38 unmodified lines
2477 }2467 }
2478 }2468 }
2479 2469
2470 ret = of_alias_get_id(np, "serial");
2471 if (ret < 0) {
2472 ret = ida_simple_get(&fsl_lpuart_ida, 0, UART_NR, GFP_KERNEL);
2473 if (ret < 0) {
2474 dev_err(&pdev->dev, "port line is full, add device failed\n");
2475 return ret;
2476 }
2477 sport->id_allocated = true;
2478 }
2479 if (ret >= ARRAY_SIZE(lpuart_ports)) {
2480 dev_err(&pdev->dev, "serial%d out of range\n", ret);
2481 ret = -EINVAL;
2482 goto failed_out_of_range;
2483 }
2484 sport->port.line = ret;
2485
2480 ret = lpuart_enable_clks(sport);2486 ret = lpuart_enable_clks(sport);
2481 if (ret)2487 if (ret)
2482 return ret;2488 goto failed_clock_enable;
2483 sport->port.uartclk = lpuart_get_baud_clk_rate(sport);2489 sport->port.uartclk = lpuart_get_baud_clk_rate(sport);
2484 2490
2485 lpuart_ports[sport->port.line] = sport;2491 lpuart_ports[sport->port.line] = sport;
@@ -2529,6 +2535,10 @@ static int lpuart_probe(struct platform_device *pdev) · 43 unmodified lines
2529failed_attach_port:2535failed_attach_port:
2530failed_irq_request:2536failed_irq_request:
2531 lpuart_disable_clks(sport);2537 lpuart_disable_clks(sport);
2538failed_clock_enable:
2539failed_out_of_range:
2540 if (sport->id_allocated)
2541 ida_simple_remove(&fsl_lpuart_ida, sport->port.line);
2532 return ret;2542 return ret;
2533}2543}
2534 2544
@@ -2538,7 +2548,8 @@ static int lpuart_remove(struct platform_device *pdev) · 3 unmodified lines
2538 2548
2539 uart_remove_one_port(&lpuart_reg, &sport->port);2549 uart_remove_one_port(&lpuart_reg, &sport->port);
2540 2550
2541 ida_simple_remove(&fsl_lpuart_ida, sport->port.line);2551 if (sport->id_allocated)
2552 ida_simple_remove(&fsl_lpuart_ida, sport->port.line);
2542 2553
2543 lpuart_disable_clks(sport);2554 lpuart_disable_clks(sport);
2544 2555
drivers/tty/serial/mvebu-uart.c+1−1
@@ -851,7 +851,7 @@ static int mvebu_uart_probe(struct platform_device *pdev) · 850 unmodified lines
851 851
852 port->membase = devm_ioremap_resource(&pdev->dev, reg);852 port->membase = devm_ioremap_resource(&pdev->dev, reg);
853 if (IS_ERR(port->membase))853 if (IS_ERR(port->membase))
854 return -PTR_ERR(port->membase);854 return PTR_ERR(port->membase);
855 855
856 mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart),856 mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart),
857 GFP_KERNEL);857 GFP_KERNEL);
drivers/tty/vt/selection.c+18−9
@@ -181,7 +181,7 @@ int set_selection_user(const struct tiocl_selection __user *sel, · 180 unmodified lines
181 return set_selection_kernel(&v, tty);181 return set_selection_kernel(&v, tty);
182}182}
183 183
184int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty)184static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty)
185{185{
186 struct vc_data *vc = vc_cons[fg_console].d;186 struct vc_data *vc = vc_cons[fg_console].d;
187 int new_sel_start, new_sel_end, spc;187 int new_sel_start, new_sel_end, spc;
@@ -214,7 +214,6 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 26 unmodified lines
214 if (ps > pe) /* make sel_start <= sel_end */214 if (ps > pe) /* make sel_start <= sel_end */
215 swap(ps, pe);215 swap(ps, pe);
216 216
217 mutex_lock(&sel_lock);
218 if (sel_cons != vc_cons[fg_console].d) {217 if (sel_cons != vc_cons[fg_console].d) {
219 clear_selection();218 clear_selection();
220 sel_cons = vc_cons[fg_console].d;219 sel_cons = vc_cons[fg_console].d;
@@ -260,10 +259,9 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 39 unmodified lines
260 break;259 break;
261 case TIOCL_SELPOINTER:260 case TIOCL_SELPOINTER:
262 highlight_pointer(pe);261 highlight_pointer(pe);
263 goto unlock;262 return 0;
264 default:263 default:
265 ret = -EINVAL;264 return -EINVAL;
266 goto unlock;
267 }265 }
268 266
269 /* remove the pointer */267 /* remove the pointer */
@@ -285,7 +283,7 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 15 unmodified lines
285 else if (new_sel_start == sel_start)283 else if (new_sel_start == sel_start)
286 {284 {
287 if (new_sel_end == sel_end) /* no action required */285 if (new_sel_end == sel_end) /* no action required */
288 goto unlock;286 return 0;
289 else if (new_sel_end > sel_end) /* extend to right */287 else if (new_sel_end > sel_end) /* extend to right */
290 highlight(sel_end + 2, new_sel_end);288 highlight(sel_end + 2, new_sel_end);
291 else /* contract from right */289 else /* contract from right */
@@ -313,8 +311,7 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 21 unmodified lines
313 if (!bp) {311 if (!bp) {
314 printk(KERN_WARNING "selection: kmalloc() failed\n");312 printk(KERN_WARNING "selection: kmalloc() failed\n");
315 clear_selection();313 clear_selection();
316 ret = -ENOMEM;314 return -ENOMEM;
317 goto unlock;
318 }315 }
319 kfree(sel_buffer);316 kfree(sel_buffer);
320 sel_buffer = bp;317 sel_buffer = bp;
@@ -339,8 +336,20 @@ int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty) · 18 unmodified lines
339 }336 }
340 }337 }
341 sel_buffer_lth = bp - sel_buffer;338 sel_buffer_lth = bp - sel_buffer;
342unlock:339
340 return ret;
341}
342
343int set_selection_kernel(struct tiocl_selection *v, struct tty_struct *tty)
344{
345 int ret;
346
347 mutex_lock(&sel_lock);
348 console_lock();
349 ret = __set_selection_kernel(v, tty);
350 console_unlock();
343 mutex_unlock(&sel_lock);351 mutex_unlock(&sel_lock);
352
344 return ret;353 return ret;
345}354}
346EXPORT_SYMBOL_GPL(set_selection_kernel);355EXPORT_SYMBOL_GPL(set_selection_kernel);
drivers/tty/vt/vt.c+0−2
@@ -3046,10 +3046,8 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) · 3045 unmodified lines
3046 switch (type)3046 switch (type)
3047 {3047 {
3048 case TIOCL_SETSEL:3048 case TIOCL_SETSEL:
3049 console_lock();
3050 ret = set_selection_user((struct tiocl_selection3049 ret = set_selection_user((struct tiocl_selection
3051 __user *)(p+1), tty);3050 __user *)(p+1), tty);
3052 console_unlock();
3053 break;3051 break;
3054 case TIOCL_PASTESEL:3052 case TIOCL_PASTESEL:
3055 ret = paste_selection(tty);3053 ret = paste_selection(tty);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t