linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CPM_UART: Fix non-console transmit
@ 2006-10-19 12:52 Kalle Pokki
  2006-10-31 15:08 ` Vitaly Bordug
  0 siblings, 1 reply; 10+ messages in thread
From: Kalle Pokki @ 2006-10-19 12:52 UTC (permalink / raw)
  To: linuxppc-embedded

The SMC and SCC hardware transmitter is enabled at the wrong
place. Simply writing twice to the non-console port, like

$ echo asdf > /dev/ttyCPM1
$ echo asdf > /dev/ttyCPM1

puts the shell into endless uninterruptible sleep, since the
transmitter is stopped after the first write, and is not enabled
before the shutdown function of the second write. Thus the transmit
buffers are never emptied.

Signed-off-by: Kalle Pokki <kalle.pokki@iki.fi>
---
  drivers/serial/cpm_uart/cpm_uart_core.c |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 90ff96e..8f3b3e5 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -194,10 +194,8 @@ static void cpm_uart_start_tx(struct uar
  	if (cpm_uart_tx_pump(port) != 0) {
  		if (IS_SMC(pinfo)) {
  			smcp->smc_smcm |= SMCM_TX;
-			smcp->smc_smcmr |= SMCMR_TEN;
  		} else {
  			sccp->scc_sccm |= UART_SCCM_TX;
-			pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT;
  		}
  	}
  }
@@ -420,9 +418,10 @@ static int cpm_uart_startup(struct uart_
  	/* Startup rx-int */
  	if (IS_SMC(pinfo)) {
  		pinfo->smcp->smc_smcm |= SMCM_RX;
-		pinfo->smcp->smc_smcmr |= SMCMR_REN;
+		pinfo->smcp->smc_smcmr |= (SMCMR_REN | SMCMR_TEN);
  	} else {
  		pinfo->sccp->scc_sccm |= UART_SCCM_RX;
+		pinfo->sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  	}

  	if (!(pinfo->flags & FLAG_CONSOLE))
-- 
1.4.1.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Re: [PATCH] CPM_UART: Fix non-console transmit
@ 2006-10-19 16:05 Boris Shteinbock
  2006-10-19 19:07 ` Kalle Pokki
  0 siblings, 1 reply; 10+ messages in thread
From: Boris Shteinbock @ 2006-10-19 16:05 UTC (permalink / raw)
  To: linuxppc-embedded

Kalle.

After applying your patch,
the transmission doesn't take place at all..
just hanging in write...
at least it is possible to exit the program.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH] CPM_UART: Fix non-console transmit
@ 2006-10-19 12:25 kalle.pokki
  2006-10-19 19:28 ` Vitaly Bordug
  0 siblings, 1 reply; 10+ messages in thread
From: kalle.pokki @ 2006-10-19 12:25 UTC (permalink / raw)
  To: linuxppc-embedded, galak, panto, vbordug

The SMC and SCC hardware transmitter is enabled at the wrong
place. Simply writing twice to the non-console port, like

$ echo asdf > /dev/ttyCPM1
$ echo asdf > /dev/ttyCPM1

puts the shell into endless uninterruptible sleep, since the
transmitter is stopped after the first write, and is not enabled
before the shutdown function of the second write. Thus the transmit
buffers are never emptied.

Signed-off-by: Kalle Pokki <kalle.pokki@iki.fi>
---
  drivers/serial/cpm_uart/cpm_uart_core.c |    5 ++---
  1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 90ff96e..8f3b3e5 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -194,10 +194,8 @@ static void cpm_uart_start_tx(struct uar
  	if (cpm_uart_tx_pump(port) != 0) {
  		if (IS_SMC(pinfo)) {
  			smcp->smc_smcm |= SMCM_TX;
-			smcp->smc_smcmr |= SMCMR_TEN;
  		} else {
  			sccp->scc_sccm |= UART_SCCM_TX;
-			pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT;
  		}
  	}
  }
@@ -420,9 +418,10 @@ static int cpm_uart_startup(struct uart_
  	/* Startup rx-int */
  	if (IS_SMC(pinfo)) {
  		pinfo->smcp->smc_smcm |= SMCM_RX;
-		pinfo->smcp->smc_smcmr |= SMCMR_REN;
+		pinfo->smcp->smc_smcmr |= (SMCMR_REN | SMCMR_TEN);
  	} else {
  		pinfo->sccp->scc_sccm |= UART_SCCM_RX;
+		pinfo->sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
  	}

  	if (!(pinfo->flags & FLAG_CONSOLE))
-- 
1.4.1.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-11-01  7:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-19 12:52 [PATCH] CPM_UART: Fix non-console transmit Kalle Pokki
2006-10-31 15:08 ` Vitaly Bordug
2006-11-01  3:35   ` Paul Mackerras
2006-11-01  7:52     ` Kalle Pokki
  -- strict thread matches above, loose matches on Subject: below --
2006-10-19 16:05 Boris Shteinbock
2006-10-19 19:07 ` Kalle Pokki
2006-10-31 10:24   ` Laurent Pinchart
2006-10-31 11:52     ` Kalle Pokki
2006-10-19 12:25 kalle.pokki
2006-10-19 19:28 ` Vitaly Bordug

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).