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

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

Pull tty/serial fixes from Greg Kroah-Hartman:
"Here are some tty/serial driver fixes for 3.9

We finally mute the annoying WARN_ON that lots of people are hitting
and it turns out isn't needed anymore. Also add a few new device ids
and a some other minor fixes."

* tag 'tty-3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: serial: fix typo "SERIAL_S3C2412"
serial: 8250: Keep 8250.<xxxx> module options functional after driver rename
tty: serial: fix typo "ARCH_S5P6450"
tty/8250_pnp: serial port detection regression since v3.7
serial: bcm63xx_uart: fix compilation after "TTY: switch tty_insert_flip_char"
serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller
Fix 4 port and add support for 8 port 'Unknown' PCI serial port cards
tty/serial: Add support for Altera serial port
tty: serial: vt8500: Unneccessary duplicated clock code removed
tty: serial: mpc5xxx: fix PSC clock name bug
TTY: disable debugging warning

+91 -33
+3
Documentation/devicetree/bindings/tty/serial/of-serial.txt
··· 11 11 - "nvidia,tegra20-uart" 12 12 - "nxp,lpc3220-uart" 13 13 - "ibm,qpace-nwp-serial" 14 + - "altr,16550-FIFO32" 15 + - "altr,16550-FIFO64" 16 + - "altr,16550-FIFO128" 14 17 - "serial" if the port type is unknown. 15 18 - reg : offset and length of the register set for the device. 16 19 - interrupts : should contain uart interrupt.
+51 -1
drivers/tty/serial/8250/8250.c
··· 301 301 }, 302 302 [PORT_8250_CIR] = { 303 303 .name = "CIR port" 304 - } 304 + }, 305 + [PORT_ALTR_16550_F32] = { 306 + .name = "Altera 16550 FIFO32", 307 + .fifo_size = 32, 308 + .tx_loadsz = 32, 309 + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, 310 + .flags = UART_CAP_FIFO | UART_CAP_AFE, 311 + }, 312 + [PORT_ALTR_16550_F64] = { 313 + .name = "Altera 16550 FIFO64", 314 + .fifo_size = 64, 315 + .tx_loadsz = 64, 316 + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, 317 + .flags = UART_CAP_FIFO | UART_CAP_AFE, 318 + }, 319 + [PORT_ALTR_16550_F128] = { 320 + .name = "Altera 16550 FIFO128", 321 + .fifo_size = 128, 322 + .tx_loadsz = 128, 323 + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, 324 + .flags = UART_CAP_FIFO | UART_CAP_AFE, 325 + }, 305 326 }; 306 327 307 328 /* Uart divisor latch read */ ··· 3417 3396 MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA"); 3418 3397 #endif 3419 3398 MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR); 3399 + 3400 + #ifndef MODULE 3401 + /* This module was renamed to 8250_core in 3.7. Keep the old "8250" name 3402 + * working as well for the module options so we don't break people. We 3403 + * need to keep the names identical and the convenient macros will happily 3404 + * refuse to let us do that by failing the build with redefinition errors 3405 + * of global variables. So we stick them inside a dummy function to avoid 3406 + * those conflicts. The options still get parsed, and the redefined 3407 + * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive. 3408 + * 3409 + * This is hacky. I'm sorry. 3410 + */ 3411 + static void __used s8250_options(void) 3412 + { 3413 + #undef MODULE_PARAM_PREFIX 3414 + #define MODULE_PARAM_PREFIX "8250." 3415 + 3416 + module_param_cb(share_irqs, &param_ops_uint, &share_irqs, 0644); 3417 + module_param_cb(nr_uarts, &param_ops_uint, &nr_uarts, 0644); 3418 + module_param_cb(skip_txen_test, &param_ops_uint, &skip_txen_test, 0644); 3419 + #ifdef CONFIG_SERIAL_8250_RSA 3420 + __module_param_call(MODULE_PARAM_PREFIX, probe_rsa, 3421 + &param_array_ops, .arr = &__param_arr_probe_rsa, 3422 + 0444, -1); 3423 + #endif 3424 + } 3425 + #else 3426 + MODULE_ALIAS("8250"); 3427 + #endif
+11 -10
drivers/tty/serial/8250/8250_pci.c
··· 1571 1571 1572 1572 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ 1573 1573 #define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584 1574 + #define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588 1574 1575 1575 1576 /* 1576 1577 * Master list of serial port init/setup/exit quirks. ··· 1847 1846 .device = PCI_DEVICE_ID_PLX_9050, 1848 1847 .subvendor = PCI_SUBVENDOR_ID_KEYSPAN, 1849 1848 .subdevice = PCI_SUBDEVICE_ID_KEYSPAN_SX2, 1850 - .init = pci_plx9050_init, 1851 - .setup = pci_default_setup, 1852 - .exit = pci_plx9050_exit, 1853 - }, 1854 - { 1855 - .vendor = PCI_VENDOR_ID_PLX, 1856 - .device = PCI_DEVICE_ID_PLX_9050, 1857 - .subvendor = PCI_VENDOR_ID_PLX, 1858 - .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 1859 1849 .init = pci_plx9050_init, 1860 1850 .setup = pci_default_setup, 1861 1851 .exit = pci_plx9050_exit, ··· 3725 3733 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, 3726 3734 PCI_VENDOR_ID_PLX, 3727 3735 PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0, 3728 - pbn_b0_4_115200 }, 3736 + pbn_b2_4_115200 }, 3737 + /* Unknown card - subdevice 0x1588 */ 3738 + { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, 3739 + PCI_VENDOR_ID_PLX, 3740 + PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0, 3741 + pbn_b2_8_115200 }, 3729 3742 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, 3730 3743 PCI_SUBVENDOR_ID_KEYSPAN, 3731 3744 PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0, ··· 4786 4789 4787 4790 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835, 4788 4791 PCI_VENDOR_ID_IBM, 0x0299, 4792 + 0, 0, pbn_b0_bt_2_115200 }, 4793 + 4794 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835, 4795 + 0x1000, 0x0012, 4789 4796 0, 0, pbn_b0_bt_2_115200 }, 4790 4797 4791 4798 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
+7 -5
drivers/tty/serial/8250/8250_pnp.c
··· 429 429 { 430 430 struct uart_8250_port uart; 431 431 int ret, line, flags = dev_id->driver_data; 432 + struct resource *res = NULL; 432 433 433 434 if (flags & UNKNOWN_DEV) { 434 435 ret = serial_pnp_guess_board(dev); ··· 440 439 memset(&uart, 0, sizeof(uart)); 441 440 if (pnp_irq_valid(dev, 0)) 442 441 uart.port.irq = pnp_irq(dev, 0); 443 - if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { 444 - uart.port.iobase = pnp_port_start(dev, 2); 445 - uart.port.iotype = UPIO_PORT; 446 - } else if (pnp_port_valid(dev, 0)) { 447 - uart.port.iobase = pnp_port_start(dev, 0); 442 + if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) 443 + res = pnp_get_resource(dev, IORESOURCE_IO, 2); 444 + else if (pnp_port_valid(dev, 0)) 445 + res = pnp_get_resource(dev, IORESOURCE_IO, 0); 446 + if (pnp_resource_enabled(res)) { 447 + uart.port.iobase = res->start; 448 448 uart.port.iotype = UPIO_PORT; 449 449 } else if (pnp_mem_valid(dev, 0)) { 450 450 uart.port.mapbase = pnp_mem_start(dev, 0);
+2 -2
drivers/tty/serial/Kconfig
··· 211 211 config SERIAL_SAMSUNG_UARTS_4 212 212 bool 213 213 depends on PLAT_SAMSUNG 214 - default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442) 214 + default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442) 215 215 help 216 216 Internal node for the common case of 4 Samsung compatible UARTs 217 217 218 218 config SERIAL_SAMSUNG_UARTS 219 219 int 220 220 depends on PLAT_SAMSUNG 221 - default 6 if ARCH_S5P6450 221 + default 6 if CPU_S5P6450 222 222 default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416 223 223 default 3 224 224 help
+4 -4
drivers/tty/serial/bcm63xx_uart.c
··· 235 235 */ 236 236 static void bcm_uart_do_rx(struct uart_port *port) 237 237 { 238 - struct tty_port *port = &port->state->port; 238 + struct tty_port *tty_port = &port->state->port; 239 239 unsigned int max_count; 240 240 241 241 /* limit number of char read in interrupt, should not be ··· 260 260 bcm_uart_writel(port, val, UART_CTL_REG); 261 261 262 262 port->icount.overrun++; 263 - tty_insert_flip_char(port, 0, TTY_OVERRUN); 263 + tty_insert_flip_char(tty_port, 0, TTY_OVERRUN); 264 264 } 265 265 266 266 if (!(iestat & UART_IR_STAT(UART_IR_RXNOTEMPTY))) ··· 299 299 300 300 301 301 if ((cstat & port->ignore_status_mask) == 0) 302 - tty_insert_flip_char(port, c, flag); 302 + tty_insert_flip_char(tty_port, c, flag); 303 303 304 304 } while (--max_count); 305 305 306 - tty_flip_buffer_push(port); 306 + tty_flip_buffer_push(tty_port); 307 307 } 308 308 309 309 /*
+1 -1
drivers/tty/serial/mpc52xx_uart.c
··· 550 550 return 0; 551 551 552 552 psc_num = (port->mapbase & 0xf00) >> 8; 553 - snprintf(clk_name, sizeof(clk_name), "psc%d_clk", psc_num); 553 + snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num); 554 554 psc_clk = clk_get(port->dev, clk_name); 555 555 if (IS_ERR(psc_clk)) { 556 556 dev_err(port->dev, "Failed to get PSC clock entry!\n");
+6
drivers/tty/serial/of_serial.c
··· 241 241 { .compatible = "ns16850", .data = (void *)PORT_16850, }, 242 242 { .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, }, 243 243 { .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, }, 244 + { .compatible = "altr,16550-FIFO32", 245 + .data = (void *)PORT_ALTR_16550_F32, }, 246 + { .compatible = "altr,16550-FIFO64", 247 + .data = (void *)PORT_ALTR_16550_F64, }, 248 + { .compatible = "altr,16550-FIFO128", 249 + .data = (void *)PORT_ALTR_16550_F128, }, 244 250 #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL 245 251 { .compatible = "ibm,qpace-nwp-serial", 246 252 .data = (void *)PORT_NWPSERIAL, },
+1 -8
drivers/tty/serial/vt8500_serial.c
··· 611 611 vt8500_port->uart.dev = &pdev->dev; 612 612 vt8500_port->uart.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF; 613 613 614 - vt8500_port->clk = of_clk_get(pdev->dev.of_node, 0); 615 - if (!IS_ERR(vt8500_port->clk)) { 616 - vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk); 617 - } else { 618 - /* use the default of 24Mhz if not specified and warn */ 619 - pr_warn("%s: serial clock source not specified\n", __func__); 620 - vt8500_port->uart.uartclk = 24000000; 621 - } 614 + vt8500_port->uart.uartclk = clk_get_rate(vt8500_port->clk); 622 615 623 616 snprintf(vt8500_port->name, sizeof(vt8500_port->name), 624 617 "VT8500 UART%d", pdev->id);
+1 -1
drivers/tty/tty_buffer.c
··· 425 425 struct tty_ldisc *disc; 426 426 427 427 tty = port->itty; 428 - if (WARN_RATELIMIT(tty == NULL, "tty is NULL\n")) 428 + if (tty == NULL) 429 429 return; 430 430 431 431 disc = tty_ldisc_ref(tty);
+4 -1
include/uapi/linux/serial_core.h
··· 51 51 #define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ 52 52 #define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */ 53 53 #define PORT_BRCM_TRUMANAGE 25 54 - #define PORT_MAX_8250 25 /* max port ID */ 54 + #define PORT_ALTR_16550_F32 26 /* Altera 16550 UART with 32 FIFOs */ 55 + #define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */ 56 + #define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */ 57 + #define PORT_MAX_8250 28 /* max port ID */ 55 58 56 59 /* 57 60 * ARM specific type numbers. These are not currently guaranteed