diff options
author | Thomas Weißschuh | 2024-02-13 18:13:28 +0100 |
---|---|---|
committer | Tom Rini | 2024-03-02 12:26:56 -0500 |
commit | 39162d9348584ad6d86cb2a3a540ca38f8be7ff8 (patch) | |
tree | c59108f24be5abbe0cb1e5202a41793f38c1e174 /include/log.h | |
parent | 657bd30c6b3ee8c80a94ebfe7c8b5c4b027ae038 (diff) |
log: fixup log_head after relocating global data
When `gd` is relocated during `spl_relocate_stack_gd()` the
doubly-linked circular list in the `log_head` member is broken.
The last element of the list should point back to the initial
`list_head`, but as the initial `list_head` is moved the pointer becomes
stale. As a result the loop in `log_dispatch` would never finish.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Diffstat (limited to 'include/log.h')
-rw-r--r-- | include/log.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/log.h b/include/log.h index 6e84f080ef3..fc0d5984472 100644 --- a/include/log.h +++ b/include/log.h @@ -688,4 +688,16 @@ static inline int log_get_default_format(void) (IS_ENABLED(CONFIG_LOGF_FUNC) ? BIT(LOGF_FUNC) : 0); } +struct global_data; +/** + * log_fixup_for_gd_move() - Handle global_data moving to a new place + * + * @new_gd: Pointer to the new global data + * + * The log_head list is part of global_data. Due to the way lists work, moving + * the list will cause it to become invalid. This function fixes that up so + * that the log_head list will work correctly. + */ +void log_fixup_for_gd_move(struct global_data *new_gd); + #endif |