MCASP_close() function is not having a graceful exit and is stuck in a for loop for very long time.

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: High

      The MCASP_close() function does not complete and is stuck in a for loop for a very long time( tested it with mcasp_loopback and mcasp_chime examples ).

      Steps to reproduce the issue -

      1. Run the mcasp_loopback example. 
      2. Place a breakpoint at CSL_lcdma_ringaccDequeue() function   [ line 808: csl_lcdma_ringacc.c ] 

      3. Run the example and halt at the breakpoint. Observe the variable (pRing->wrOcc). 

      4. The pRing->wrOcc is taking a very large value (4294967294). Due to which the loop continues for a very very long time before coming to an exit. 

      Identified source of bug

      We went through the execution sequence of the program, and found out that pRing->wrOcc is modified inside the CSL_lcdma_ringaccAckReverseRing() function [ {{{}csl_lcdma_ringacc.h{}}}, line 602]. If we examine the function we can see that it subtracts the value cnt }}from {{pRing->wrOcc [ line 623: pRing->wrOcc = (uint32_t)cnt; ]. On analysis, we found out that pRing>wrOcc had an initial value of 0 and when cnt(=1) was subtracted from pRing->wrOcc, it got modified to 4294967294 due to wrap-around in uint_32t

      [ Note - The pRing->wrOcc needs to be incremented before DMA operation start. But found out that it was not incremented, before it got decremented by the CSL_lcdma_ringaccAckReverseRing() function (line 623: csl_lcdma_ringacc.h ). 

      I also inspected the Udma_ringSetDoorBellLcdma() function ( line 300 : udma_ring_lcdma.c ) and found out that the line 300  (pRing->wrOcc += (uint32_t)count_val; ) increments the pRing->wrOcc, but at the time of increment the count_val variable takes the value 0. ]

      Udma_ringSetDoorBellLcdma

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Connection: Intermediate to External PROD System
                EXTSYNC-5298 - MCASP_close() function is not havin...
                SYNCHRONIZED
                • Last Sync Date: