Re: [PATCH 1/1] serial: move sbi_dbcn_available to .data section
On Mon, Feb 26, 2024 at 05:32:26PM +0100, Heinrich Schuchardt wrote: > U-Boot SPL loads the device-tree directly behind main U-Boot overlapping > the .bss section. reserve_fdt() is called in board_init_f() to relocate the > device-tree to a safe location. > > Debug UARTs are enabled before board_init_f(). With sbi_dbcn_available in > the .bss section the device-tree is corrupted when _debug_uart_init() is > called in the SBI serial driver. Move the variable to the .data section. > > Link: https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/2054091 > Fixes: dfe08374943c ("risc-v: implement DBCN based debug console") > Signed-off-by: Heinrich Schuchardt This also appears to fix the inconsistent boot issues that I've been seeing since I reported: https://lore.kernel.org/u-boot/20240122-finicky-ancient-797ba048f927@spud/ Tested-by: Conor Dooley Thanks, Conor. signature.asc Description: PGP signature
Re: [PATCH 1/1] serial: move sbi_dbcn_available to .data section
On 2024-02-26 17:32, Heinrich Schuchardt wrote: > U-Boot SPL loads the device-tree directly behind main U-Boot overlapping > the .bss section. reserve_fdt() is called in board_init_f() to relocate the > device-tree to a safe location. > > Debug UARTs are enabled before board_init_f(). With sbi_dbcn_available in > the .bss section the device-tree is corrupted when _debug_uart_init() is > called in the SBI serial driver. Move the variable to the .data section. > > Link: https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/2054091 > Fixes: dfe08374943c ("risc-v: implement DBCN based debug console") > Signed-off-by: Heinrich Schuchardt > --- > drivers/serial/serial_sbi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/serial/serial_sbi.c b/drivers/serial/serial_sbi.c > index a51a96c1ef0..f3ecfccab43 100644 > --- a/drivers/serial/serial_sbi.c > +++ b/drivers/serial/serial_sbi.c > @@ -17,7 +17,7 @@ static inline void _debug_uart_putc(int c) > > #else > > -static int sbi_dbcn_available; > +static int sbi_dbcn_available __section(".data"); > > static inline void _debug_uart_init(void) > { Tested-by: Aurelien Jarno -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurel...@aurel32.net http://aurel32.net
[PATCH 1/1] serial: move sbi_dbcn_available to .data section
U-Boot SPL loads the device-tree directly behind main U-Boot overlapping the .bss section. reserve_fdt() is called in board_init_f() to relocate the device-tree to a safe location. Debug UARTs are enabled before board_init_f(). With sbi_dbcn_available in the .bss section the device-tree is corrupted when _debug_uart_init() is called in the SBI serial driver. Move the variable to the .data section. Link: https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/2054091 Fixes: dfe08374943c ("risc-v: implement DBCN based debug console") Signed-off-by: Heinrich Schuchardt --- drivers/serial/serial_sbi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/serial/serial_sbi.c b/drivers/serial/serial_sbi.c index a51a96c1ef0..f3ecfccab43 100644 --- a/drivers/serial/serial_sbi.c +++ b/drivers/serial/serial_sbi.c @@ -17,7 +17,7 @@ static inline void _debug_uart_putc(int c) #else -static int sbi_dbcn_available; +static int sbi_dbcn_available __section(".data"); static inline void _debug_uart_init(void) { -- 2.43.0