Skip to content

Commit

Permalink
lib: sbi_hsm: Restor hart state to stop when fails to start
Browse files Browse the repository at this point in the history
Hart state should change back to hart stop when hsm_device_hart_start()
or sbi_ipi_raw_send() fails to perform hart start.

Signed-off-by: Joshua Yeong <[email protected]>
Reviewed-by: Xiang W <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
  • Loading branch information
Joshua Yeong authored and avpatel committed Feb 24, 2024
1 parent 96a35db commit 322b598
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/sbi/sbi_hsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ int sbi_hsm_hart_start(struct sbi_scratch *scratch,

if (!rc)
return 0;

/* If it fails to start, change hart state back to stop */
__sbi_hsm_hart_change_state(hdata, SBI_HSM_STATE_START_PENDING,
SBI_HSM_STATE_STOPPED);
err:
hsm_start_ticket_release(hdata);
return rc;
Expand Down

0 comments on commit 322b598

Please sign in to comment.