AnsweredAssumed Answered

_io_serial_int_addc/nextc passing wrong ptr type to _QUEUE_GET_SIZE in MQX 3.8 - fixed in MQX 4.2?

Question asked by Gordon Finlay on Feb 10, 2016
Latest reply on Feb 18, 2016 by Gordon Finlay

I have noticed that the MQX v3.8 serl_int.c interrupt driven device driver seems to be incorrectly calculating the driver's current RX queue size when the _io_serial_int_addc function (and the _io_serial_int_nextc) functions are testing to see if the waiting task(s) should be resumed (made ready).

 

The MQX v3.8 version of the serl_int driver is passing a TASK_QUEUE_STRUCT_PTR type parameter (which does not have a size field in the structure) to the _QUEUE_GET_SIZE macro and the returned FIFO circular buffer size is incorrect. Thus the if-condition to decide if the driver should make any waiting tasks ready is incorrect.

 

      if (_QUEUE_GET_SIZE(int_io_dev_ptr->IN_WAITING_TASKS)) {

             _taskq_resume(int_io_dev_ptr->IN_WAITING_TASKS, TRUE);

      }

 

But in the MQX 4.2 version of the serl_int driver, the _io_serial_int_addc (and _io_serial_int_nextc  is correctly passing  a QUEUE_STRUCT_PTR type parameter (ptr to the the TD_QUEUE structure) which does have a size field in the structure), and the circular buffer size returned is indeed correct.

 

      if (_QUEUE_GET_SIZE(&(((TASK_QUEUE_STRUCT_PTR)(int_io_dev_ptr->IN_WAITING_TASKS))->TD_QUEUE))) {

             _taskq_resume(int_io_dev_ptr->IN_WAITING_TASKS, TRUE);

      }

 

Can someone please confirm if this was a bug fixed by Freescale somewhere along the line? If so, then was there a "MQX-nnnn" bug tracker ticket number associated with this fix. Can I also get any description of some of the symptoms of the issues related to this bug?   There was never any mention of bug fixes to the serial driver in serl_int.c in the MQX release notes, and therefore I spent some time looking for a bug before I realized that the queue size value was incorrect while stepping the the assembly code.

 

Where can I get a complete list of any other bugs fixed in serial uart device drivers (both interrupt driven and polled) or other i/o device drivers in more recent versions of MQX? It would seem that the MQX release notes are incomplete (only partial MQX tracking numberts) with respect to listing fixed issues in i/o device drivers between MQX v3.8 and v4.2. We are using v3.8.1 of MQX for a reason (compatibility with certain USB OTG and Atheros WiFi stacks), but I don't want to waste time fixing bugs that have been already addressed in more recent MQX versions.

Outcomes