Skip to content

Commit b117c39

Browse files
committed
[ot] hw/opentitan: ot_dma: abort on IDLE should raise the ABORT flag
Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
1 parent 488a98e commit b117c39

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

hw/opentitan/ot_dma.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -948,19 +948,19 @@ static bool ot_dma_go(OtDMAState *s)
948948

949949
static void ot_dma_abort(OtDMAState *s)
950950
{
951-
if (!ot_dma_is_busy(s)) {
952-
/* nothing to do, but ABORTED be signaled? */
953-
return;
954-
}
955-
956951
trace_ot_dma_abort(s->ot_id);
957952

958953
s->abort = true;
959954

960-
/* simulate a delayed response */
961955
timer_del(s->timer);
956+
962957
uint64_t now = qemu_clock_get_ns(OT_VIRTUAL_CLOCK);
963-
timer_mod(s->timer, (int64_t)(now + s->pace_delay));
958+
if (ot_dma_is_busy(s)) {
959+
/* simulate a delayed response */
960+
now += s->pace_delay;
961+
}
962+
963+
timer_mod(s->timer, (int64_t)now);
964964
}
965965

966966
static void ot_dma_complete(OtDMAState *s)

0 commit comments

Comments
 (0)