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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,049 Views
gordonfinlay
Contributor I

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.

0 Kudos
Reply
1 Solution
844 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

There is a associated track number( MQX-4429, SW quality improvement.) it is fixed in MQX4.2.0,  unfortunately this is missed in released notes

The description :  MQX-4429 SW quality improvement.

The serl_int.c module checks the task queue size with the _QUEUE_GET_SIZE() MACRO.

The MACRO cast the pointer parameter to QUEUE_STRUCT_PTR to return the value of the SIZE field.

The problem is that the task queue pointer points to a different structure type (TASK_QUEUE_STRUCT_PTR)

and the QUEUE_STRUCT_PTR->SIZE field offset is the lower part of the TASK_QUEUE_STRUCT_PTR->VALID (never 0).

Due to the fact that the check of the task queue size is done internally in the task queue module and it cannot be done easily

by the caller

Regards

Daniel

View solution in original post

0 Kudos
Reply
4 Replies
845 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

There is a associated track number( MQX-4429, SW quality improvement.) it is fixed in MQX4.2.0,  unfortunately this is missed in released notes

The description :  MQX-4429 SW quality improvement.

The serl_int.c module checks the task queue size with the _QUEUE_GET_SIZE() MACRO.

The MACRO cast the pointer parameter to QUEUE_STRUCT_PTR to return the value of the SIZE field.

The problem is that the task queue pointer points to a different structure type (TASK_QUEUE_STRUCT_PTR)

and the QUEUE_STRUCT_PTR->SIZE field offset is the lower part of the TASK_QUEUE_STRUCT_PTR->VALID (never 0).

Due to the fact that the check of the task queue size is done internally in the task queue module and it cannot be done easily

by the caller

Regards

Daniel

0 Kudos
Reply
844 Views
gordonfinlay
Contributor I

Thanks Daniel. This explains the behaviour of the logic without the fix - the value returned by _QUEUE_GET_SIZE would never be 0 and the _taskq_resume would always be invoked (even if the queue was actually empty).

Are there other bug fixes or changes to the driver code (serl_int.c, serl_int_kuart.c, or serl_pol_kuart.c) between MQX 3.8 and MQX 4.2 which are not mentioned in release notes?

0 Kudos
Reply
844 Views
danielchen
NXP TechSupport
NXP TechSupport

Hello Gordon:

I suggest you submit a case for this question, please follow the following steps

1) Please visit www.nxp.com and click on "Support" on the top of the webpage.

2) Select "Sales and Support" under Support Resources session.

3) Scroll down to the bottom ,click on “hardware & Software” .

4) Register by your business email to enter NXP Community

5) Get verification email and verify your account.

6) Select "contact support" on the top and click “submit a new case” to start the process.

Regards

Daniel

0 Kudos
Reply
844 Views
gordonfinlay
Contributor I

Hi Daniel,

I will submit a case for my question as per your suggestion.

Regards,

Gordon

0 Kudos
Reply