diff options
author | Mark Allyn <mark.a.allyn@intel.com> | 2010-12-09 12:32:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-09 19:37:49 -0500 |
commit | be38efe11748684d54ff86810443979a59b96cfc (patch) | |
tree | 0482b7d283b801056d25f7dc506e77a872118ba2 | |
parent | 8f9346a091ac523afa73643aae69f74f0f8a6e80 (diff) |
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>
-rw-r--r-- | drivers/staging/sep/sep_driver.c | 9 | ||||
-rw-r--r-- | drivers/staging/sep/sep_driver_config.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c index 5a54f984e28e..83475eb77ad8 100644 --- a/drivers/staging/sep/sep_driver.c +++ b/drivers/staging/sep/sep_driver.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include <asm/cacheflush.h> | 53 | #include <asm/cacheflush.h> |
54 | #include <linux/sched.h> | 54 | #include <linux/sched.h> |
55 | #include <linux/delay.h> | 55 | #include <linux/delay.h> |
56 | #include <linux/jiffies.h> | ||
56 | #include <linux/rar_register.h> | 57 | #include <linux/rar_register.h> |
57 | 58 | ||
58 | #include "../memrar/memrar.h" | 59 | #include "../memrar/memrar.h" |
@@ -3244,6 +3245,9 @@ static int sep_reconfig_shared_area(struct sep_device *sep) | |||
3244 | { | 3245 | { |
3245 | int ret_val; | 3246 | int ret_val; |
3246 | 3247 | ||
3248 | /* use to limit waiting for SEP */ | ||
3249 | unsigned long end_time; | ||
3250 | |||
3247 | dev_dbg(&sep->pdev->dev, "reconfig shared area start\n"); | 3251 | dev_dbg(&sep->pdev->dev, "reconfig shared area start\n"); |
3248 | 3252 | ||
3249 | /* Send the new SHARED MESSAGE AREA to the SEP */ | 3253 | /* Send the new SHARED MESSAGE AREA to the SEP */ |
@@ -3255,7 +3259,10 @@ static int sep_reconfig_shared_area(struct sep_device *sep) | |||
3255 | /* Poll for SEP response */ | 3259 | /* Poll for SEP response */ |
3256 | ret_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); | 3260 | ret_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); |
3257 | 3261 | ||
3258 | while (ret_val != 0xffffffff && ret_val != sep->shared_bus) | 3262 | end_time = jiffies + (WAIT_TIME * HZ); |
3263 | |||
3264 | while ((time_before(jiffies, end_time)) && (ret_val != 0xffffffff) && | ||
3265 | (ret_val != sep->shared_bus)) | ||
3259 | ret_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); | 3266 | ret_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); |
3260 | 3267 | ||
3261 | /* Check the return value (register) */ | 3268 | /* Check the return value (register) */ |
diff --git a/drivers/staging/sep/sep_driver_config.h b/drivers/staging/sep/sep_driver_config.h index b96045f178cd..92338c0f6bd2 100644 --- a/drivers/staging/sep/sep_driver_config.h +++ b/drivers/staging/sep/sep_driver_config.h | |||
@@ -230,5 +230,7 @@ held by the proccess (struct file) */ | |||
230 | /* the token that defines the data pool pointers address */ | 230 | /* the token that defines the data pool pointers address */ |
231 | #define SEP_EXT_CACHE_ADDR_VAL_TOKEN 0xBABABABA | 231 | #define SEP_EXT_CACHE_ADDR_VAL_TOKEN 0xBABABABA |
232 | 232 | ||
233 | /* Time limit for SEP to finish */ | ||
234 | #define WAIT_TIME 10 | ||
233 | 235 | ||
234 | #endif /* SEP DRIVER CONFIG */ | 236 | #endif /* SEP DRIVER CONFIG */ |