Skip to content

Commit ee3bf12

Browse files
committed
[ot] hw/opentitan: ot_csrng: fix connection management
1. inverted detection of a previous EDN connection 2. the filler_fn function now tracks whether an EDN is connected or not, the instantiation status was a left over from the initial implementation Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
1 parent 846e6f1 commit ee3bf12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hw/opentitan/ot_csrng.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ ot_csnrg_connect_hw_app(OtCSRNGState *s, unsigned app_id, qemu_irq req_sts,
439439
OtCSRNGInstance *inst = &s->instances[app_id];
440440

441441
if (!filler_fn) {
442-
if (inst->hw.filler) {
442+
if (!inst->hw.filler) {
443443
xtrace_ot_csrng_info("HW app was not connected", app_id);
444444
return NULL;
445445
}
@@ -1027,7 +1027,7 @@ static void ot_csrng_handle_enable(OtCSRNGState *s)
10271027
/* skip SW instance */
10281028
for (unsigned ix = 0u; ix < OT_CSRNG_HW_APP_MAX; ix++) {
10291029
OtCSRNGInstance *inst = &s->instances[ix];
1030-
if (ot_csrng_drng_is_instantiated(inst)) {
1030+
if (inst->hw.filler) {
10311031
qemu_log_mask(LOG_GUEST_ERROR,
10321032
"%s: Forcing CSRNG disablement while EDN #%u "
10331033
"still active\n",

0 commit comments

Comments
 (0)