platform: generic/andes: pair non-retentive CSR save/restore with a flag

The restore was gated on sbi_init_count() and the current sleep type,
which is only a proxy for "did this hart actually save its CSRs". Track
it explicitly instead, so restore is self-guarding and the call site
needs no conditions.

Signed-off-by: Ben Zong-You Xie <ben717@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260728081041.2724668-4-ben717@andestech.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Ben Zong-You Xie
2026-09-01 10:46:23 +05:30
committed by Anup Patel
parent 4c5d9d9f93
commit 733867c0c8
2 changed files with 15 additions and 6 deletions
+3
View File
@@ -96,6 +96,9 @@ struct andes_hart_data {
unsigned long pmacfg0;
unsigned long pmacfg2;
unsigned long pmaaddrX[16];
/* Set when the CSRs above hold a saved copy awaiting restore */
bool saved;
};
void ae350_non_ret_save(struct sbi_scratch *scratch);