This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Ipc_start: LAD_connect() failed: 4

Hi Team,

Our customer faced ipc_start failed:4 message sometimes as below.

Ipc_start()
LAD_connect: PID = 626, fifoName = /tmp/LAD/626
fopen(responseFIFOName) Error
Ipc_start: LAD_connect() failed: 4

And they tried to change permissions based on http://processors.wiki.ti.com/index.php/IPC_3.x_FAQ#Linux_Ipc_start.28.29_Failures.

But issue is not fixed. So they tried to insert sleep(100) after executing LAD driver. This issue did not happen currently.

IPC version is 3.23.00.01 with  VIS: v1.50.12.02 .

I think somtimes LAD_driver wake up is later than RadioApp.exe.

Should we wait executing RadioApp.exe until wake up LAD_driver? 

Could you give me any idea to wait LAD_driver wake up instead of sleep? 

Best regards,

Ito

  • Which processor are you using ?
    Package details etc., ?
  • Hi Stalin,

    Thank you for your reply.

    They are using Jacinto 6 processor with GLSDK6.10.00.02 (kernel 3.02) (Library: 3.04C, VIS: v1.50.12.02 ) which is modified by XSe for customer's board. 

    And they can not keep launching timing of LAD_driver and RadioApp due to their system. So when race condition happen, launching timing of LAD driver is later than RadioApp sometime. So this problem happen.

    So they tried below things to fix this issue. but we can not fix.

    1.  LAD directory permissions. -> Not fixed.

    http://processors.wiki.ti.com/index.php/IPC_3.x_FAQ#LAD_reports_LAD_connect.28.29_failed:_4

    2.  Wait until /tmp/LAD/LADCMDS is shown in main function of RadioApp -> Not fix

    while (rc < 0){ 
                  rc = access("/tmp/LAD/LADCMDS", 0); 
                  if (rc == 0){ 
                  } 
                  else { 
                                usleep(100000); 
                  } 

    3. Add sleep(100) in main function of RadioApp -> the problem did not happen.-> It looks ok.

    But we need to correct fix. they would like to know how to handle this timing during IPC_start is called.

    I think we need to wait for a while until calling IPC_start when /tmp/LAD/LADCMDS is shown.

    Could you give me any advice?

    Best regards,

    Ito

  • Hi Stalin,

    We could wait LAD_driver is wake up with below source code.

    while (rc < 0){ 

                  rc = access("/tmp/LAD/LADCMDS", 0); 
                  if (rc == 0){ 
                  } 
                  else { 
                                usleep(100000); 
                  } 

    But we found an cause why LAD_connect() failed: 4 happens. 

    In case of customer's system.

    LAD_connect() in LAD_client.c. is using time() function. It seems time function return value is unstable. So we can not measure the exact time. then LAD_IOFAILURE failure happen.

    /* now open the dedicated response FIFO for this client */
    startTime = time ((time_t *) 0);  <-the return value is unstable.
    while ((filePtr = fopen(responseFIFOName, "r")) == NULL) {
        /* insert wait to yield, so LAD can process connect command sooner */
        usleep(100);
        currentTime = time ((time_t *) 0);  <-the return value is unstable.
        delta = difftime(currentTime, startTime);
        if (delta > LAD_CONNECTTIMEOUT) {
            pthread_mutex_unlock(&modGate);

            return(LAD_IOFAILURE);
        }
    }

    Could you give me any comment on this?

    Best regards,

    Ito

  • Our customer's framework has a problem, Sometimes time API does not return correct time. So this problem happen. So I would like to close this ticket.

    Best regards,

    Ito