From f401f2304fa3c876243efd8454dbbb4bb3a23a5f Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 4 Jan 2018 12:53:09 -0800 Subject: Deal with busy status on dbus_read() request. Change-Id: I3699bde01887dfba37d7f420737988248c7fca5b --- src/target/riscv/riscv-011.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index f7f2e8c..a5ebe42 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -459,7 +459,11 @@ static uint64_t dbus_read(struct target *target, uint16_t address) * If there happens to be a busy state pending, we will clear it after we * discover it as part of the NOP scan. */ for (unsigned i = 0; i < 256; i++) { - dbus_scan(target, NULL, NULL, DBUS_OP_READ, address, 0); + status = dbus_scan(target, NULL, NULL, DBUS_OP_READ, address, 0); + if (status == DBUS_STATUS_BUSY) { + increase_dbus_busy_delay(target); + continue; + } status = dbus_scan(target, &address_in, &value, DBUS_OP_NOP, address, 0); if (status == DBUS_STATUS_BUSY) increase_dbus_busy_delay(target); -- cgit v1.1