diff options
| author | Samuel Holland <[email protected]> | 2025-09-07 22:56:39 -0700 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-09-16 10:03:53 +0530 |
| commit | f04ae48263533503a0432e6a7ba31cc20518c310 (patch) | |
| tree | a56520c9866c2b0fe3d2dbb0adf52cc2ed5c9de7 | |
| parent | 55135abcd555b72ca4edf481461fb37acd27e9cc (diff) | |
lib: sbi_hart: Do not call delegate_traps() in the resume flow
The only purpose of this function is to program the initial values of
mideleg and medeleg. However, both of these CSRs are now saved/restored
across non-retentive suspend, so the values from this function are
always overwritten by the restored values.
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_hart.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 6a2d7d6f..1b50f671 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -1037,10 +1037,6 @@ int sbi_hart_reinit(struct sbi_scratch *scratch) if (rc) return rc; - rc = delegate_traps(scratch); - if (rc) - return rc; - return 0; } @@ -1068,6 +1064,10 @@ int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot) if (rc) return rc; + rc = delegate_traps(scratch); + if (rc) + return rc; + return sbi_hart_reinit(scratch); } |
