disentangling cyclic API from schedule()
Subsystems (6)
cover disentangling cyclic API from schedule()
These patches are part of a longer-term plan to properly deal with the HW_WATCHDOG vs WATCHDOG dichotomy, and getting rid of the legacy HW_WATCHDOG concept completely. As part of that, clean up which headers include other headers.
While schedule(), the artist formerly known as WATCHDOG_RESET(), is obviously called all over the tree, very few TUs make use of the cyclic API (cyclic_register etc.). And there's really no reason at all for global_data.h to include cyclic.h - except that some places implicitly rely on getting their declaration of schedule() through that include.
So this introduces a separate mostly trivial header that just serves to declare schedule(). Then we can get rid of things that include cyclic.h just to get that declaration.
A next, mostly mechanical step, could be to change almost all includes of watchdog.h (which most TUs that used to have a WATCHDOG_RESET() invocation has) to u-boot/schedule.h, because again, most of those TUs are not really concerned with implementing init_func_watchdog_init or need to call it. But that is for later.
CI seems happy: https://github.com/u-boot/u-boot/pull/673
Rasmus Villemoes (13):
doc: cyclic: remove reference to WATCHDOG_RESET
cyclic: introduce u-boot/schedule.h
led: include cyclic.h in led_sw_blink.c
m68k: asm/ptrace.h: include linux/types.h fs/cramfs: use schedule instead of cyclic_run as callback
test: dm: wdt: replace cyclic_run() by schedule()
cyclic: make cyclic_run static
watchdog.h: change include of cyclic.h to u-boot/schedule.h lib/sha*: include u-boot/schedule.h instead of cyclic.h
i2c: rzg2l: include u-boot/schedule.h
ddr: altera: include u-boot/schedule.h
boot: cedit: include u-boot/schedule.h global_data.h: remove unnecesary include of cyclic.h
arch/m68k/include/asm/ptrace.h | 2 ++ boot/cedit.c | 1 + common/cyclic.c | 3 ++- doc/develop/cyclic.rst | 10 +++++----- drivers/ddr/altera/sdram_n5x.c | 1 + drivers/ddr/altera/sdram_soc64.c | 1 + drivers/i2c/rz_riic.c | 1 + drivers/led/led_sw_blink.c | 1 + fs/cramfs/uncompress.c | 4 ++-- include/asm-generic/global_data.h | 1 - include/cyclic.h | 24 +----------------------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ include/watchdog.h | 2 +- lib/sha1.c | 2 +- lib/sha256.c | 2 +- lib/sha512.c | 2 +- test/dm/wdt.c | 10 +++++----- 17 files changed, 50 insertions(+), 41 deletions(-) create mode 100644 include/u-boot/schedule.h
Signature · 1 line
2.46.2
PATCH 1/13 doc: cyclic: remove reference to WATCHDOG_RESET
WATCHDOG_RESET is no more. Replace the reference by schedule().
While here, rearrange the sentence a bit so that "cyclic_run()" becomes the object and "the main function responsible for calling all registered cyclic functions" a parenthetical rather than the other way around, which at least to me makes it more readable.
--- doc/develop/cyclic.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
doc/develop/cyclic.rst +5 -5
@@ -49,8 +49,8 @@ executed all 10ms. How is this cyclic functionality integrated / executed? -------------------------------------------------------- -The cyclic infrastructure integrates the main function responsible for -calling all registered cyclic functions cyclic_run() into the common -WATCHDOG_RESET macro. This guarantees that cyclic_run() is executed -very often, which is necessary for the cyclic functions to get scheduled -and executed at their configured periods. +The cyclic infrastructure integrates cyclic_run(), the main function +responsible for calling all registered cyclic functions, into the +common schedule() function. This guarantees that cyclic_run() is +executed very often, which is necessary for the cyclic functions to +get scheduled and executed at their configured periods.
Signature · 1 line
2.46.2
Re: [PATCH 01/13] doc: cyclic: remove reference to WATCHDOG_RESET
Quoted 8 lines · Rasmus Villemoes
WATCHDOG_RESETis no more. Replace the reference byschedule().While here, rearrange the sentence a bit so that "
cyclic_run()" becomes the object and "the main function responsible for calling all registered cyclic functions" a parenthetical rather than the other way around, which at least to me makes it more readable.
Quoted 5 lines
Signed-off-by Rasmus Villemoes <[email protected]>--- doc/develop/cyclic.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Quoted 21 lines
doc/develop/cyclic.rst +5
-6@@ -49,8 +49,8 @@ executed all 10ms. How is this cyclic functionality integrated / executed? -------------------------------------------------------- -The cyclic infrastructure integrates the main function responsible for -calling all registered cyclic functions cyclic_run() into the common -WATCHDOG_RESET macro. This guarantees that cyclic_run() is executed -very often, which is necessary for the cyclic functions to get scheduled -and executed at their configured periods. +The cyclic infrastructure integrates cyclic_run(), the main function +responsible for calling all registered cyclic functions, into the +common schedule() function. This guarantees that cyclic_run() is +executed very often, which is necessary for the cyclic functions to +get scheduled and executed at their configured periods. --2.46.2
Re: [PATCH 01/13] doc: cyclic: remove reference to WATCHDOG_RESET
In reply to Rasmus VillemoesQuoted 8 lines · Rasmus Villemoes
WATCHDOG_RESETis no more. Replace the reference byschedule().While here, rearrange the sentence a bit so that "
cyclic_run()" becomes the object and "the main function responsible for calling all registered cyclic functions" a parenthetical rather than the other way around, which at least to me makes it more readable.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 12 lines
--- doc/develop/cyclic.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)doc/develop/cyclic.rst +0
-0@@ -49,8 +49,8 @@ executed all 10ms. How is this cyclic functionality integrated / executed? --------------------------------------------------------
doc/develop/cyclic.rst executed all 10ms. · line 56
Quoted 10 lines
doc/develop/cyclic.rst +5
-5-The cyclic infrastructure integrates the main function responsible for -calling all registered cyclic functions cyclic_run() into the common -WATCHDOG_RESET macro. This guarantees that cyclic_run() is executed -very often, which is necessary for the cyclic functions to get scheduled -and executed at their configured periods. +The cyclic infrastructure integrates cyclic_run(), the main function +responsible for calling all registered cyclic functions, into the +common schedule() function. This guarantees that cyclic_run() is +executed very often, which is necessary for the cyclic functions to +get scheduled and executed at their configured periods.
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 2/13 cyclic: introduce u-boot/schedule.h
In reply to Rasmus VillemoesI noticed an "unnecessary" include of <cyclic.h> in global_data.h, in the sense that nothing in cyclic.h is needed in order to define 'struct global_data'.
Well, it's not unnecessary, as it implicitly ensures that everybody gets a declaration of schedule(), and schedule() is (obviously) called all over the tree. Almost none of those places directly include <cyclic.h>, but for historical reasons, many do include <watchdog.h> (most schedule() instances are replacements of WATCHDOG_RESET()).
However, very few TUs actually need the declarations of the cyclic_register() and struct cyclic_info, and they also don't really need anything from the watchdog.h header.
So introduce a new header which just contains a declaration of schedule(), which can then be included from all the places that do call schedule(). I removed the direct reference to cyclic_run(), because we shouldn't have two public functions for doing roughly the same without being very explicit about when one should call one or the other.
Testing of later patches that explicitly include <schedule.h> when schedule() is used revealed a problem with host tool build on win32, which apparently picked up a host <schedule.h>. To avoid that problem, put the new header in include/u-boot/ and hence make the include statements say <u-boot/schedule.h>.
--- common/cyclic.c | 1 + include/cyclic.h | 12 +----------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 include/u-boot/schedule.h
common/cyclic.c +1 -0
@@ -15,6 +15,7 @@#include <linux/errno.h> #include <linux/list.h> #include <asm/global_data.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR ;
include/cyclic.h +1 -11
@@ -13,6 +13,7 @@#include <linux/list.h> #include <asm/types.h> +#include <u-boot/schedule.h> // to be removed later /** * struct cyclic_info - Information about cyclic execution function
@@ -94,13 +95,6 @@ struct hlist_head *cyclic_get_list(void);*/ void cyclic_run (void ); -/** -* schedule() - Schedule all potentially waiting tasks -* -* Basically a wrapper for cyclic_run(), pontentially enhanced by some -* other parts, that need to get handled periodically. -*/ -void schedule (void );#else static inline void cyclic_register(struct cyclic_info *cyclic, cyclic_func_t func,
@@ -116,10 +110,6 @@ static inline void cyclic_run(void) { } -static inline void schedule (void ) -{ -} -static inline int cyclic_unregister_all (void ) {return 0 ;
include/u-boot/schedule.h new file +24 -0
@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _U_BOOT_SCHEDULE_H +#define _U_BOOT_SCHEDULE_H + +#if CONFIG_IS_ENABLED (CYCLIC ) +/** +* schedule() - Schedule all potentially waiting tasks +* +* Run all pending tasks registered via the cyclic framework, and +* potentially perform other actions that need to be done +* periodically. +*/ +void schedule (void ); + +#else + +static inline void schedule (void ) +{ +} + +#endif + +#endif
Signature · 1 line
2.46.2
Re: [PATCH 02/13] cyclic: introduce u-boot/schedule.h
Quoted 29 lines · Rasmus Villemoes
I noticed an "unnecessary" include of <
cyclic.h> inglobal_data.h, in the sense that nothing incyclic.his needed in order to define 'structglobal_data'.Well, it's not unnecessary, as it implicitly ensures that everybody gets a declaration of
schedule(), andschedule()is (obviously) called all over the tree. Almost none of those places directly include <cyclic.h>, but for historical reasons, many do include <watchdog.h> (mostschedule()instances are replacements ofWATCHDOG_RESET()).However, very few TUs actually need the declarations of the
cyclic_register()and structcyclic_info, and they also don't really need anything from thewatchdog.hheader.So introduce a new header which just contains a declaration of
schedule(), which can then be included from all the places that do callschedule(). I removed the direct reference tocyclic_run(), because we shouldn't have two public functions for doing roughly the same without being very explicit about when one should call one or the other.Testing of later patches that explicitly include <
schedule.h> whenschedule()is used revealed a problem with host tool build on win32, which apparently picked up a host <schedule.h>. To avoid that problem, put the new header ininclude/u-boot/and hence make the include statements say <u-boot/schedule.h>.
Quoted 7 lines
Signed-off-by Rasmus Villemoes <[email protected]>--- common/cyclic.c | 1 + include/cyclic.h | 12 +----------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 include/u-boot/schedule.h
But could it just be include/schedule.h ?
Re: [PATCH 02/13] cyclic: introduce u-boot/schedule.h
Quoted 11 lines · Simon Glass
Quoted 5 lines · Rasmus Villemoes
common/cyclic.c | 1 + include/cyclic.h | 12 +----------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 include/u-boot/schedule.hReviewed-by Simon Glass <[email protected]>But could it just be
include/schedule.h?
I think the last paragraph in the commit message should answer that:
Quoted 5 lines
Quoted 5 lines
Testing of later patches that explicitly include <
schedule.h> whenschedule()is used revealed a problem with host tool build on win32, which apparently picked up a host <schedule.h>. To avoid that problem, put the new header ininclude/u-boot/and hence make the include statements say <u-boot/schedule.h>.
So I tried that at first, and it worked fine for all my local builds, but the CI told me it couldn't. I can try to find the old github PR where I got the CI to tell me this (it's months ago I started doing this), but I don't know if the azure logs still exist.
Rasmus
Re: [PATCH 02/13] cyclic: introduce u-boot/schedule.h
Hi Rasmus,
Quoted 23 lines · Rasmus Villemoes
Quoted 11 lines · Simon Glass
Quoted 5 lines · Rasmus Villemoes
common/cyclic.c | 1 + include/cyclic.h | 12 +----------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 include/u-boot/schedule.hReviewed-by Simon Glass <[email protected]>But could it just be
include/schedule.h?I think the last paragraph in the commit message should answer that:
Quoted 5 lines
Quoted 5 lines
Testing of later patches that explicitly include <
schedule.h> whenschedule()is used revealed a problem with host tool build on win32, which apparently picked up a host <schedule.h>. To avoid that problem, put the new header ininclude/u-boot/and hence make the include statements say <u-boot/schedule.h>.
Quoted 4 lines
So I tried that at first, and it worked fine for all my local builds, but the CI told me it couldn't. I can try to find the old github PR where I got the CI to tell me this (it's months ago I started doing this), but I don't know if the azure logs still exist.
Ah yes, thanks.
Regards,
Simon
Re: [PATCH 02/13] cyclic: introduce u-boot/schedule.h
In reply to Rasmus VillemoesQuoted 22 lines · Rasmus Villemoes
I noticed an "unnecessary" include of <
cyclic.h> inglobal_data.h, in the sense that nothing incyclic.his needed in order to define 'structglobal_data'.Well, it's not unnecessary, as it implicitly ensures that everybody gets a declaration of
schedule(), andschedule()is (obviously) called all over the tree. Almost none of those places directly include <cyclic.h>, but for historical reasons, many do include <watchdog.h> (mostschedule()instances are replacements ofWATCHDOG_RESET()).However, very few TUs actually need the declarations of the
cyclic_register()and structcyclic_info, and they also don't really need anything from thewatchdog.hheader.So introduce a new header which just contains a declaration of
schedule(), which can then be included from all the places that do callschedule(). I removed the direct reference tocyclic_run(), because we shouldn't have two public functions for doing roughly the same without being very explicit about when one should call one or the other.
Quoted 7 lines
Testing of later patches that explicitly include <
schedule.h> whenschedule()is used revealed a problem with host tool build on win32, which apparently picked up a host <schedule.h>. To avoid that problem, put the new header ininclude/u-boot/and hence make the include statements say <u-boot/schedule.h>.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 76 lines
--- common/cyclic.c | 1 + include/cyclic.h | 12 +----------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-)create mode 100644
include/u-boot/schedule.hcommon/cyclic.c +1
-0@@ -15,6 +15,7 @@#include <linux/errno.h> #include <linux/list.h> #include <asm/global_data.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR ;include/cyclic.h +1
-11@@ -13,6 +13,7 @@#include <linux/list.h> #include <asm/types.h> +#include <u-boot/schedule.h> // to be removed later /** * struct cyclic_info - Information about cyclic execution function @@ -94,13 +95,6 @@ struct hlist_head *cyclic_get_list(void);*/ void cyclic_run (void ); -/** -* schedule() - Schedule all potentially waiting tasks -* -* Basically a wrapper for cyclic_run(), pontentially enhanced by some -* other parts, that need to get handled periodically. -*/ -void schedule (void );#else static inline void cyclic_register(struct cyclic_info *cyclic, cyclic_func_t func,@@ -116,10 +110,6 @@ static inline void cyclic_run(void) { } -static inline void schedule (void ) -{ -} -static inline int cyclic_unregister_all (void ) {return 0 ;include/u-boot/schedule.h new file +14
-0@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef _U_BOOT_SCHEDULE_H +#define _U_BOOT_SCHEDULE_H + +#if CONFIG_IS_ENABLED (CYCLIC ) +/** +* schedule() - Schedule all potentially waiting tasks +* +* Run all pending tasks registered via the cyclic framework, and +* potentially perform other actions that need to be done +* periodically. +*/ +void schedule (void );
include/u-boot/schedule.h line 24
Quoted 10 lines
include/u-boot/schedule.h new file +10
-0+ +#else + +static inline void schedule (void ) +{ +} + +#endif + +#endif
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 3/13 led: include cyclic.h in led_sw_blink.c
In reply to Rasmus VillemoesThis makes use of the cyclic API but relies on implicitly getting the appropriate declarations through some nested include. Include the cyclic.h header directly.
--- drivers/led/led_sw_blink.c | 1 + 1 file changed, 1 insertion(+)
drivers/led/led_sw_blink.c +1 -0
@@ -5,6 +5,7 @@* Author: Mikhail Kshevetskiy <[email protected]> */ +#include <cyclic.h> #include <dm.h> #include <led.h> #include <time.h>
Signature · 1 line
2.46.2
Re: [PATCH 03/13] led: include cyclic.h in led_sw_blink.c
Quoted 10 lines · Rasmus Villemoes
This makes use of the cyclic API but relies on implicitly getting the appropriate declarations through some nested include. Include the
cyclic.hheader directly.Signed-off-by Rasmus Villemoes <[email protected]>--- drivers/led/led_sw_blink.c | 1 + 1 file changed, 1 insertion(+)
Quoted 15 lines
drivers/led/led_sw_blink.c +1
-1@@ -5,6 +5,7 @@* Author: Mikhail Kshevetskiy <[email protected]> */ +#include <cyclic.h> #include <dm.h> #include <led.h> #include <time.h> --2.46.2
Re: [PATCH 03/13] led: include cyclic.h in led_sw_blink.c
In reply to Rasmus VillemoesQuoted 5 lines · Rasmus Villemoes
This makes use of the cyclic API but relies on implicitly getting the appropriate declarations through some nested include. Include the
cyclic.hheader directly.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- drivers/led/led_sw_blink.c | 1 + 1 file changed, 1 insertion(+)drivers/led/led_sw_blink.c +0
-0
drivers/led/led_sw_blink.c line 11
Quoted 7 lines
drivers/led/led_sw_blink.c +1
-0@@ -5,6 +5,7 @@* Author: Mikhail Kshevetskiy <[email protected]> */ +#include <cyclic.h> #include <dm.h> #include <led.h> #include <time.h>
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 4/13 m68k: asm/ptrace.h: include linux/types.h
In reply to Rasmus VillemoesModifying a generic header like watchdog.h, removing not directly used #includes, can apparently break the build of m68k, because the asm/ptrace.h header relies on whoever includes it to already have included something that defines the type ulong.
Make the asm/ptrace.h header self-contained by including the proper header.
--- arch/m68k/include/asm/ptrace.h | 2 ++ 1 file changed, 2 insertions(+)
arch/m68k/include/asm/ptrace.h +2 -0
@@ -9,6 +9,8 @@*/ #ifndef __ASSEMBLY__ +#include <linux/types.h> + struct pt_regs { ulong d0; ulong d1;
Signature · 1 line
2.46.2
Re: [PATCH 04/13] m68k: asm/ptrace.h: include linux/types.h
Quoted 9 lines · Rasmus Villemoes
Modifying a generic header like
watchdog.h, removing not directly used #includes, can apparently break the build of m68k, because theasm/ptrace.hheader relies on whoever includes it to already have included something that defines the type ulong.Make the
asm/ptrace.hheader self-contained by including the proper header.Signed-off-by Rasmus Villemoes <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 04/13] m68k: asm/ptrace.h: include linux/types.h
In reply to Rasmus VillemoesQuoted 9 lines · Rasmus Villemoes
Modifying a generic header like
watchdog.h, removing not directly used #includes, can apparently break the build of m68k, because theasm/ptrace.hheader relies on whoever includes it to already have included something that defines the type ulong.Make the
asm/ptrace.hheader self-contained by including the proper header.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- arch/m68k/include/asm/ptrace.h | 2 ++ 1 file changed, 2 insertions(+)arch/m68k/include/asm/ptrace.h +0
-0
arch/m68k/include/asm/ptrace.h line 16
Quoted 8 lines
arch/m68k/include/asm/ptrace.h +2
-0@@ -9,6 +9,8 @@*/ #ifndef __ASSEMBLY__ +#include <linux/types.h> + struct pt_regs { ulong d0; ulong d1;
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 5/13 fs/cramfs: use schedule instead of cyclic_run as callback
In reply to Rasmus VillemoesPrior to commit 29caf9305b6f ("cyclic: Use schedule() instead of WATCHDOG_RESET()") we had
/* Currently only needed for fs/cramfs/uncompress.c */ static inline void watchdog_reset_func(void)
{
WATCHDOG_RESET();
}and .outcb was set to that watchdog_reset_func(). Said commit changed that .outcb to cyclic_run instead of schedule, which would otherwise match all the other WATCHDOG_RESET replacements done. As the HW_WATCHDOG case is not handled by cyclic_run, this seems to be an oversight.
--- fs/cramfs/uncompress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cramfs/uncompress.c +2 -2
@@ -21,9 +21,9 @@*/ #include <stdio.h> -#include <cyclic.h> #include <malloc.h> #include <watchdog.h> +#include <u-boot/schedule.h> #include <u-boot/zlib.h> static z_stream stream;
@@ -63,7 +63,7 @@ int cramfs_uncompress_init (void) stream.avail_in =0 ;#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG ) - stream.outcb = (cb_func )cyclic_run; + stream.outcb = (cb_func )schedule;#else stream.outcb =Z_NULL ;#endif /* CONFIG_HW_WATCHDOG */
Signature · 1 line
2.46.2
Re: [PATCH 05/13] fs/cramfs: use schedule instead of cyclic_run as callback
Quoted 16 lines · Rasmus Villemoes
Prior to commit
29caf9305b6f("cyclic: Useschedule()instead ofWATCHDOG_RESET()") we had/* Currently only needed for
fs/cramfs/uncompress.c*/ static inline voidwatchdog_reset_func(void){ WATCHDOG_RESET(); }and .outcb was set to that
watchdog_reset_func(). Said commit changed that .outcb tocyclic_runinstead of schedule, which would otherwise match all the otherWATCHDOG_RESETreplacements done. As theHW_WATCHDOGcase is not handled bycyclic_run, this seems to be an oversight.
Quoted 4 lines
Signed-off-by Rasmus Villemoes <[email protected]>--- fs/cramfs/uncompress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 28 lines
fs/cramfs/uncompress.c +2
-3@@ -21,9 +21,9 @@*/ #include <stdio.h> -#include <cyclic.h> #include <malloc.h> #include <watchdog.h> +#include <u-boot/schedule.h> #include <u-boot/zlib.h> static z_stream stream;@@ -63,7 +63,7 @@ int cramfs_uncompress_init (void) stream.avail_in =0 ;#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG ) - stream.outcb = (cb_func )cyclic_run; + stream.outcb = (cb_func )schedule;#else stream.outcb =Z_NULL ;#endif /* CONFIG_HW_WATCHDOG */ --2.46.2
Re: [PATCH 05/13] fs/cramfs: use schedule instead of cyclic_run as callback
In reply to Rasmus VillemoesQuoted 9 lines · Rasmus Villemoes
Prior to commit
29caf9305b6f("cyclic: Useschedule()instead ofWATCHDOG_RESET()") we had/* Currently only needed for
fs/cramfs/uncompress.c*/ static inline voidwatchdog_reset_func(void){ WATCHDOG_RESET(); }
Quoted 7 lines
and .outcb was set to that
watchdog_reset_func(). Said commit changed that .outcb tocyclic_runinstead of schedule, which would otherwise match all the otherWATCHDOG_RESETreplacements done. As theHW_WATCHDOGcase is not handled bycyclic_run, this seems to be an oversight.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 20 lines
--- fs/cramfs/uncompress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/cramfs/uncompress.c +1
-1@@ -21,9 +21,9 @@*/ #include <stdio.h> -#include <cyclic.h> #include <malloc.h> #include <watchdog.h> +#include <u-boot/schedule.h> #include <u-boot/zlib.h> static z_stream stream;
fs/cramfs/uncompress.c int cramfs_uncompress_init (void) · line 69
Quoted 8 lines
fs/cramfs/uncompress.c +1
-1@@ -63,7 +63,7 @@ int cramfs_uncompress_init (void) stream.avail_in =0 ;#if defined(CONFIG_HW_WATCHDOG ) || defined(CONFIG_WATCHDOG ) - stream.outcb = (cb_func )cyclic_run; + stream.outcb = (cb_func )schedule;#else stream.outcb =Z_NULL ;#endif /* CONFIG_HW_WATCHDOG */
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 6/13 test: dm: wdt: replace cyclic_run() by schedule()
In reply to Rasmus VillemoesThis is the last place outside of cyclic.c that references cyclic_run() directly. Replace by schedule(), so that cyclic_run() can be made private. This also better matches what I believe commit 29caf9305b6f ("cyclic: Use schedule() instead of WATCHDOG_RESET()") intended to do.
--- test/dm/wdt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
test/dm/wdt.c +5 -5
@@ -3,7 +3,6 @@* Copyright 2017 Google, Inc */ -#include <cyclic.h> #include <dm.h> #include <time.h> #include <wdt.h>
@@ -14,6 +13,7 @@#include <test/test.h> #include <test/ut.h> #include <linux/delay.h> +#include <u-boot/schedule.h> #include <watchdog.h> /* Test that watchdog driver functions are called */
@@ -131,7 +131,7 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)/* Neither device should be "started", so watchdog_reset() should be a no-op. */ reset_count = state->wdt.reset_count; val =sandbox_gpio_get_value (gpio, offset); -cyclic_run (); +schedule ();ut_asserteq (reset_count, state->wdt.reset_count);ut_asserteq (val,sandbox_gpio_get_value (gpio, offset));
@@ -141,19 +141,19 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)/* Make sure both devices have just been pinged. */ timer_test_add_offset (100 ); -cyclic_run (); +schedule (); reset_count = state->wdt.reset_count; val =sandbox_gpio_get_value (gpio, offset);/* The gpio watchdog should be pinged, the sandbox one not. */ timer_test_add_offset (30 ); -cyclic_run (); +schedule ();ut_asserteq (reset_count, state->wdt.reset_count);ut_asserteq (!val,sandbox_gpio_get_value (gpio, offset));/* After another ~30ms, both devices should get pinged. */ timer_test_add_offset (30 ); -cyclic_run (); +schedule ();ut_asserteq (reset_count +1 , state->wdt.reset_count);ut_asserteq (val,sandbox_gpio_get_value (gpio, offset));
Signature · 1 line
2.46.2
Re: [PATCH 06/13] test: dm: wdt: replace cyclic_run() by schedule()
Quoted 11 lines · Rasmus Villemoes
This is the last place outside of
cyclic.cthat referencescyclic_run()directly. Replace byschedule(), so thatcyclic_run()can be made private. This also better matches what I believe commit29caf9305b6f("cyclic: Useschedule()instead ofWATCHDOG_RESET()") intended to do.Signed-off-by Rasmus Villemoes <[email protected]>--- test/dm/wdt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Re: [PATCH 06/13] test: dm: wdt: replace cyclic_run() by schedule()
In reply to Rasmus VillemoesQuoted 7 lines · Rasmus Villemoes
This is the last place outside of
cyclic.cthat referencescyclic_run()directly. Replace byschedule(), so thatcyclic_run()can be made private. This also better matches what I believe commit29caf9305b6f("cyclic: Useschedule()instead ofWATCHDOG_RESET()") intended to do.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 46 lines
--- test/dm/wdt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)test/dm/wdt.c +4
-4@@ -3,7 +3,6 @@* Copyright 2017 Google, Inc */ -#include <cyclic.h> #include <dm.h> #include <time.h> #include <wdt.h> @@ -14,6 +13,7 @@#include <test/test.h> #include <test/ut.h> #include <linux/delay.h> +#include <u-boot/schedule.h> #include <watchdog.h> /* Test that watchdog driver functions are called */ @@ -131,7 +131,7 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)/* Neither device should be "started", so watchdog_reset() should be a no-op. */ reset_count = state->wdt.reset_count; val =sandbox_gpio_get_value (gpio, offset); -cyclic_run (); +schedule ();ut_asserteq (reset_count, state->wdt.reset_count);ut_asserteq (val,sandbox_gpio_get_value (gpio, offset));@@ -141,19 +141,19 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts)/* Make sure both devices have just been pinged. */ timer_test_add_offset (100 ); -cyclic_run (); +schedule (); reset_count = state->wdt.reset_count; val =sandbox_gpio_get_value (gpio, offset);/* The gpio watchdog should be pinged, the sandbox one not. */ timer_test_add_offset (30 ); -cyclic_run (); +schedule ();
test/dm/wdt.c static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts) · line 159
Quoted 10 lines
test/dm/wdt.c +1
-1ut_asserteq (reset_count, state->wdt.reset_count);ut_asserteq (!val,sandbox_gpio_get_value (gpio, offset));/* After another ~30ms, both devices should get pinged. */ timer_test_add_offset (30 ); -cyclic_run (); +schedule ();ut_asserteq (reset_count +1 , state->wdt.reset_count);ut_asserteq (val,sandbox_gpio_get_value (gpio, offset));
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 7/13 cyclic: make cyclic_run static
In reply to Rasmus VillemoesThe only caller left is schedule(); everybody outside cyclic.c now calls or references schedule().
--- common/cyclic.c | 2 +- include/cyclic.h | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-)
common/cyclic.c +1 -1
@@ -45,7 +45,7 @@ void cyclic_unregister(struct cyclic_info *cyclic)hlist_del (&cyclic->list); } -void cyclic_run (void ) +static void cyclic_run (void ) {struct cyclic_info *cyclic;struct hlist_node *tmp;
include/cyclic.h +0 -12
@@ -87,14 +87,6 @@ int cyclic_unregister_all(void);*/ struct hlist_head *cyclic_get_list (void ); -/** -* cyclic_run() - Interate over all registered cyclic functions -* -* Interate over all registered cyclic functions and if the it's function -* needs to be executed, then call into these registered functions. -*/ -void cyclic_run (void ); -#else static inline void cyclic_register(struct cyclic_info *cyclic, cyclic_func_t func,
@@ -106,10 +98,6 @@ static inline void cyclic_unregister(struct cyclic_info *cyclic) { } -static inline void cyclic_run (void ) -{ -} -static inline int cyclic_unregister_all (void ) {return 0 ;
Signature · 1 line
2.46.2
Re: [PATCH 07/13] cyclic: make cyclic_run static
Quoted 9 lines · Rasmus Villemoes
The only caller left is
schedule(); everybody outsidecyclic.cnow calls or referencesschedule().Signed-off-by Rasmus Villemoes <[email protected]>--- common/cyclic.c | 2 +- include/cyclic.h | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-)
Re: [PATCH 07/13] cyclic: make cyclic_run static
In reply to Rasmus VillemoesQuoted 4 lines · Rasmus Villemoes
The only caller left is
schedule(); everybody outsidecyclic.cnow calls or referencesschedule().Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 38 lines
--- common/cyclic.c | 2 +- include/cyclic.h | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-)common/cyclic.c +1
-1@@ -45,7 +45,7 @@ void cyclic_unregister(struct cyclic_info *cyclic)hlist_del (&cyclic->list); } -void cyclic_run (void ) +static void cyclic_run (void ) {struct cyclic_info *cyclic;struct hlist_node *tmp;include/cyclic.h +0
-8@@ -87,14 +87,6 @@ int cyclic_unregister_all(void);*/ struct hlist_head *cyclic_get_list (void ); -/** -* cyclic_run() - Interate over all registered cyclic functions -* -* Interate over all registered cyclic functions and if the it's function -* needs to be executed, then call into these registered functions. -*/ -void cyclic_run (void ); -#else static inline void cyclic_register(struct cyclic_info *cyclic, cyclic_func_t func,
include/cyclic.h static inline void cyclic_unregister(struct cyclic_info *cyclic) · line 103
Quoted 10 lines
include/cyclic.h +0
-4@@ -106,10 +98,6 @@ static inline void cyclic_unregister(struct cyclic_info *cyclic) { } -static inline void cyclic_run (void ) -{ -} -static inline int cyclic_unregister_all (void ) {return 0 ;
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 8/13 watchdog.h: change include of cyclic.h to u-boot/schedule.h
In reply to Rasmus VillemoesNobody relies on getting the cyclic API declared by including the watchdog.h header, but for historical reasons, many TUs include watchdog.h to get a declaration of schedule(). Now that we have a dedicated header for just that, include that header instead of cyclic.h.
Eventually, all TUs that call schedule() should themselves include u-boot/schedule.h, but this is a step towards getting rid of unnecessary include statements in cyclic.h and global_data.h.
--- include/watchdog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/watchdog.h +1 -1
@@ -10,7 +10,7 @@#ifndef _WATCHDOG_H_#define _WATCHDOG_H_ -#include <cyclic.h> +#include <u-boot/schedule.h> // to be removed later /* * Reset the watchdog timer, always returns 0
Signature · 1 line
2.46.2
Re: [PATCH 08/13] watchdog.h: change include of cyclic.h to u-boot/schedule.h
Quoted 7 lines · Rasmus Villemoes
Nobody relies on getting the cyclic API declared by including the
watchdog.hheader, but for historical reasons, many TUs includewatchdog.hto get a declaration ofschedule(). Now that we have a dedicated header for just that, include that header instead ofcyclic.h.
Quoted 8 lines
Eventually, all TUs that call
schedule()should themselves includeu-boot/schedule.h, but this is a step towards getting rid of unnecessary include statements incyclic.handglobal_data.h.Signed-off-by Rasmus Villemoes <[email protected]>--- include/watchdog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 08/13] watchdog.h: change include of cyclic.h to u-boot/schedule.h
In reply to Rasmus VillemoesQuoted 11 lines · Rasmus Villemoes
Nobody relies on getting the cyclic API declared by including the
watchdog.hheader, but for historical reasons, many TUs includewatchdog.hto get a declaration ofschedule(). Now that we have a dedicated header for just that, include that header instead ofcyclic.h.Eventually, all TUs that call
schedule()should themselves includeu-boot/schedule.h, but this is a step towards getting rid of unnecessary include statements incyclic.handglobal_data.h.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- include/watchdog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/watchdog.h +0
-0
include/watchdog.h line 16
Quoted 8 lines
include/watchdog.h +1
-1@@ -10,7 +10,7 @@#ifndef _WATCHDOG_H_#define _WATCHDOG_H_ -#include <cyclic.h> +#include <u-boot/schedule.h> // to be removed later /* * Reset the watchdog timer, always returns 0
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 9/13 lib/sha*: include u-boot/schedule.h instead of cyclic.h
In reply to Rasmus VillemoesThese library routines obviously do not make use of the cyclic_register() etc. API, but do need to call schedule(). Include the proper header.
Eventually, their ifdef logic should be updated to avoid talking about CONFIG_WATCHDOG.
--- lib/sha1.c | 2 +- lib/sha256.c | 2 +- lib/sha512.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
lib/sha1.c +1 -1
@@ -17,7 +17,7 @@#endif #ifndef USE_HOSTCC -#include <cyclic.h> +#include <u-boot/schedule.h> #endif /* USE_HOSTCC */ #include <string.h> #include <u-boot/sha1.h>
lib/sha256.c +1 -1
@@ -6,7 +6,7 @@*/ #ifndef USE_HOSTCC -#include <cyclic.h> +#include <u-boot/schedule.h> #endif /* USE_HOSTCC */ #include <string.h> #include <u-boot/sha256.h>
lib/sha512.c +1 -1
@@ -11,7 +11,7 @@*/ #ifndef USE_HOSTCC -#include <cyclic.h> +#include <u-boot/schedule.h> #endif /* USE_HOSTCC */ #include <compiler.h> #include <u-boot/sha512.h>
Signature · 1 line
2.46.2
Re: [PATCH 09/13] lib/sha*: include u-boot/schedule.h instead of cyclic.h
Quoted 8 lines · Rasmus Villemoes
These library routines obviously do not make use of the
cyclic_register()etc. API, but do need to callschedule(). Include the proper header.Eventually, their ifdef logic should be updated to avoid talking about
CONFIG_WATCHDOG.
Quoted 6 lines
Signed-off-by Rasmus Villemoes <[email protected]>--- lib/sha1.c | 2 +- lib/sha256.c | 2 +- lib/sha512.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Re: [PATCH 09/13] lib/sha*: include u-boot/schedule.h instead of cyclic.h
In reply to Rasmus VillemoesQuoted 8 lines · Rasmus Villemoes
These library routines obviously do not make use of the
cyclic_register()etc. API, but do need to callschedule(). Include the proper header.Eventually, their ifdef logic should be updated to avoid talking about
CONFIG_WATCHDOG.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 37 lines
--- lib/sha1.c | 2 +- lib/sha256.c | 2 +- lib/sha512.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)lib/sha1.c +1
-1@@ -17,7 +17,7 @@#endif #ifndef USE_HOSTCC -#include <cyclic.h> +#include <u-boot/schedule.h> #endif /* USE_HOSTCC */ #include <string.h> #include <u-boot/sha1.h> lib/sha256.c +1
-1@@ -6,7 +6,7 @@*/ #ifndef USE_HOSTCC -#include <cyclic.h> +#include <u-boot/schedule.h> #endif /* USE_HOSTCC */ #include <string.h> #include <u-boot/sha256.h> lib/sha512.c +0
-0
lib/sha512.c line 17
Quoted 8 lines
lib/sha512.c +1
-1@@ -11,7 +11,7 @@*/ #ifndef USE_HOSTCC -#include <cyclic.h> +#include <u-boot/schedule.h> #endif /* USE_HOSTCC */ #include <compiler.h> #include <u-boot/sha512.h>
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 10/13 i2c: rzg2l: include u-boot/schedule.h
In reply to Rasmus VillemoesThis TU currently relies on getting a declaration of schedule() through some nested include. Include the proper header directly.
--- drivers/i2c/rz_riic.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/rz_riic.c +1 -0
@@ -14,6 +14,7 @@#include <linux/bitops.h> #include <linux/delay.h> #include <reset.h> +#include <u-boot/schedule.h> #include <wait_bit.h> #define RIIC_ICCR1 0x00
Signature · 1 line
2.46.2
Re: [PATCH 10/13] i2c: rzg2l: include u-boot/schedule.h
Quoted 9 lines · Rasmus Villemoes
This TU currently relies on getting a declaration of
schedule()through some nested include. Include the proper header directly.Signed-off-by Rasmus Villemoes <[email protected]>--- drivers/i2c/rz_riic.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/rz_riic.c line 18
Quoted 10 lines
drivers/i2c/rz_riic.c +1
-0@@ -14,6 +14,7 @@#include <linux/bitops.h> #include <linux/delay.h> #include <reset.h> +#include <u-boot/schedule.h> #include <wait_bit.h>
dodgy header-order here, although it predates this patch.
Quoted 5 lines
drivers/i2c/rz_riic.c +0
-1#define RIIC_ICCR1 0x00 --2.46.2
Re: [PATCH 10/13] i2c: rzg2l: include u-boot/schedule.h
In reply to Rasmus VillemoesQuoted 4 lines · Rasmus Villemoes
This TU currently relies on getting a declaration of
schedule()through some nested include. Include the proper header directly.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- drivers/i2c/rz_riic.c | 1 + 1 file changed, 1 insertion(+)drivers/i2c/rz_riic.c +0
-0
drivers/i2c/rz_riic.c line 20
Quoted 7 lines
drivers/i2c/rz_riic.c +1
-0@@ -14,6 +14,7 @@#include <linux/bitops.h> #include <linux/delay.h> #include <reset.h> +#include <u-boot/schedule.h> #include <wait_bit.h> #define RIIC_ICCR1 0x00
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 11/13 ddr: altera: include u-boot/schedule.h
In reply to Rasmus VillemoesThese TUs currently rely on getting a declaration of schedule() through some nested include. Include the proper header directly.
--- drivers/ddr/altera/sdram_n5x.c | 1 + drivers/ddr/altera/sdram_soc64.c | 1 + 2 files changed, 2 insertions(+)
drivers/ddr/altera/sdram_n5x.c +1 -0
@@ -22,6 +22,7 @@#include <asm/io.h> #include <linux/err.h> #include <linux/sizes.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR ;
drivers/ddr/altera/sdram_soc64.c +1 -0
@@ -24,6 +24,7 @@#include <asm/io.h> #include <dm/device_compat.h> #include <linux/sizes.h> +#include <u-boot/schedule.h> #define PGTABLE_OFF 0x4000
Signature · 1 line
2.46.2
Re: [PATCH 11/13] ddr: altera: include u-boot/schedule.h
Quoted 9 lines · Rasmus Villemoes
These TUs currently rely on getting a declaration of
schedule()through some nested include. Include the proper header directly.Signed-off-by Rasmus Villemoes <[email protected]>--- drivers/ddr/altera/sdram_n5x.c | 1 + drivers/ddr/altera/sdram_soc64.c | 1 + 2 files changed, 2 insertions(+)
Quoted 28 lines
drivers/ddr/altera/sdram_n5x.c +1
-0@@ -22,6 +22,7 @@#include <asm/io.h> #include <linux/err.h> #include <linux/sizes.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR ;drivers/ddr/altera/sdram_soc64.c +1
-1@@ -24,6 +24,7 @@#include <asm/io.h> #include <dm/device_compat.h> #include <linux/sizes.h> +#include <u-boot/schedule.h> #define PGTABLE_OFF 0x4000 --2.46.2
Re: [PATCH 11/13] ddr: altera: include u-boot/schedule.h
In reply to Rasmus VillemoesQuoted 4 lines · Rasmus Villemoes
These TUs currently rely on getting a declaration of
schedule()through some nested include. Include the proper header directly.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 22 lines
--- drivers/ddr/altera/sdram_n5x.c | 1 + drivers/ddr/altera/sdram_soc64.c | 1 + 2 files changed, 2 insertions(+)drivers/ddr/altera/sdram_n5x.c +1
-0@@ -22,6 +22,7 @@#include <asm/io.h> #include <linux/err.h> #include <linux/sizes.h> +#include <u-boot/schedule.h> DECLARE_GLOBAL_DATA_PTR ;drivers/ddr/altera/sdram_soc64.c +0
-0
drivers/ddr/altera/sdram_soc64.c line 30
Quoted 7 lines
drivers/ddr/altera/sdram_soc64.c +1
-0@@ -24,6 +24,7 @@#include <asm/io.h> #include <dm/device_compat.h> #include <linux/sizes.h> +#include <u-boot/schedule.h> #define PGTABLE_OFF 0x4000
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 12/13 boot: cedit: include u-boot/schedule.h
In reply to Rasmus VillemoesThis TU currently relies on getting a declaration of schedule() through some nested include. Include the proper header directly.
--- boot/cedit.c | 1 + 1 file changed, 1 insertion(+)
boot/cedit.c +1 -0
@@ -20,6 +20,7 @@#include <video.h> #include <linux/delay.h> #include "scene_internal.h" +#include <u-boot/schedule.h> enum {CMOS_MAX_BITS =2048 ,
Signature · 1 line
2.46.2
Re: [PATCH 12/13] boot: cedit: include u-boot/schedule.h
Quoted 9 lines · Rasmus Villemoes
This TU currently relies on getting a declaration of
schedule()through some nested include. Include the proper header directly.Signed-off-by Rasmus Villemoes <[email protected]>--- boot/cedit.c | 1 + 1 file changed, 1 insertion(+)
Quoted 15 lines
boot/cedit.c +1
-1@@ -20,6 +20,7 @@#include <video.h> #include <linux/delay.h> #include "scene_internal.h" +#include <u-boot/schedule.h> enum {CMOS_MAX_BITS =2048 , --2.46.2
Re: [PATCH 12/13] boot: cedit: include u-boot/schedule.h
In reply to Rasmus VillemoesQuoted 4 lines · Rasmus Villemoes
This TU currently relies on getting a declaration of
schedule()through some nested include. Include the proper header directly.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- boot/cedit.c | 1 + 1 file changed, 1 insertion(+)boot/cedit.c +0
-0
boot/cedit.c line 26
Quoted 7 lines
boot/cedit.c +1
-0@@ -20,6 +20,7 @@#include <video.h> #include <linux/delay.h> #include "scene_internal.h" +#include <u-boot/schedule.h> enum {CMOS_MAX_BITS =2048 ,
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH 13/13 global_data.h: remove unnecesary include of cyclic.h
In reply to Rasmus VillemoesNothing in cyclic.h is needed to define struct global_data, so do not include that header.
If any .c file relies on getting cyclic.h through asm/global_data.h, it needs to include it itself.
--- include/asm-generic/global_data.h | 1 - 1 file changed, 1 deletion(-)
include/asm-generic/global_data.h +0 -1
@@ -20,7 +20,6 @@*/ #ifndef __ASSEMBLY__ -#include <cyclic.h> #include <event_internal.h> #include <fdtdec.h> #include <membuff.h>
Signature · 1 line
2.46.2
Re: [PATCH 13/13] global_data.h: remove unnecesary include of cyclic.h
Quoted 7 lines · Rasmus Villemoes
Nothing in
cyclic.his needed to define structglobal_data, so do not include that header.If any .c file relies on getting
cyclic.hthroughasm/global_data.h, it needs to include it itself.Signed-off-by Rasmus Villemoes <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 13/13] global_data.h: remove unnecesary include of cyclic.h
In reply to Rasmus VillemoesQuoted 7 lines · Rasmus Villemoes
Nothing in
cyclic.his needed to define structglobal_data, so do not include that header.If any .c file relies on getting
cyclic.hthroughasm/global_data.h, it needs to include it itself.Signed-off-by Rasmus Villemoes <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- include/asm-generic/global_data.h | 1 - 1 file changed, 1 deletion(-)include/asm-generic/global_data.h +0
-0
include/asm-generic/global_data.h line 25
Quoted 7 lines
include/asm-generic/global_data.h +0
-1@@ -20,7 +20,6 @@*/ #ifndef __ASSEMBLY__ -#include <cyclic.h> #include <event_internal.h> #include <fdtdec.h> #include <membuff.h>
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Hi Rasmus,
Quoted 57 lines · Rasmus Villemoes
These patches are part of a longer-term plan to properly deal with the
HW_WATCHDOGvs WATCHDOG dichotomy, and getting rid of the legacyHW_WATCHDOGconcept completely. As part of that, clean up which headers include other headers.While
schedule(), the artist formerly known asWATCHDOG_RESET(), is obviously called all over the tree, very few TUs make use of the cyclic API (cyclic_registeretc.). And there's really no reason at all forglobal_data.hto includecyclic.h- except that some places implicitly rely on getting their declaration ofschedule()through that include.So this introduces a separate mostly trivial header that just serves to declare
schedule(). Then we can get rid of things that includecyclic.hjust to get that declaration.A next, mostly mechanical step, could be to change almost all includes of
watchdog.h(which most TUs that used to have aWATCHDOG_RESET()invocation has) tou-boot/schedule.h, because again, most of those TUs are not really concerned with implementinginit_func_watchdog_initor need to call it. But that is for later.CI seems happy: https://github.com/u-boot/u-boot/pull/673
Rasmus Villemoes (13):
doc: cyclic: remove reference toWATCHDOG_RESET
cyclic: introduceu-boot/schedule.h
led: includecyclic.hinled_sw_blink.c
m68k:asm/ptrace.h: includelinux/types.hfs/cramfs: use schedule instead ofcyclic_runas callback
test: dm: wdt: replacecyclic_run()byschedule()
cyclic: makecyclic_runstatic
watchdog.h: change include ofcyclic.htou-boot/schedule.hlib/sha*: includeu-boot/schedule.hinstead ofcyclic.h
i2c: rzg2l: includeu-boot/schedule.h
ddr: altera: includeu-boot/schedule.h
boot: cedit: includeu-boot/schedule.hglobal_data.h: remove unnecesary include ofcyclic.harch/m68k/include/asm/ptrace.h | 2 ++ boot/cedit.c | 1 + common/cyclic.c | 3 ++- doc/develop/cyclic.rst | 10 +++++----- drivers/ddr/altera/sdram_n5x.c | 1 + drivers/ddr/altera/sdram_soc64.c | 1 + drivers/i2c/rz_riic.c | 1 + drivers/led/led_sw_blink.c | 1 + fs/cramfs/uncompress.c | 4 ++-- include/asm-generic/global_data.h | 1 - include/cyclic.h | 24 +----------------------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ include/watchdog.h | 2 +- lib/sha1.c | 2 +- lib/sha256.c | 2 +- lib/sha512.c | 2 +- test/dm/wdt.c | 10 +++++----- 17 files changed, 50 insertions(+), 41 deletions(-)
Quoted 1 line
create mode 100644
include/u-boot/schedule.h
Thanks for this work - really appreciated. I'm leaving for vacation pretty soon. Will take a closer look at these patches in roughly 2 weeks.
Thanks,
Stefan
Quoted 57 lines · Rasmus Villemoes
These patches are part of a longer-term plan to properly deal with the
HW_WATCHDOGvs WATCHDOG dichotomy, and getting rid of the legacyHW_WATCHDOGconcept completely. As part of that, clean up which headers include other headers.While
schedule(), the artist formerly known asWATCHDOG_RESET(), is obviously called all over the tree, very few TUs make use of the cyclic API (cyclic_registeretc.). And there's really no reason at all forglobal_data.hto includecyclic.h- except that some places implicitly rely on getting their declaration ofschedule()through that include.So this introduces a separate mostly trivial header that just serves to declare
schedule(). Then we can get rid of things that includecyclic.hjust to get that declaration.A next, mostly mechanical step, could be to change almost all includes of
watchdog.h(which most TUs that used to have aWATCHDOG_RESET()invocation has) tou-boot/schedule.h, because again, most of those TUs are not really concerned with implementinginit_func_watchdog_initor need to call it. But that is for later.CI seems happy: https://github.com/u-boot/u-boot/pull/673
Rasmus Villemoes (13):
doc: cyclic: remove reference toWATCHDOG_RESET
cyclic: introduceu-boot/schedule.h
led: includecyclic.hinled_sw_blink.c
m68k:asm/ptrace.h: includelinux/types.hfs/cramfs: use schedule instead ofcyclic_runas callback
test: dm: wdt: replacecyclic_run()byschedule()
cyclic: makecyclic_runstatic
watchdog.h: change include ofcyclic.htou-boot/schedule.hlib/sha*: includeu-boot/schedule.hinstead ofcyclic.h
i2c: rzg2l: includeu-boot/schedule.h
ddr: altera: includeu-boot/schedule.h
boot: cedit: includeu-boot/schedule.hglobal_data.h: remove unnecesary include ofcyclic.harch/m68k/include/asm/ptrace.h | 2 ++ boot/cedit.c | 1 + common/cyclic.c | 3 ++- doc/develop/cyclic.rst | 10 +++++----- drivers/ddr/altera/sdram_n5x.c | 1 + drivers/ddr/altera/sdram_soc64.c | 1 + drivers/i2c/rz_riic.c | 1 + drivers/led/led_sw_blink.c | 1 + fs/cramfs/uncompress.c | 4 ++-- include/asm-generic/global_data.h | 1 - include/cyclic.h | 24 +----------------------- include/u-boot/schedule.h | 24 ++++++++++++++++++++++++ include/watchdog.h | 2 +- lib/sha1.c | 2 +- lib/sha256.c | 2 +- lib/sha512.c | 2 +- test/dm/wdt.c | 10 +++++----- 17 files changed, 50 insertions(+), 41 deletions(-)
Quoted 2 lines
create mode 100644
include/u-boot/schedule.h
Applied to u-boot-watchdog/master
Thanks,
Stefan