[PATCH] CPM_UART: Fix non-console transmit

Vitaly Bordug vbordug at ru.mvista.com
Fri Oct 20 05:28:03 EST 2006


On Thu, 19 Oct 2006 15:25:55 +0300 (EEST)
kalle.pokki at iki.fi wrote:

> 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.
> 
Was about to Ack, but... need one more glance at it on hw. 
I recall something that might be reason of the current implementation,
but had no chance to recover the details.

Thanks for the input. I'll follow-up tomorrow.

> Signed-off-by: Kalle Pokki <kalle.pokki at 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))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20061019/c8bc8e42/attachment.pgp 


More information about the Linuxppc-embedded mailing list