Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - about the question in devc-ser8250: (1 Item)
   
about the question in devc-ser8250  
hello,qnx:
        I am the user of QNX in china. 
        I have used QNX6.2.1 ago,and now we buy the QNX6.4.1.
        In QNX 6.2.1 ,I find a bug in devc-ser8250 source-code. And  I compare the source-code in QNX6.2.1 and QNX6.3.2 
,I find the bug have been changed, Now I want to know whether the bug had been found by you.
        The bug is :
        A value(critial source) in Time-Tick(a tiner pulse) and ISR is changed twice, and the chage can stop the data 
outing for 12.75s.
        The value is tx_timer . The value can be sub-sub-operated in the function time_tick() (if(tx_timer && --tx_timer
==0)),when the tx-interrupt be delaied for 50ms.And 50ms after, if the ISR is work ,the value can be give the value of 
zero(tx_timer=0). And  the sub-sub-operation can make the value to -1. In the io-write.c the function kick(),may judge 
the tx_timer(if(tx_timer==0)) for tto()function.
       In this case, the tto()function can not be excuted for 255*50=12.5s. The ser-device may stop to send data for 12.
5s.
       In my project ,the problem have occured in 6.2.1. But in 6.3.2 I find that the judging of if(tx_timer==0)  have 
been deleted .
      I want to ask:
      why you change the judging?
      Is my analysis right?
 
前段时间在6.2.1下调试串口通讯,遇到一个问题:串口发送会停滞大约12秒时间. 
最近拿到了部分6.2.1下的串口驱动原码,发现里面存在一个逻辑问题. 
问题主要出在里面的发送定时器(50ms)和中断服务程序会存在临界资源被修改.发送定时器的记数变量(tx_timer)在定时函数
(timer_tick)中需要判断并做减减(--)操作具体的操作为(if(tx_timer && --tx_timer==0)),而中断服务程序(isr)中会对该变量进附值
操作(tx_timer=0),这样中断服务程序就很可能在if判断的两个条件中间修改tx_timer,当中断退出时if又开始判断第二个条件(--
tx_timer==0)这个时候就会产生益出(tx_timer是char型的变量),而在数据发送函数(tto)中需要判断条件(if(tx_timer==0)),从而由于
tx_timer减到零的时间需要255*50ms=12.75s.,会导致tto函数会在12.75秒内不被执行到,从而导致串口会停止12.75秒发送数据.
但是我有查看了6.3.2的串口驱动原码,发现tto里面已经去掉这个条件(if(tx_timer==0))的判断了. 
请问QNX官方是不是在以前也发现过这个情况,从而对它进行了修改与完善? 
我的分析是不是有问题?
 
 
      //-----------Best Regards ----------------
                 your user Han Zheng-wei