changeset 8e240cd8132a in /z/repo/gem5 details: http://repo.gem5.org/gem5?cmd=changeset;node=8e240cd8132a description: dev: Fix draining for UFSHostDevice and FlashDevice
This patch fixes the drain logic for the UFSHostDevice and the FlashDevice. In the case of the FlashDevice, the logic for CheckDrain needed to be reversed, whilst in the case of the UFSHostDevice check drain was never being called. In both cases the system would never complete draining if the initial attampt to drain failed. diffstat: src/dev/arm/flash_device.cc | 2 +- src/dev/arm/ufs_device.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diffs (33 lines): diff -r 555325cbf464 -r 8e240cd8132a src/dev/arm/flash_device.cc --- a/src/dev/arm/flash_device.cc Thu Oct 29 08:48:23 2015 -0400 +++ b/src/dev/arm/flash_device.cc Thu Oct 29 08:48:24 2015 -0400 @@ -605,7 +605,7 @@ void FlashDevice::checkDrain() { - if (drainState() == DrainState::Draining) + if (drainState() != DrainState::Draining) return; if (planeEvent.when() > curTick()) { diff -r 555325cbf464 -r 8e240cd8132a src/dev/arm/ufs_device.cc --- a/src/dev/arm/ufs_device.cc Thu Oct 29 08:48:23 2015 -0400 +++ b/src/dev/arm/ufs_device.cc Thu Oct 29 08:48:24 2015 -0400 @@ -1822,6 +1822,8 @@ pendingDoorbells = 0; DPRINTF(UFSHostDevice, "Clear doorbell %X\n", UFSHCIMem.TRUTRLDBR); + checkDrain(); + /**step6 raise interrupt*/ gic->sendInt(intNum); DPRINTF(UFSHostDevice, "Send interrupt @ transaction: 0x%8x!\n", @@ -1838,6 +1840,8 @@ gic->clearInt(intNum); DPRINTF(UFSHostDevice, "Clear interrupt: 0x%8x!\n", countInt); + checkDrain(); + if (!(UFSHCIMem.TRUTRLDBR)) { idlePhaseStart = curTick(); } _______________________________________________ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev