SDOCM00113753 Notify mailbox driver is clearing wrong fifo
authorRamsey Harris <ramsey@ti.com>
Fri, 31 Oct 2014 23:48:26 +0000 (16:48 -0700)
committerRobert Tivy <rtivy@ti.com>
Mon, 3 Nov 2014 21:22:38 +0000 (13:22 -0800)
Fixed the notify mailbox driver to clear the inbound fifo, not the
outbound fifo. In addition, write the End-Of-Interrupt (EOI) register
after clearing the fifo; this was not being done. Finally, after
fetching inbound messages (in the notify ISR), the EOI register was
not written correctly; now it writes the corresponding interrupt index.

packages/ti/sdo/ipc/family/tda3xx/NotifyDriverMbx.c
packages/ti/sdo/ipc/family/vayu/NotifyDriverMbx.c

index d6bbf35a0bada49bff1e67f6c51a38756fe1d1f9..3172b689047927ca00d251e298defff4e80bce19 100644 (file)
     while (REG32(MAILBOX_STATUS(idx)) != 0) {                               \
         REG32(MAILBOX_MESSAGE(idx));                                        \
     }                                                                       \
-    REG32(MAILBOX_IRQSTATUS_CLR(idx)) = MAILBOX_REG_VAL(SUBMBX_IDX(idx));
+    REG32(MAILBOX_IRQSTATUS_CLR(idx)) = MAILBOX_REG_VAL(SUBMBX_IDX(idx));   \
+    REG32(MAILBOX_EOI_REG(idx)) = MBX_USER_IDX(idx);
 
 /*
  *************************************************************************
@@ -168,9 +169,9 @@ Void NotifyDriverMbx_Instance_init(NotifyDriverMbx_Object *obj,
     /* disable global interrupts */
     key = Hwi_disable();
 
-    /* clear mailbox of any old messages */
+    /* clear inbound mailbox of all old messages */
     selfVirtId = PROCID(MultiProc_self());
-    index = (selfVirtId * NotifyDriverMbx_NUM_CORES) + obj->remoteVirtId;
+    index = (obj->remoteVirtId * NotifyDriverMbx_NUM_CORES) + selfVirtId;
     MAILBOX_INIT(index);
 
     /* must use processor virtual ID to store driver handle in table */
@@ -383,7 +384,7 @@ Void NotifyDriverMbx_enableEvent(NotifyDriverMbx_Object *obj, UInt32 eventId)
     if (TEST_BIT(obj->evtRegMask, eventId)) {                               \
         ti_sdo_ipc_Notify_exec(obj->notifyHandle, eventId, payload);        \
     }                                                                       \
-    REG32(MAILBOX_EOI_REG(idx)) = 0x1;
+    REG32(MAILBOX_EOI_REG(idx)) = MBX_USER_IDX(idx);
 
 Void NotifyDriverMbx_isr(UInt16 idx)
 {
index eb1f206c58b10be4657e820db6d7065ef53f76e7..bdedc24a32cee162edcfafb8b6b6702053e9c7e6 100644 (file)
     while (REG32(MAILBOX_STATUS(idx)) != 0) {                               \
         REG32(MAILBOX_MESSAGE(idx));                                        \
     }                                                                       \
-    REG32(MAILBOX_IRQSTATUS_CLR(idx)) = MAILBOX_REG_VAL(SUBMBX_IDX(idx));
+    REG32(MAILBOX_IRQSTATUS_CLR(idx)) = MAILBOX_REG_VAL(SUBMBX_IDX(idx));   \
+    REG32(MAILBOX_EOI_REG(idx)) = MBX_USER_IDX(idx);
 
 /*
  *************************************************************************
@@ -176,9 +177,9 @@ Void NotifyDriverMbx_Instance_init(NotifyDriverMbx_Object *obj,
     /* disable global interrupts */
     key = Hwi_disable();
 
-    /* clear mailbox of any old messages */
+    /* clear inbound mailbox of all old messages */
     selfVirtId = PROCID(MultiProc_self());
-    index = (selfVirtId * NotifyDriverMbx_NUM_CORES) + obj->remoteVirtId;
+    index = (obj->remoteVirtId * NotifyDriverMbx_NUM_CORES) + selfVirtId;
     MAILBOX_INIT(index);
 
     /* must use processor virtual ID to store driver handle in table */
@@ -391,7 +392,7 @@ Void NotifyDriverMbx_enableEvent(NotifyDriverMbx_Object *obj, UInt32 eventId)
     if (TEST_BIT(obj->evtRegMask, eventId)) {                               \
         ti_sdo_ipc_Notify_exec(obj->notifyHandle, eventId, payload);        \
     }                                                                       \
-    REG32(MAILBOX_EOI_REG(idx)) = 0x1;
+    REG32(MAILBOX_EOI_REG(idx)) = MBX_USER_IDX(idx);
 
 Void NotifyDriverMbx_isr(UInt16 idx)
 {