Occasional fail to initiate resume by incoming call, easy workaround proposed
werner at openmoko.org
Mon Feb 9 17:00:24 CET 2009
Joerg Reisenweber wrote:
> To whom it may concern: It also seems it turned out the kernel UART driver
> written by TI doesn't correctly handle STX/ETX resp. RTS/CTS handshake in a
> by-character granularity. A nice cause for buffer overruns, if that's a
> correct observation.
Hmm, which UART driver ? RTS/CTS handshake handling in the GSM firmware
looks okay. There's an interrupt when CTS changes and the driver checks
the status of the flag set by the interrupt handler for each character.
There appears to be a potential race condition with the IO1 interrupt,
though. The interrupt is only generated if we try to send a new message
while CTS is not asserted. So I think, if we deassert CTS while the
UART buffer is full, then the next (unsolicited) message would not
generate an interrupt.
Of course, suspending with a full buffer would be an abnormal condition,
so this race probably doesn't matter in real life.
The semantics of setting io1 are a little odd. I think it would be
good to have a simpler condition, e.g.,
io1 = CTS_deasserted && tx_buffer_not_empty;
That would also avoid anomalies if there is traffic while suspending.
Finally, I think a level-triggered interrupt would also help to give
us more stable semantics.
More information about the openmoko-kernel