All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: cpu: set gp before board_init_f_init_reserve
@ 2022-05-20 11:41 Nikita Shubin
  2022-06-01  2:07 ` Leo Liang
  0 siblings, 1 reply; 4+ messages in thread
From: Nikita Shubin @ 2022-05-20 11:41 UTC (permalink / raw)
  Cc: linux, Nikita Shubin, Rick Chen, Leo, Ilias Apalodimas,
	Simon Glass, u-boot

From: Nikita Shubin <n.shubin@yadro.com>

Restore global pointer before board_init_f_init_reserve call,
as "a0" can be set in harts_early_init call and we end up with
invalid global pointer.

Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
---
 arch/riscv/cpu/start.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S
index 76850ec9be..623de57551 100644
--- a/arch/riscv/cpu/start.S
+++ b/arch/riscv/cpu/start.S
@@ -142,6 +142,7 @@ call_harts_early_init:
 	bnez	tp, secondary_hart_loop
 #endif
 
+	mv      a0, s0
 	jal	board_init_f_init_reserve
 
 	SREG	s1, GD_FIRMWARE_FDT_ADDR(gp)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: cpu: set gp before board_init_f_init_reserve
  2022-05-20 11:41 [PATCH] riscv: cpu: set gp before board_init_f_init_reserve Nikita Shubin
@ 2022-06-01  2:07 ` Leo Liang
  2022-08-02 10:29   ` Nikita Shubin
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Liang @ 2022-06-01  2:07 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: linux, Nikita Shubin, Rick Chen, u-boot, ilias.apalodimas, sjg, ycliang

On Fri, May 20, 2022 at 02:41:17PM +0300, Nikita Shubin wrote:
> From: Nikita Shubin <n.shubin@yadro.com>
> 
> Restore global pointer before board_init_f_init_reserve call,
> as "a0" can be set in harts_early_init call and we end up with
> invalid global pointer.
> 
> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
> ---
>  arch/riscv/cpu/start.S | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: cpu: set gp before board_init_f_init_reserve
  2022-06-01  2:07 ` Leo Liang
@ 2022-08-02 10:29   ` Nikita Shubin
  2022-08-03 10:41     ` Leo Liang
  0 siblings, 1 reply; 4+ messages in thread
From: Nikita Shubin @ 2022-08-02 10:29 UTC (permalink / raw)
  To: Leo Liang; +Cc: linux, Nikita Shubin, Rick Chen, u-boot, ilias.apalodimas, sjg

Hello Leo!

On Wed, 1 Jun 2022 02:07:34 +0000
Leo Liang <ycliang@andestech.com> wrote:

> On Fri, May 20, 2022 at 02:41:17PM +0300, Nikita Shubin wrote:
> > From: Nikita Shubin <n.shubin@yadro.com>
> > 
> > Restore global pointer before board_init_f_init_reserve call,
> > as "a0" can be set in harts_early_init call and we end up with
> > invalid global pointer.
> > 
> > Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
> > ---
> >  arch/riscv/cpu/start.S | 1 +
> >  1 file changed, 1 insertion(+)  
> 
> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>

Any further motion on this ? 

Yours,
Nikita Shubin.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: cpu: set gp before board_init_f_init_reserve
  2022-08-02 10:29   ` Nikita Shubin
@ 2022-08-03 10:41     ` Leo Liang
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Liang @ 2022-08-03 10:41 UTC (permalink / raw)
  To: Nikita Shubin
  Cc: linux, Nikita Shubin, Rick Chen, u-boot, ilias.apalodimas, sjg

Hi Nikita,

On Tue, Aug 02, 2022 at 01:29:24PM +0300, Nikita Shubin wrote:
> Hello Leo!
> 
> On Wed, 1 Jun 2022 02:07:34 +0000
> Leo Liang <ycliang@andestech.com> wrote:
> 
> > On Fri, May 20, 2022 at 02:41:17PM +0300, Nikita Shubin wrote:
> > > From: Nikita Shubin <n.shubin@yadro.com>
> > > 
> > > Restore global pointer before board_init_f_init_reserve call,
> > > as "a0" can be set in harts_early_init call and we end up with
> > > invalid global pointer.
> > > 
> > > Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
> > > ---
> > >  arch/riscv/cpu/start.S | 1 +
> > >  1 file changed, 1 insertion(+)  
> > 
> > Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
> 
> Any further motion on this ? 

Sorry for keeping you waiting for so long.
This patch is merged in riscv tree and PR will be sent ASAP
once the CI result shows no issue.

Best regards,
Leo

> 
> Yours,
> Nikita Shubin.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-03 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 11:41 [PATCH] riscv: cpu: set gp before board_init_f_init_reserve Nikita Shubin
2022-06-01  2:07 ` Leo Liang
2022-08-02 10:29   ` Nikita Shubin
2022-08-03 10:41     ` Leo Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.