aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/rtas_flash.c')
-rw-r--r--arch/powerpc/kernel/rtas_flash.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index aaf384c3f04a..1442b63a75da 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -365,20 +365,12 @@ static int rtas_excl_release(struct inode *inode, struct file *file)
365 365
366static void manage_flash(struct rtas_manage_flash_t *args_buf) 366static void manage_flash(struct rtas_manage_flash_t *args_buf)
367{ 367{
368 unsigned int wait_time;
369 s32 rc; 368 s32 rc;
370 369
371 while (1) { 370 do {
372 rc = rtas_call(rtas_token("ibm,manage-flash-image"), 1, 371 rc = rtas_call(rtas_token("ibm,manage-flash-image"), 1,
373 1, NULL, args_buf->op); 372 1, NULL, args_buf->op);
374 if (rc == RTAS_RC_BUSY) 373 } while (rtas_busy_delay(rc));
375 udelay(1);
376 else if (rtas_is_extended_busy(rc)) {
377 wait_time = rtas_extended_busy_delay_time(rc);
378 udelay(wait_time * 1000);
379 } else
380 break;
381 }
382 374
383 args_buf->status = rc; 375 args_buf->status = rc;
384} 376}
@@ -451,27 +443,18 @@ static ssize_t manage_flash_write(struct file *file, const char __user *buf,
451static void validate_flash(struct rtas_validate_flash_t *args_buf) 443static void validate_flash(struct rtas_validate_flash_t *args_buf)
452{ 444{
453 int token = rtas_token("ibm,validate-flash-image"); 445 int token = rtas_token("ibm,validate-flash-image");
454 unsigned int wait_time;
455 int update_results; 446 int update_results;
456 s32 rc; 447 s32 rc;
457 448
458 rc = 0; 449 rc = 0;
459 while(1) { 450 do {
460 spin_lock(&rtas_data_buf_lock); 451 spin_lock(&rtas_data_buf_lock);
461 memcpy(rtas_data_buf, args_buf->buf, VALIDATE_BUF_SIZE); 452 memcpy(rtas_data_buf, args_buf->buf, VALIDATE_BUF_SIZE);
462 rc = rtas_call(token, 2, 2, &update_results, 453 rc = rtas_call(token, 2, 2, &update_results,
463 (u32) __pa(rtas_data_buf), args_buf->buf_size); 454 (u32) __pa(rtas_data_buf), args_buf->buf_size);
464 memcpy(args_buf->buf, rtas_data_buf, VALIDATE_BUF_SIZE); 455 memcpy(args_buf->buf, rtas_data_buf, VALIDATE_BUF_SIZE);
465 spin_unlock(&rtas_data_buf_lock); 456 spin_unlock(&rtas_data_buf_lock);
466 457 } while (rtas_busy_delay(rc));
467 if (rc == RTAS_RC_BUSY)
468 udelay(1);
469 else if (rtas_is_extended_busy(rc)) {
470 wait_time = rtas_extended_busy_delay_time(rc);
471 udelay(wait_time * 1000);
472 } else
473 break;
474 }
475 458
476 args_buf->status = rc; 459 args_buf->status = rc;
477 args_buf->update_results = update_results; 460 args_buf->update_results = update_results;