diff options
author | Cyril Bur <cyril.bur@au1.ibm.com> | 2017-12-05 12:01:04 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-12-14 23:58:38 -0600 |
commit | 3e6c3b03bb4cc5d088fc3da7293274adaabf6c5c (patch) | |
tree | dbce5c2b96fed576eae6000c5545bd6989b2f53f /libflash | |
parent | 60f46277f4bcdb26d9114889a442ad96b6630f64 (diff) | |
download | skiboot-3e6c3b03bb4cc5d088fc3da7293274adaabf6c5c.zip skiboot-3e6c3b03bb4cc5d088fc3da7293274adaabf6c5c.tar.gz skiboot-3e6c3b03bb4cc5d088fc3da7293274adaabf6c5c.tar.bz2 |
libflash/mbox-flash: Always close windows before opening a new window
The MBOX protocol states that if an open window command fails then all
open windows are closed. Currently, if an open window command fails
mbox-flash will erroneously assume that the previously open window is
still open.
The solution to this is to mark all windows as closed before issuing an
open window command and then on success we'll mark the new window as
open.
Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r-- | libflash/mbox-flash.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libflash/mbox-flash.c b/libflash/mbox-flash.c index 950e24f..c8a8dad 100644 --- a/libflash/mbox-flash.c +++ b/libflash/mbox-flash.c @@ -617,6 +617,9 @@ static int mbox_window_move(struct mbox_flash_data *mbox_flash, goto out; } + mbox_flash->read.open = false; + mbox_flash->write.open = false; + rc = wait_for_bmc(mbox_flash, MBOX_DEFAULT_TIMEOUT); if (rc) { prlog(PR_ERR, "Error waiting for BMC\n"); |