diff options
author | Mark Allyn <mark.a.allyn@intel.com> | 2010-12-09 09:32:13 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 16:37:49 -0800 |
commit | be38efe11748684d54ff86810443979a59b96cfc (patch) | |
tree | 0482b7d283b801056d25f7dc506e77a872118ba2 /drivers/staging/sep/sep_driver.c | |
parent | 8f9346a091ac523afa73643aae69f74f0f8a6e80 (diff) | |
download | kernel_goldelico_gta04-be38efe11748684d54ff86810443979a59b96cfc.zip kernel_goldelico_gta04-be38efe11748684d54ff86810443979a59b96cfc.tar.gz kernel_goldelico_gta04-be38efe11748684d54ff86810443979a59b96cfc.tar.bz2 |
Staging: sep: limit time to wait for reconfig shared area complete
Signed-off-by: Mark Allyn <mark.a.allyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sep/sep_driver.c')
-rw-r--r-- | drivers/staging/sep/sep_driver.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c index 5a54f98..83475eb 100644 --- a/drivers/staging/sep/sep_driver.c +++ b/drivers/staging/sep/sep_driver.c @@ -53,6 +53,7 @@ #include <asm/cacheflush.h> #include <linux/sched.h> #include <linux/delay.h> +#include <linux/jiffies.h> #include <linux/rar_register.h> #include "../memrar/memrar.h" @@ -3244,6 +3245,9 @@ static int sep_reconfig_shared_area(struct sep_device *sep) { int ret_val; + /* use to limit waiting for SEP */ + unsigned long end_time; + dev_dbg(&sep->pdev->dev, "reconfig shared area start\n"); /* Send the new SHARED MESSAGE AREA to the SEP */ @@ -3255,7 +3259,10 @@ static int sep_reconfig_shared_area(struct sep_device *sep) /* Poll for SEP response */ ret_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); - while (ret_val != 0xffffffff && ret_val != sep->shared_bus) + end_time = jiffies + (WAIT_TIME * HZ); + + while ((time_before(jiffies, end_time)) && (ret_val != 0xffffffff) && + (ret_val != sep->shared_bus)) ret_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); /* Check the return value (register) */ |