Commit d703f13f authored by Hari Kanigeri's avatar Hari Kanigeri

SYSLINK:ipc:notify drv read fix

This patch fixes the bug in notify drv read where
the read thread wouldn't get blocked if the event
list is empty. This bug resulted in board freeze
in Zebu enviornment because the read thread was
blockign all other threads from getting scheduled.

Signed-off-by: Hari Kanigeri<h-kanigeri2@ti.com>
parent 8cccfe7d
......@@ -230,7 +230,6 @@ static int notify_drv_read(struct file *filp, char *dst, size_t size,
u32 i;
struct list_head *elem;
struct notify_drv_event_packet t_buf;
if (WARN_ON(notifydrv_state.is_setup == false)) {
ret_val = -EFAULT;
goto func_end;
......@@ -252,7 +251,6 @@ static int notify_drv_read(struct file *filp, char *dst, size_t size,
ret_val = -EFAULT;
goto func_end;
}
if (list_empty(&(notifydrv_state.event_state[i].buf_list)) == false) {
/* Wait for the event */
ret_val = down_interruptible(
notifydrv_state.event_state[i].semhandle);
......@@ -274,12 +272,11 @@ static int notify_drv_read(struct file *filp, char *dst, size_t size,
ret_val = copy_to_user((void *)dst, u_buf,
sizeof(struct notify_drv_event_packet));
kfree(u_buf);
if (WARN_ON(ret_val != 0))
ret_val = -EFAULT;
if (u_buf->is_exit == true)
up(notifydrv_state.event_state[i].tersemhandle);
}
func_end:
return ret_val ;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment