summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubin K G <subin.kg@ti.com>2011-12-16 13:05:21 +0800
committerAndy Green <andy.green@linaro.org>2012-01-09 08:39:21 +0800
commit0d61f7da1eefceb5845997fc41563db75fb90ab5 (patch)
treeea173ec014a5293077b8c08653038418cb5739d5
parent0524aaf2f2d3e677cae7269492a6eae50ae9f353 (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>
-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 4148a5e3b9a..29f72c66589 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;