ide-test: fix failure for test_flush
bd07684aac
added a test to ensure BSY flag is set when a flush request is in flight. It does this by setting a blkdebug breakpoint on flush_to_os before issuing a CMD_FLUSH_CACHE. It then resumes CMD_FLUSH_CACHE operation and checks that BSY is unset. The actual unsetting of BSY does not occur until ide_flush_cb gets called in a bh, however, so in some cases this check will race with the actual completion. Fix this by polling the ide status register until BSY flag gets unset before we do our final sanity checks. According tof68ec8379e
this is in line with how a guest would determine whether or not the device is still busy. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
52bb7c6a06
commit
22bfa16ed3
@ -455,7 +455,10 @@ static void test_flush(void)
|
||||
data = inb(IDE_BASE + reg_device);
|
||||
g_assert_cmpint(data & DEV, ==, 0);
|
||||
|
||||
data = inb(IDE_BASE + reg_status);
|
||||
do {
|
||||
data = inb(IDE_BASE + reg_status);
|
||||
} while (data & BSY);
|
||||
|
||||
assert_bit_set(data, DRDY);
|
||||
assert_bit_clear(data, BSY | DF | ERR | DRQ);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user