RPMessage_enqueMsg() handles incoming messages twice, first queue is ignored.

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: High
    • MCAL
    • MCAL-28234
    • Hide
      MCUSW_J7_10.00.00
      MCUSW_J7_10.01.00
      Show
      MCUSW_J7_10.00.00 MCUSW_J7_10.01.00
    • MCUSW_J7_11.01.00
    • Hide
      j7200-evm
      j721e-evm
      j721s2-evm
      j722s-evm
      j742s2-evm
      j784s4-evm
      Show
      j7200-evm j721e-evm j721s2-evm j722s-evm j742s2-evm j784s4-evm

      In file ipc_api.c, the function RPMessage_enqueMsg() handles incoming messages. In this function announcements are put into a queue (IpcUtils_Qput()) by the call to RPMessage_processAnnounceMsg. After this is handled the configured callback function is called.
      After this, the message are copied to new buffers and inserted into a queue IpcUtils_Qput().The application callback function is called again.

      //------------------------------------------{}RPMessage_enqueMsg(){}---------------------------------------------------//

      #ifdef IPC_EXCLUDE_CTRL_TASKS
      if (msg->dstAddr == IPC_CTRL_ENDPOINT_ID)
      {
      /* This message is for the ctrl endpoint */
      RPMessage_Announcement amsg = (RPMessage_Announcement)msg->payload;
      if (amsg->ctrl.type == CNTRLMSG_ANNOUNCE)
      {
      #if DEBUG_PRINT
      SystemP_printf("RPMessage_enqueMsg ...CNTRLMSG_ANNOUNCE\n");
      #endif
      status = RPMessage_processAnnounceMsg(
      (RPMessage_Announcement*)amsg, msg->srcProcId);

      if(status != IPC_SOK)

      { SystemP_printf("RPMessage_processAnnounceMsg: Failed"); }

      }
      if ((status == IPC_SOK) && (NULL != gIpcObject.initPrms.newMsgFxn))
      {
      gIpcObject.initPrms.newMsgFxn(msg->srcAddr, msg->dstAddr, msg->srcProcId);
      }
      }
      #endif /* IPC_EXCLUDE_CTRL_TASKS */
      if (NULL != obj)
      {
      key = pOsalPrms->lockHIsrGate(module.gateSwi);

      if (NULL != obj->recv_buffer)
      {
      memcpy(obj->recv_buffer, (void *)msg->payload, msg->dataLen);
      obj->recv_buffer = NULL;
      obj->payload.len = msg->dataLen;
      obj->payload.src = msg->srcAddr;
      obj->payload.procId = msg->srcProcId;

      pOsalPrms->unLockHIsrGate(module.gateSwi, key);

      if (NULL != gIpcObject.initPrms.newMsgFxn)

      { gIpcObject.initPrms.newMsgFxn(msg->srcAddr, msg->dstAddr, msg->srcProcId); }

      if (NULL != pOsalPrms->unlockMutex)

      { pOsalPrms->unlockMutex(obj->semHandle); }

      }
      else
      {
      if( obj->endPt != msg->dstAddr)
      { SystemP_printf("WARNING: %d != %d\n", obj->endPt, msg->dstAddr); }

      /* Allocate a buffer to copy the payload: */
      size = msg->dataLen + sizeof(RPMessage_MsgElem);

      /* HeapBuf_alloc() is non-blocking, so needs protection: HIsrGate has already been taken*/
      payload = (RPMessage_MsgElem *)IpcUtils_HeapAlloc(&obj->heap, size, 0);

      if (payload != NULL)
      {
      memcpy(payload->data, msg->payload, msg->dataLen);
      payload->len = msg->dataLen;
      payload->src = msg->srcAddr;
      payload->procId = msg->srcProcId;

      IpcUtils_Qput(&obj->queue, &payload->elem);
      pOsalPrms->unLockHIsrGate(module.gateSwi, key);
      if (NULL != gIpcObject.initPrms.newMsgFxn)
      {
      gIpcObject.initPrms.newMsgFxn(msg->srcAddr, msg->dstAddr, msg->srcProcId);
      }

      if (NULL != pOsalPrms->unlockMutex)
      { pOsalPrms->unlockMutex(obj->semHandle); }

      }
      else

      { pOsalPrms->unLockHIsrGate(module.gateSwi, key); SystemP_printf("IpcUtils_HeapAlloc failed: Failed to allocate buffer for payload. (%d %d %d %d %d)\n", msg->srcProcId, msg->srcAddr, msg->dstAddr, msg->dataLen, obj->endPt); status = IPC_EFAIL; }

      }
      }

      //------------------------------------------{}RPMessage_enqueMsg(){}---------------------------------------------------//

      The function RPMessage_enqueMsg first calls RPMessage_processAnnounceMsg (which enqueues the message inside it), then after returning from RPMessage_processAnnounceMsg it enqueues the message again, but in a different queue.

      First queue is completely ignored , second queue is being created and used.

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

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-5377 - RPMessage_enqueMsg() handles incomi...
                SYNCHRONIZED
                • Last Sync Date: