diff options
author | Subin K G <subin.kg@ti.com> | 2011-10-25 10:51:43 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-10-25 10:51:43 +0800 |
commit | 566e164f34b1c48e71244043024bf48f8a963c62 (patch) | |
tree | 1abdcad702349ff2772907353b8ca5cd0230e576 | |
parent | ae820e512605fe061ef76ccd9c6008016eccbc59 (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.c | 26 |
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(¬ify_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(¬ify_ducatidriver_state.dh_lock); return 0; |