[PATCH 0/5] cyclic: get rid of (the need for) cyclic_init()

Rasmus Villemoes rasmus.villemoes at prevas.dk
Fri Oct 28 13:50:49 CEST 2022


I have only compile-tested each of these for sandbox_defconfig and
imx8mq_cm_defconfig. I couldn't even figure out how to run the cyclic
test inside sandbox by itself, and I don't have any hardware here at
home. So perhaps just consider these a POC of the overall idea, namely
to use a list abstraction which doesn't need initialization other than
what we already guarantee to do for all of struct global_data.

As positive side effects, the generated code will be a little smaller,
we reduce the use of the early malloc() pool, and the diffstat below
is also nice.

I don't know if we ever do anything in SPL that would require a call
to cyclic_unregister_all().

Rasmus Villemoes (5):
  cyclic: use a flag in gd->flags for recursion protection
  cyclic: drop redundant cyclic_ready flag
  list.h: synchronize hlist_for_each_entry* iterators with linux
  cyclic: switch to using hlist instead of list
  cyclic: get rid of cyclic_init()

 cmd/cyclic.c                      |  5 +--
 common/board_f.c                  |  2 +-
 common/board_r.c                  |  1 -
 common/cyclic.c                   | 50 ++++++++++-------------------
 include/asm-generic/global_data.h |  8 +++--
 include/cyclic.h                  | 35 +++-----------------
 include/linux/list.h              | 53 +++++++++++++++----------------
 test/test-main.c                  |  3 +-
 8 files changed, 57 insertions(+), 100 deletions(-)

-- 
2.37.2


More information about the U-Boot mailing list