Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Serial driver write (TX) blocked: io-char bug?: (2 Items)
   
Serial driver write (TX) blocked: io-char bug?  
I've a QNX 6.5 system running on a mpc5121 board with up to 12 serial lines
(RS232/RS485/RS422).
When some line errors are detected (parity/framing error), write (tx) will be
completly blocked.

Here the log of errors:
Jun 10 09:42:49    3     6     0 io-char: Framing error on /dev/ser10
Jun 15 14:48:17    3     6     0 io-char: Parity error on /dev/ser10
Jun 15 14:48:17    3     6     0 io-char: Parity error on /dev/ser10

Calling tcflow(fd, TCOON) not work as expected: tx still blocked.

Trying to recovery, the application's close and re open the port, but with no
effect on tx: the only way to unblock it is to cause a parameter programming
change.

I've placed some message logs in the serial driver and I've discovered that
the io-char library sets a flag(OHW_PAGED) and the tx will be blocked after
sending one char. After that, no one seems to care about this situation and
as a result it will be impossible to transmit data again:

flags=0x191000: TIMER_ACTIVE,LOSES_TX_INTS, EDIT_INSERT, OHW_PAGED
flags=0x1D1000: TIMER_ACTIVE, OBAND_DATA, LOSES_TX_INTS, EDIT_INSERT, OHW_PAGED

I've tested the condition using ohwflow enabled and ohflow disabled, with
same results:
when some errors are detected the tx is blocked forever.
If a tcdrain() is called after a write, it will never exit and if the process
is terminated (by kill), I will see a lot of drain_check() calling also if the
process that has opened the port has been killed.

Reading oband data:
	devctl( fd, DCMD_CHR_GETOBAND,&oband, sizeof(oband), NULL);
give me as a result: oband(0x60)= _OBAND_SER_MS | _OBAND_SER_RESUME
I was expecting an _OBAND_SER_PE | _OBAND_SER_FE instead... I suspect some
endian mismatch between io-char and devc-xxxx driver here because 0x06 is
a much resonable value (_OBAND_SER_PE | _OBAND_SER_FE ).
I've access to serial driver sources but not io-char sources so I cannot 
check them to confirms my suspect.

Questions:
- Is such io-char library behavior correct?
- How can I recovery such situation? I do not whant to re-program serial
  line every time I've one error.


thanks 
M. Sangalli
Re: Serial driver write (TX) blocked: io-char bug?  
Trouble on reading  oband data is a bug in original Qnx bsp devc driver: data saved in tty.oband_data
do not match with the 'stadard' format of  tty.oband_data flags.

Tx is still blocked: 
my question is why/when io-char will asset the tty.flags(OHW_PAGED/OSW_PAGED  and
tty.xflags.OSW_PAGED_OVERRIDE ?
There is a way to avoid such bheavior o a work around to resume tx?
Thanks
M. Sangalli