summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSubin K G <subin.kg@ti.com>2011-05-06 16:22:46 -0500
committerAndy Green <andy.green@linaro.org>2011-09-26 17:28:28 +0100
commit4f95b6db751b576ee3004d3f861cccc86614c7d3 (patch)
tree88afb2c7b038ef1ce8c949c7eb425cf5ae4be0db /drivers
parent36143b2ead554ce834199506a525a7f03ec18071 (diff)
syslink: notify: process both cores ipc stack for each mailbox interrupt
For each mailbox interrupt,process both cores(sysm3 and appm3) ipc stack. This is to fix the issue of message being dropped, when both cores tries to put the message at the same time. For example both sysm3 and appm3 are trying to write into MBX and appm3 sees that there is already a message pending by SYSM3.In this case appm3 will not interrupt A9.But A9 will only process sysm3 ipc stack.So to take care of this,process both cores ipc stack for each MBX interrupt. Change-Id: I209db12d54204818f6c4b24aab162263bbd53d3b Signed-off-by: Subin K G <subin.kg@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dsp/syslink/notify_ducatidriver/notify_ducati.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/dsp/syslink/notify_ducatidriver/notify_ducati.c b/drivers/dsp/syslink/notify_ducatidriver/notify_ducati.c
index 4148a5e3b9a5..29f72c665897 100644
--- a/drivers/dsp/syslink/notify_ducatidriver/notify_ducati.c
+++ b/drivers/dsp/syslink/notify_ducatidriver/notify_ducati.c
@@ -1301,13 +1301,31 @@ static int notify_shmdrv_isr(struct notifier_block *nb, unsigned long val,
{
/* Decode the msg to identify the processor that has sent the message */
u32 proc_id = (u32)ntfy_msg;
+ u16 sysm3_id = multiproc_get_id("SysM3");
+ u16 appm3_id = multiproc_get_id("AppM3");
struct notify_ducatidrv_object *obj;
+ if (WARN_ON((MULTIPROC_MAXPROCESSORS <= sysm3_id) ||
+ (MULTIPROC_MAXPROCESSORS <= appm3_id) ||
+ (MULTIPROC_MAXPROCESSORS <= proc_id))) {
+ return NOTIFY_E_INVALIDARG;
+ }
+
mutex_lock_killable(&notify_ducatidriver_state.dh_lock);
- /* Call the corresponding prpc_id callback */
- obj = notify_ducatidriver_state.driver_handles[proc_id][0];
- if (obj)
- notify_shmdrv_isr_callback(obj, ntfy_msg);
+ /* process both cores ipc stack for each notification event since
+ ducati won't be sending notifcation if one is already pending*/
+ if (proc_id == sysm3_id || proc_id == appm3_id) {
+ obj = notify_ducatidriver_state.driver_handles[appm3_id][0];
+ if (obj)
+ notify_shmdrv_isr_callback(obj, ntfy_msg);
+ obj = notify_ducatidriver_state.driver_handles[sysm3_id][0];
+ if (obj)
+ notify_shmdrv_isr_callback(obj, ntfy_msg);
+ } else if (proc_id == multiproc_get_id("Tesla")) {
+ obj = notify_ducatidriver_state.driver_handles[proc_id][0];
+ if (obj)
+ notify_shmdrv_isr_callback(obj, ntfy_msg);
+ }
mutex_unlock(&notify_ducatidriver_state.dh_lock);
return 0;