1
0
mirror of https://xff.cz/git/u-boot/ synced 2026-01-11 01:36:20 +01:00
Files
u-boot-megous/include
Rasmus Villemoes 50128aeb0f cyclic: get rid of cyclic_init()
Currently, we must call cyclic_init() at some point before
cyclic_register() becomes possible. That turns out to be somewhat
awkward, especially with SPL, and has resulted in a watchdog callback
not being registered, thus causing the board to prematurely reset.

We already rely on gd->cyclic reliably being set to NULL by the asm
code that clears all of gd. Now that the cyclic list is a hlist, and
thus an empty list is represented by a NULL head pointer, and struct
cyclic_drv has no other members, we can just as well drop a level of
indirection and put the hlist_head directly in struct
global_data. This doesn't increase the size of struct global_data,
gets rid of an early malloc(), and generates slightly smaller code.

But primarily, this avoids having to call cyclic_init() early; the cyclic
infrastructure is simply ready to register callbacks as soon as we
enter C code.

We can still end up with schedule() being called from asm very early,
so we still need to check that gd itself has been properly initialized
[*], but once it has, gd->cyclic_list is perfectly fine to access, and
will just be an empty list.

As for cyclic_uninit(), it was never really the opposite of
cyclic_init() since it didn't free the struct cyclic_drv nor set
gd->cyclic to NULL. Rename it to cyclic_unregister_all() and use that
in test/, and also insert a call at the end of the board_init_f
sequence so that gd->cyclic_list is a fresh empty list before we enter
board_init_r().

A small piece of ugliness is that I had to add a cast in
cyclic_get_list() to silence a "discards 'volatile' qualifier"
warning, but that is completely equivalent to the existing handling of
the uclass_root_s list_head member.

[*] I'm not really sure where we guarantee that the register used for
gd contains 0 until it gets explicitly initialized, but that must be
the case, otherwise testing gd for being NULL would not make much sense.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Stefan Roese <sr@denx.de>
Tested-by: Stefan Roese <sr@denx.de>
Tested-by: Tim Harvey <tharvey@gateworks.com> # imx8mm-venice-*
2022-11-02 08:42:03 +01:00
..
2022-07-05 14:37:16 +02:00
2022-08-04 16:18:47 -04:00
2022-01-19 18:11:34 +01:00
2022-07-11 14:58:57 -04:00
2022-10-30 20:07:16 +01:00
2022-01-19 18:11:34 +01:00
2022-09-29 16:07:57 -04:00
2022-04-11 10:00:30 -04:00
2022-09-24 10:47:01 -04:00
2022-01-19 18:11:34 +01:00
2022-07-26 02:30:56 -06:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2020-05-11 10:16:49 +05:30
2021-01-15 14:36:12 -05:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-30 01:25:00 +00:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-10-31 11:02:44 -04:00
2022-01-19 18:11:34 +01:00
2022-04-25 10:00:04 -04:00
2022-09-29 16:07:57 -04:00
2022-01-19 18:11:34 +01:00
2022-08-12 08:17:11 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-04-06 14:01:42 -04:00
2022-05-28 10:59:27 +02:00
2022-01-19 18:11:34 +01:00
2022-03-30 13:02:55 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2021-01-30 14:25:42 -07:00
2022-11-02 08:42:03 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-03-15 16:19:29 -04:00
2022-04-06 14:01:42 -04:00
2022-10-31 14:47:32 -04:00
2022-01-19 18:11:34 +01:00
2022-08-04 16:18:47 -04:00
2022-08-31 12:16:01 -04:00
2022-10-18 09:32:53 +08:00
2021-07-07 19:52:22 -04:00
2022-07-26 11:29:00 +02:00
2021-04-10 08:04:42 -04:00
2020-10-30 10:56:11 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-06-08 13:59:53 -04:00
2022-01-19 18:11:34 +01:00
2021-08-30 14:13:28 -04:00
2022-06-28 17:03:32 -04:00
2022-07-26 11:29:02 +02:00
2022-01-19 18:11:34 +01:00
2021-10-31 08:46:44 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-04-28 09:26:44 -04:00
2020-04-17 12:32:36 -04:00
2022-10-30 20:07:17 +01:00
2022-08-10 13:38:30 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-24 10:35:10 -05:00
2022-09-16 11:05:16 -04:00
2021-09-28 12:03:20 -04:00
2022-10-21 16:04:39 -04:00
2022-08-08 10:50:20 -04:00
2022-01-19 18:11:34 +01:00
2022-06-08 14:00:22 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-10-31 11:02:44 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-10-29 07:36:33 -06:00
2022-10-21 16:04:39 -04:00
2022-01-19 18:11:34 +01:00
2021-07-07 19:52:24 -04:00
2022-01-19 18:11:34 +01:00
2021-04-12 17:44:55 -04:00
2022-01-19 18:11:34 +01:00
2020-06-14 21:07:20 +02:00
2022-07-08 12:20:28 -04:00
2022-01-19 18:11:34 +01:00
2020-02-05 19:33:46 -07:00
2022-01-19 18:11:34 +01:00
2020-06-14 21:07:20 +02:00
2022-01-19 18:11:34 +01:00
2022-04-01 15:03:13 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-09-13 12:08:40 -04:00
2022-10-16 12:23:22 +02:00
2022-01-19 18:11:34 +01:00
2022-10-31 11:04:00 -04:00
2022-04-06 14:03:17 -04:00
2022-09-24 10:47:01 -04:00
2022-01-19 18:11:34 +01:00
2020-08-03 22:19:54 -04:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2021-01-27 17:03:16 -05:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2022-09-18 10:26:49 +02:00
2022-01-19 18:11:34 +01:00
2021-01-15 14:36:12 -05:00