aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2017-12-17 23:25:53 -0600
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-18 17:58:33 -0600
commitb7b7b84ef565380a22dd636cd22d0622e360c440 (patch)
treebd521db42b377ce255f57b876ba571c669ac9e44 /libflash
parentc0840ae7330fcbc310d864894f7a8b79f32ce05e (diff)
downloadskiboot-b7b7b84ef565380a22dd636cd22d0622e360c440.zip
skiboot-b7b7b84ef565380a22dd636cd22d0622e360c440.tar.gz
skiboot-b7b7b84ef565380a22dd636cd22d0622e360c440.tar.bz2
libflash/mbox-flash: only wait for MBOX_DEFAULT_POLL_MS if busy
This makes the mbox unit test run 300x quicker and seems to shave about 6 seconds from boot time on Witherspoon. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/mbox-flash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libflash/mbox-flash.c b/libflash/mbox-flash.c
index e15fecf..d33a52c 100644
--- a/libflash/mbox-flash.c
+++ b/libflash/mbox-flash.c
@@ -348,8 +348,9 @@ static int wait_for_bmc(struct mbox_flash_data *mbox_flash, unsigned int timeout
* Both functions are important.
* Well time_wait_ms() relaxes the spin... so... its nice
*/
- time_wait_ms(MBOX_DEFAULT_POLL_MS);
check_timers(false);
+ if (mbox_flash->busy)
+ time_wait_ms(MBOX_DEFAULT_POLL_MS);
asm volatile ("" ::: "memory");
}