Commit bf6239eb authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
  serial: imx.c: fix CTS trigger level lower to avoid lost chars
  tty: Fix unbalanced BKL handling in error path
  serial: mpc52xx_uart: fix null pointer dereference
parents 4462dc02 1c5250d6
...@@ -1875,6 +1875,7 @@ got_driver: ...@@ -1875,6 +1875,7 @@ got_driver:
*/ */
if (filp->f_op == &hung_up_tty_fops) if (filp->f_op == &hung_up_tty_fops)
filp->f_op = &tty_fops; filp->f_op = &tty_fops;
unlock_kernel();
goto retry_open; goto retry_open;
} }
unlock_kernel(); unlock_kernel();
......
...@@ -120,7 +120,8 @@ ...@@ -120,7 +120,8 @@
#define MX2_UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */ #define MX2_UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */
#define UCR3_INVT (1<<1) /* Inverted Infrared transmission */ #define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
#define UCR3_BPEN (1<<0) /* Preset registers enable */ #define UCR3_BPEN (1<<0) /* Preset registers enable */
#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */ #define UCR4_CTSTL_SHF 10 /* CTS trigger level shift */
#define UCR4_CTSTL_MASK 0x3F /* CTS trigger is 6 bits wide */
#define UCR4_INVR (1<<9) /* Inverted infrared reception */ #define UCR4_INVR (1<<9) /* Inverted infrared reception */
#define UCR4_ENIRI (1<<8) /* Serial infrared interrupt enable */ #define UCR4_ENIRI (1<<8) /* Serial infrared interrupt enable */
#define UCR4_WKEN (1<<7) /* Wake interrupt enable */ #define UCR4_WKEN (1<<7) /* Wake interrupt enable */
...@@ -591,6 +592,9 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode) ...@@ -591,6 +592,9 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
return 0; return 0;
} }
/* half the RX buffer size */
#define CTSTL 16
static int imx_startup(struct uart_port *port) static int imx_startup(struct uart_port *port)
{ {
struct imx_port *sport = (struct imx_port *)port; struct imx_port *sport = (struct imx_port *)port;
...@@ -607,6 +611,10 @@ static int imx_startup(struct uart_port *port) ...@@ -607,6 +611,10 @@ static int imx_startup(struct uart_port *port)
if (USE_IRDA(sport)) if (USE_IRDA(sport))
temp |= UCR4_IRSC; temp |= UCR4_IRSC;
/* set the trigger level for CTS */
temp &= ~(UCR4_CTSTL_MASK<< UCR4_CTSTL_SHF);
temp |= CTSTL<< UCR4_CTSTL_SHF;
writel(temp & ~UCR4_DREN, sport->port.membase + UCR4); writel(temp & ~UCR4_DREN, sport->port.membase + UCR4);
if (USE_IRDA(sport)) { if (USE_IRDA(sport)) {
......
...@@ -1467,7 +1467,7 @@ mpc52xx_uart_init(void) ...@@ -1467,7 +1467,7 @@ mpc52xx_uart_init(void)
/* /*
* Map the PSC FIFO Controller and init if on MPC512x. * Map the PSC FIFO Controller and init if on MPC512x.
*/ */
if (psc_ops->fifoc_init) { if (psc_ops && psc_ops->fifoc_init) {
ret = psc_ops->fifoc_init(); ret = psc_ops->fifoc_init();
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment