Skip to content

Commit 621a91b

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 c7e5c25 commit 621a91b

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
@@ -432,7 +432,7 @@ ot_csnrg_connect_hw_app(OtCSRNGState *s, unsigned app_id, qemu_irq req_sts,
432432
OtCSRNGInstance *inst = &s->instances[app_id];
433433

434434
if (!filler_fn) {
435-
if (inst->hw.filler) {
435+
if (!inst->hw.filler) {
436436
xtrace_ot_csrng_info("HW app was not connected", app_id);
437437
return NULL;
438438
}
@@ -1020,7 +1020,7 @@ static void ot_csrng_handle_enable(OtCSRNGState *s)
10201020
/* skip SW instance */
10211021
for (unsigned ix = 0u; ix < OT_CSRNG_HW_APP_MAX; ix++) {
10221022
OtCSRNGInstance *inst = &s->instances[ix];
1023-
if (ot_csrng_drng_is_instantiated(inst)) {
1023+
if (inst->hw.filler) {
10241024
qemu_log_mask(LOG_GUEST_ERROR,
10251025
"%s: Forcing CSRNG disablement while EDN #%u "
10261026
"still active\n",

0 commit comments

Comments
 (0)