Skip to content

Commit

Permalink
wait_for_resource_loaded: don't needlessly sleep for 5ms
Browse files Browse the repository at this point in the history
We would needlessly time_wait_ms_nopoll(5) if opal_run_pollers()
managed to crank things enough to load the requested resource.

Instead of needlessly sleeping, check the result of resource_loaded()
*before* going to sleep for a bit.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
stewartsmith committed Nov 24, 2016
1 parent ecac294 commit 2981a7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/platform.c
Expand Up @@ -205,9 +205,11 @@ int wait_for_resource_loaded(enum resource_id id, uint32_t idx)

while(r == OPAL_BUSY) {
opal_run_pollers();
r = resource_loaded(id, idx);
if (r != OPAL_BUSY)
break;
time_wait_ms_nopoll(5);
waited+=5;
r = resource_loaded(id, idx);
}

prlog(PR_TRACE, "PLATFORM: wait_for_resource_loaded %x/%x %u ms\n",
Expand Down

0 comments on commit 2981a7b

Please sign in to comment.