Skip to contentSkip to conversation

uart_cpm scc Rx problem after second open of the device

PATCH Alexandros Kostopoulos 2 participants 2 messages Aug 28, 2006

lore
Share & tools
lore
#0 lore raw

I experienced a problem with the cpm_uart scc driver (kernel version =

2.6.13) while running the driver for a serial port NOT configured as a =

console.
The problem is as follows:
The first time the device (/dev/ttyCPM0) is opened, everything works ok.=
=

The second time, however, the device is opened, receive does not work. T= he =

device can only transmit, but doesn't receive anything.

Well, by looking into the code, I found out that the ENR (Receiver enabl=
e) =

bit of the GSMR-L register is only set in cpm_uart_init_scc and NOT in cpm_uart_startup, as I think it should. Then, the bit is cleared on =

cpm_uart_shutdown. Thus, the first time the device is opened, the bit is=
=

set (and so, the device normally receives data), but the second time the=
=

device is opened, the bit is NOT set and the device cannot receive =

anything from the serial port.

The diff of my code against the original 2.6.13 code follows (although i=
=

saw that the 2.6.17 code is exactly the same as far as the ENR bit is concerned):

Index: cpm_uart_core.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

cpm_uart_core.c (revision 105) renamed from cpm_uart_core.c (revision 79) +1 -0
@@ -393,6 +393,7 @@
                pinfo->smcp->smc_smcm |=3D SMCM_RX;
                pinfo->smcp->smc_smcmr |=3D SMCMR_REN;
        } else {
+        pinfo->sccp->scc_gsmrl |=3D (SCC_GSMRL_ENR);
                pinfo->sccp->scc_sccm |=3D UART_SCCM_RX;
        }
 

Am I missing something here?

Thanks for any comments,
Alex.

#1 lore raw
Quoted 8 lines · On Mon, 28 Aug 2006 17:04:16 +0300 "Alexandros Kostopoulos"…

I experienced a problem with the cpm_uart scc driver (kernel version 2.6.13) while running the driver for a serial port NOT configured as a console.
The problem is as follows:
The first time the device (/dev/ttyCPM0) is opened, everything works ok. The second time, however, the device is opened, receive does not work. The device can only transmit, but doesn't receive anything.

I'm recalling to fix it a while ago (later than .14 though). There were not just the line below, but you cant find the respective stuff on the line (linuxppc-embedded) archive/ kernel git.

Signature · 2 lines
Sincerely, 
Vitaly