Skip to contentSkip to conversation

common/board_r: make sure to call initr_dm() before initr_trace()

PATCH New Heinrich Schuchardt 3 participants 6 messages Nov 12, 2020 – Nov 19, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 common/board_r: make sure to call initr_dm() before initr_trace()

Quoted 24 lines · Pragnesh Patel

Tracing need timer ticks and initr_dm() will make gd->timer and gd->dm_root is equal to NULL, so make sure that initr_dm() to call before tracing got enabled.

---
 common/board_r.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c +3 -0
index 29dd7d26d9..7140a39947 100644
@@ -693,6 +693,9 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 static init_fnc_t init_sequence_r[] = {
+#ifdef CONFIG_DM
+	initr_dm,
+#endif
 	initr_trace,
 	initr_reloc,
 	/* TODO: could x86/PPC have this also perhaps? */

common/board_r.c static init_fnc_t init_sequence_r[] = { · line 723

Quoted 6 lines
common/board_r.c +0 -3
@@ -718,9 +721,6 @@ static init_fnc_t init_sequence_r[] = {
 	initr_noncached,
 #endif
 	initr_of_live,
-#ifdef CONFIG_DM
-	initr_dm,
-#endif

You are moving initr_of_live before initr_of_live. I doubt this will work for boards that have CONFIG_OF_LIVE=y.

Can't we move initr_trace down in the code to after both initr_of_live and initr_dm?

@Simon:
Please, advise.

Best regards

Heinrich

Quoted 4 lines
common/board_r.c +0 -0
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
 	defined(CONFIG_SANDBOX)
 	board_init,	/* Setup chipselects */
#2 lore raw

PATCH 1/1 common/board_r: make sure to call initr_dm() before initr_trace()

Hi Heinrich,

Quoted 38 lines

-----Original Message-----
From: Heinrich Schuchardt <[email protected]>
Sent: 12 November 2020 18:02
To: Pragnesh Patel <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Simon Glass <[email protected]>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 25 lines · Pragnesh Patel

Tracing need timer ticks and initr_dm() will make gd->timer and gd->dm_root is equal to NULL, so make sure that initr_dm() to call before tracing got enabled.

---
 common/board_r.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c index renamed from common/board_r.c +0 -0

29dd7d26d9..7140a39947 100644

common/board_r.c +4 -0
@@ -693,6 +693,9 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 static init_fnc_t init_sequence_r[] = {
+#ifdef CONFIG_DM
+     initr_dm,
+#endif
      initr_trace,
      initr_reloc,
      /* TODO: could x86/PPC have this also perhaps? */ @@ -718,9
+721,6 @@ static init_fnc_t init_sequence_r[] = {
      initr_noncached,
Quoted 8 lines

common/board_r.c

Quoted 5 lines

#endif
initr_of_live,

common/board_r.c +0 -3
-#ifdef CONFIG_DM
-     initr_dm,
-#endif

You are moving initr_of_live before initr_of_live. I doubt this will work for boards that have CONFIG_OF_LIVE=y.

yes you are right. It will not work for CONFIG_OF_LIVE.

Quoted 6 lines

Can't we move initr_trace down in the code to after both initr_of_live and initr_dm?

@Simon:
Please, advise.

I am okay with this suggestion.

Quoted 10 lines

Best regards

Heinrich

Quoted 1 line

#if defined(CONFIG_ARM) || defined(CONFIG_NDS32) ||

defined(CONFIG_RISCV) || \

Quoted 3 lines

defined(CONFIG_SANDBOX)
board_init, /* Setup chipselects */

#3 lore raw

PATCH 1/1 common/board_r: make sure to call initr_dm() before initr_trace()

Hi,

Quoted 53 lines · Pragnesh Patel

Hi Heinrich,

Quoted 38 lines

-----Original Message-----
From: Heinrich Schuchardt <[email protected]>
Sent: 12 November 2020 18:02
To: Pragnesh Patel <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Simon Glass <[email protected]>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 25 lines · Pragnesh Patel

Tracing need timer ticks and initr_dm() will make gd->timer and gd->dm_root is equal to NULL, so make sure that initr_dm() to call before tracing got enabled.

---
 common/board_r.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c index renamed from common/board_r.c +0 -0

29dd7d26d9..7140a39947 100644

common/board_r.c +4 -0
@@ -693,6 +693,9 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 static init_fnc_t init_sequence_r[] = {
+#ifdef CONFIG_DM
+     initr_dm,
+#endif
      initr_trace,
      initr_reloc,
      /* TODO: could x86/PPC have this also perhaps? */ @@ -718,9
+721,6 @@ static init_fnc_t init_sequence_r[] = {
      initr_noncached,
Quoted 8 lines

common/board_r.c

Quoted 5 lines

#endif
initr_of_live,

common/board_r.c +0 -3
-#ifdef CONFIG_DM
-     initr_dm,
-#endif

You are moving initr_of_live before initr_of_live. I doubt this will work for boards that have CONFIG_OF_LIVE=y.

yes you are right. It will not work for CONFIG_OF_LIVE.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

Can't we move initr_trace down in the code to after both initr_of_live and initr_dm?

@Simon:
Please, advise.

I am okay with this suggestion.

Actually can we use the early timer for this case?

DM init is a part of U-Boot and not being able to trace it would be unfortunate.

Regards,
Simon

#4 lore raw

PATCH 1/1 common/board_r: make sure to call initr_dm() before initr_trace()

Hi,

Quoted 73 lines

-----Original Message-----
From: Simon Glass <[email protected]>
Sent: 17 November 2020 05:23
To: Pragnesh Patel <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>; U-Boot Mailing List <u- boot at lists.denx.de>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Hi,

Quoted 57 lines · Pragnesh Patel

Hi Heinrich,

Quoted 39 lines

-----Original Message-----
From: Heinrich Schuchardt <[email protected]>
Sent: 12 November 2020 18:02
To: Pragnesh Patel <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Simon Glass <[email protected]>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before
initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 25 lines · Pragnesh Patel

Tracing need timer ticks and initr_dm() will make gd->timer and gd->dm_root is equal to NULL, so make sure that initr_dm() to call before tracing got enabled.

---
 common/board_r.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c index renamed from common/board_r.c +0 -0

29dd7d26d9..7140a39947 100644

common/board_r.c +4 -0
@@ -693,6 +693,9 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 static init_fnc_t init_sequence_r[] = {
+#ifdef CONFIG_DM
+     initr_dm,
+#endif
      initr_trace,
      initr_reloc,
      /* TODO: could x86/PPC have this also perhaps? */ @@ -718,9
+721,6 @@ static init_fnc_t init_sequence_r[] = {
      initr_noncached,
Quoted 8 lines

common/board_r.c

Quoted 5 lines

#endif
initr_of_live,

common/board_r.c +0 -3
-#ifdef CONFIG_DM
-     initr_dm,
-#endif

You are moving initr_of_live before initr_of_live. I doubt this will work for boards that have CONFIG_OF_LIVE=y.

yes you are right. It will not work for CONFIG_OF_LIVE.

Quoted 4 lines

Can't we move initr_trace down in the code to after both initr_of_live and initr_dm?

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

@Simon:
Please, advise.

I am okay with this suggestion.

Actually can we use the early timer for this case?

DM init is a part of U-Boot and not being able to trace it would be unfortunate.

Got it.

If someone wants to use tracing without TIMER_EARLY then

- initr_dm() will make gd->dm_root = NULL; and gd->timer = NULL; and __cyg_profile_func_enter () will call timer_get_us() -> get_ticks() -> dm_timer_init().

dm_timer_init() will not able to initialize timer and return an error.

We need to find any solution for this.

Quoted 3 lines

Regards,
Simon

#5 lore raw

PATCH 1/1 common/board_r: make sure to call initr_dm() before initr_trace()

Hi Pragnesh,

Quoted 87 lines · Pragnesh Patel

Hi,

Quoted 73 lines

-----Original Message-----
From: Simon Glass <[email protected]>
Sent: 17 November 2020 05:23
To: Pragnesh Patel <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>; U-Boot Mailing List <u- boot at lists.denx.de>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Hi,

Quoted 57 lines · Pragnesh Patel

Hi Heinrich,

Quoted 39 lines

-----Original Message-----
From: Heinrich Schuchardt <[email protected]>
Sent: 12 November 2020 18:02
To: Pragnesh Patel <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Simon Glass <[email protected]>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before
initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 25 lines · Pragnesh Patel

Tracing need timer ticks and initr_dm() will make gd->timer and gd->dm_root is equal to NULL, so make sure that initr_dm() to call before tracing got enabled.

---
 common/board_r.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/board_r.c index renamed from common/board_r.c +0 -0

29dd7d26d9..7140a39947 100644

common/board_r.c +4 -0
@@ -693,6 +693,9 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each call?
  */
 static init_fnc_t init_sequence_r[] = {
+#ifdef CONFIG_DM
+     initr_dm,
+#endif
      initr_trace,
      initr_reloc,
      /* TODO: could x86/PPC have this also perhaps? */ @@ -718,9
+721,6 @@ static init_fnc_t init_sequence_r[] = {
      initr_noncached,
Quoted 8 lines

common/board_r.c

Quoted 5 lines

#endif
initr_of_live,

common/board_r.c +0 -3
-#ifdef CONFIG_DM
-     initr_dm,
-#endif

You are moving initr_of_live before initr_of_live. I doubt this will work for boards that have CONFIG_OF_LIVE=y.

yes you are right. It will not work for CONFIG_OF_LIVE.

Quoted 4 lines

Can't we move initr_trace down in the code to after both initr_of_live and initr_dm?

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

@Simon:
Please, advise.

I am okay with this suggestion.

Actually can we use the early timer for this case?

DM init is a part of U-Boot and not being able to trace it would be unfortunate.

Got it.

Quoted 8 lines

If someone wants to use tracing without TIMER_EARLY then

- initr_dm() will make gd->dm_root = NULL; and gd->timer = NULL; and __cyg_profile_func_enter () will call timer_get_us() -> get_ticks() -> dm_timer_init().

dm_timer_init() will not able to initialize timer and return an error.

We need to find any solution for this.

How about we make TRACE select or depend on TIMER_EARLY?

Regards,
Simon

#6 lore raw

PATCH 1/1 common/board_r: make sure to call initr_dm() before initr_trace()

Quoted 114 lines

-----Original Message-----
From: Simon Glass <[email protected]>
Sent: 18 November 2020 20:07
To: Pragnesh Patel <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>; U-Boot Mailing List <u- boot at lists.denx.de>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Hi Pragnesh,

Quoted 47 lines · Pragnesh Patel

Hi,

Quoted 44 lines

-----Original Message-----
From: Simon Glass <[email protected]>
Sent: 17 November 2020 05:23
To: Pragnesh Patel <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>; U-Boot Mailing List <u- boot at lists.denx.de>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before
initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Hi,

Quoted 26 lines · Pragnesh Patel

Hi Heinrich,

Quoted 23 lines

-----Original Message-----
From: Heinrich Schuchardt <[email protected]>
Sent: 12 November 2020 18:02
To: Pragnesh Patel <[email protected]>
Cc: U-Boot Mailing List <[email protected]>; Simon Glass <[email protected]>
Subject: Re: [PATCH] common/board_r: make sure to call initr_dm() before
initr_trace()

[External Email] Do not click links or attachments unless you recognize the sender and know the content is safe

Quoted 9 lines · Pragnesh Patel

Tracing need timer ticks and initr_dm() will make gd->timer and gd->dm_root is equal to NULL, so make sure that initr_dm() to call before tracing got enabled.

---
 common/board_r.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

common/board_r.c static int run_main_loop(void) · line 693

Quoted 6 lines
common/board_r.c index renamed from common/board_r.c +0 -0

29dd7d26d9..7140a39947 100644

common/board_r.c +0 -0
@@ -693,6 +693,9 @@ static int run_main_loop(void)
  * TODO: perhaps reset the watchdog in the initcall function after each

call?

Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 11 lines
Quoted 11 lines
common/board_r.c +4 -1
  */
 static init_fnc_t init_sequence_r[] = {
+#ifdef CONFIG_DM
+     initr_dm,
+#endif
      initr_trace,
      initr_reloc,
      /* TODO: could x86/PPC have this also perhaps? */ @@
-718,9
+721,6 @@ static init_fnc_t init_sequence_r[] = {
      initr_noncached,
Quoted 8 lines

common/board_r.c

Quoted 5 lines

#endif
initr_of_live,

common/board_r.c +0 -3
-#ifdef CONFIG_DM
-     initr_dm,
-#endif

You are moving initr_of_live before initr_of_live. I doubt this will work for boards that have CONFIG_OF_LIVE=y.

yes you are right. It will not work for CONFIG_OF_LIVE.

Quoted 4 lines

Can't we move initr_trace down in the code to after both initr_of_live and initr_dm?

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

@Simon:
Please, advise.

I am okay with this suggestion.

Actually can we use the early timer for this case?

DM init is a part of U-Boot and not being able to trace it would be

unfortunate.

Quoted 7 lines

Got it.

If someone wants to use tracing without TIMER_EARLY then

- initr_dm() will make gd->dm_root = NULL; and gd->timer = NULL; and __cyg_profile_func_enter () will call timer_get_us() -> get_ticks() ->

Quoted 7 lines

dm_timer_init().

Quoted 4 lines

dm_timer_init() will not able to initialize timer and return an error.

We need to find any solution for this.

How about we make TRACE select or depend on TIMER_EARLY?

I am okay with this. Better to make TRACE select TIMER_EARLY.

Quoted 3 lines

Regards,
Simon