Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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