From: NIIBE Y. <gn...@m1...> - 2002-09-17 01:40:17
|
There was a race at initialization of SCI. It's better to register irq earlier. 2002-09-17 NIIBE Yutaka <gn...@m1...> * drivers/char/sh-sci.c (sci_open): Call sci_request_irq before calling gs_init_port. Suggested by Yoshinori Sato. Index: drivers/char/sh-sci.c =================================================================== RCS file: /cvsroot/linuxsh/linux/drivers/char/sh-sci.c,v retrieving revision 1.1.1.1.2.3 diff -u -3 -p -r1.1.1.1.2.3 sh-sci.c --- drivers/char/sh-sci.c 28 Aug 2002 00:48:45 -0000 1.1.1.1.2.3 +++ drivers/char/sh-sci.c 17 Sep 2002 01:37:34 -0000 @@ -1005,30 +1005,30 @@ static int sci_open(struct tty_struct * port->tqueue.data = port; port->break_flag = 0; + if (port->gs.count == 1) { + MOD_INC_USE_COUNT; + + retval = sci_request_irq(port); + if (retval) { + goto failed_1; + } + } + /* * Start up serial port */ retval = gs_init_port(&port->gs); if (retval) { - goto failed_1; + goto failed_2; } port->gs.flags |= GS_ACTIVE; sci_setsignals(port, 1,1); - if (port->gs.count == 1) { - MOD_INC_USE_COUNT; - - retval = sci_request_irq(port); - if (retval) { - goto failed_2; - } - } - retval = gs_block_til_ready(port, filp); if (retval) { - goto failed_3; + goto failed_2; } if ((port->gs.count == 1) && (port->gs.flags & ASYNC_SPLIT_TERMIOS)) { @@ -1072,11 +1072,10 @@ static int sci_open(struct tty_struct * return 0; -failed_3: - sci_free_irq(port); failed_2: - MOD_DEC_USE_COUNT; + sci_free_irq(port); failed_1: + MOD_DEC_USE_COUNT; port->gs.count--; return retval; } |