From f0a3a1538d57dfb51c73d012cbb72f985cd419aa Mon Sep 17 00:00:00 2001 From: Ken Kawasaki Date: Fri, 1 May 2009 19:21:26 -0700 Subject: 3c589_cs: add cis(firmware) of 3Com multifunction pcmcia card 3c589_cs,3c574_cs,serial_cs: (1)add cis(firmware) of 3Com lan&modem mulitifunction pcmcia card. (2)load correct configuration register for 3Com card Signed-off-by: Ken Kawasaki Signed-off-by: David S. Miller --- drivers/serial/serial_cs.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 7546aa887fa..79c9c5f5cdb 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c @@ -681,7 +681,7 @@ static int serial_config(struct pcmcia_device * link) u_char *buf; cisparse_t *parse; cistpl_cftable_entry_t *cf; - int i; + int i, last_ret, last_fn; DEBUG(0, "serial_config(0x%p)\n", link); @@ -699,6 +699,16 @@ static int serial_config(struct pcmcia_device * link) tuple->TupleDataMax = 255; tuple->Attributes = 0; + /* Get configuration register information */ + tuple->DesiredTuple = CISTPL_CONFIG; + last_ret = first_tuple(link, tuple, parse); + if (last_ret != 0) { + last_fn = ParseTuple; + goto cs_failed; + } + link->conf.ConfigBase = parse->config.base; + link->conf.Present = parse->config.rmask[0]; + /* Is this a compliant multifunction card? */ tuple->DesiredTuple = CISTPL_LONGLINK_MFC; tuple->Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK; @@ -761,7 +771,9 @@ static int serial_config(struct pcmcia_device * link) kfree(cfg_mem); return 0; - failed: +cs_failed: + cs_error(link, last_fn, last_ret); +failed: serial_remove(link); kfree(cfg_mem); return -ENODEV; @@ -863,10 +875,10 @@ static struct pcmcia_device_id serial_ids[] = { PCMCIA_PFC_DEVICE_CIS_PROD_ID12(1, "LINKSYS", "PCMLM28", 0xf7cb0b07, 0x66881874, "PCMLM28.cis"), PCMCIA_MFC_DEVICE_CIS_PROD_ID12(1, "DAYNA COMMUNICATIONS", "LAN AND MODEM MULTIFUNCTION", 0x8fdf8f89, 0xdd5ed9e8, "DP83903.cis"), PCMCIA_MFC_DEVICE_CIS_PROD_ID4(1, "NSC MF LAN/Modem", 0x58fc6056, "DP83903.cis"), - PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0556, "3CCFEM556.cis"), + PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0556, "cis/3CCFEM556.cis"), PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0175, 0x0000, "DP83903.cis"), - PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0035, "3CXEM556.cis"), - PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x003d, "3CXEM556.cis"), + PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0035, "cis/3CXEM556.cis"), + PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x003d, "cis/3CXEM556.cis"), PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC850", 0xd85f6206, 0x42a2c018, "SW_8xx_SER.cis"), /* Sierra Wireless AC850 3G Network Adapter R1 */ PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0x0710, "SW_7xx_SER.cis"), /* Sierra Wireless AC710/AC750 GPRS Network Adapter R1 */ PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */ -- cgit v1.2.3-18-g5258 From 0ccad87012c6c2e7446e4dc0f0894cf182a5270a Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Tue, 16 Jun 2009 17:02:03 +0100 Subject: atmel_serial: fix hang in set_termios when crtscts is enabled After enabling hardware flow control, any subsequent termios call may hang waiting for the transmitter to drain. This appears to be caused by a busy-loop in set_termios() waiting for the transmitter to become empty, which may take a very long time (or hang indefinitely) if the device at the other end is blocking us. A quick look through the tty and serial_core code indicates that any necessary flushing (which is optional) has already been done at this point, so there's no need for the driver to flush the transmitter on its own. Fix it by removing the busy-loop altogether. Tested-by: Eirik Aanonsen Signed-off-by: Haavard Skinnemoen Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/serial/atmel_serial.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index b3497d7e535..338b15c0a54 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c @@ -1104,11 +1104,13 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, /* update the per-port timeout */ uart_update_timeout(port, termios->c_cflag, baud); - /* save/disable interrupts and drain transmitter */ + /* + * save/disable interrupts. The tty layer will ensure that the + * transmitter is empty if requested by the caller, so there's + * no need to wait for it here. + */ imr = UART_GET_IMR(port); UART_PUT_IDR(port, -1); - while (!(UART_GET_CSR(port) & ATMEL_US_TXEMPTY)) - cpu_relax(); /* disable receiver and transmitter */ UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS); -- cgit v1.2.3-18-g5258 From 1a2c4b3147ac0645605d6def2855478861d9361b Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 16 Jun 2009 17:02:15 +0100 Subject: imx: Check for NULL pointer deref before calling tty_encode_baud_rate Signed-off-by: Sascha Hauer Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- drivers/serial/imx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 285b414f305..5d7b58f1fe4 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c @@ -924,11 +924,13 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, rational_best_approximation(16 * div * baud, sport->port.uartclk, 1 << 16, 1 << 16, &num, &denom); - tdiv64 = sport->port.uartclk; - tdiv64 *= num; - do_div(tdiv64, denom * 16 * div); - tty_encode_baud_rate(sport->port.info->port.tty, - (speed_t)tdiv64, (speed_t)tdiv64); + if (port->info && port->info->port.tty) { + tdiv64 = sport->port.uartclk; + tdiv64 *= num; + do_div(tdiv64, denom * 16 * div); + tty_encode_baud_rate(sport->port.info->port.tty, + (speed_t)tdiv64, (speed_t)tdiv64); + } num -= 1; denom -= 1; -- cgit v1.2.3-18-g5258