aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/cpm_uart
diff options
context:
space:
mode:
authorXiaotian Feng <Xiaotian.Feng@windriver.com>2009-03-05 22:01:23 -0500
committerKumar Gala <galak@kernel.crashing.org>2009-03-09 12:45:51 -0400
commit9ab921201444e4dcfd0c14ac4cc6758e32059dae (patch)
tree3985460c385c8378b3c9b9c26b2c72d612878e63 /drivers/serial/cpm_uart
parent0bcd783c1f0396b68410fdb41fbe196fbc1947af (diff)
cpm_uart: fix non-console port startup bug
After UART interrupt handler is installed and rx is enabled, if an rx interrupt comes before hardware init, rx->cur will be updated. Then the hardware init will reset BD and make rx->cur out of sync, move the hardware init code before request_irq. Signed-off-by: Xiaotian Feng <xiaotian.feng@windriver.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/serial/cpm_uart')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index bde4b4b0b80f..5c6ef51da274 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -406,6 +406,18 @@ static int cpm_uart_startup(struct uart_port *port)
406 406
407 pr_debug("CPM uart[%d]:startup\n", port->line); 407 pr_debug("CPM uart[%d]:startup\n", port->line);
408 408
409 /* If the port is not the console, make sure rx is disabled. */
410 if (!(pinfo->flags & FLAG_CONSOLE)) {
411 /* Disable UART rx */
412 if (IS_SMC(pinfo)) {
413 clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN);
414 clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX);
415 } else {
416 clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR);
417 clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
418 }
419 cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
420 }
409 /* Install interrupt handler. */ 421 /* Install interrupt handler. */
410 retval = request_irq(port->irq, cpm_uart_int, 0, "cpm_uart", port); 422 retval = request_irq(port->irq, cpm_uart_int, 0, "cpm_uart", port);
411 if (retval) 423 if (retval)
@@ -420,8 +432,6 @@ static int cpm_uart_startup(struct uart_port *port)
420 setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT)); 432 setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));
421 } 433 }
422 434
423 if (!(pinfo->flags & FLAG_CONSOLE))
424 cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
425 return 0; 435 return 0;
426} 436}
427 437