Linux kernel failed to resume.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linux kernel failed to resume.

Jump to solution
324 Views
Jeff-CF-Huang
Contributor III

Hi Sir,

Printing a log message to UART inresume_bl31 causes the Linux kernel to fail to resume.

static void resume_bl31(struct s32g_ssram_mailbox *ssram_mb)
{
  ...
  if (ddrss_to_normal_mode(csr_addr)) {
    ERROR("Failed to transition DDR to normal mode\n");
    panic();
  }
  NOTICE("Print some debug messages here!\n");
  isb();
  dsb();
  disable_mmu_el3();
  resume_entrypoint();
}



Best regards,
Jeff Huang

0 Kudos
Reply
1 Solution
219 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your reply.

I have checked the code and found you had put the print message after "ddrss_to_normal_mode", since DDR mod changed via executing the function, the buffer of the Notice macro may possibly impacted by the changes, thus caused the issue.

I suggest not putting your debug messages there and try putting it before the DDR state changes, which should work for print debug messages.

 

BR

Chenyin

View solution in original post

0 Kudos
Reply
7 Replies
303 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your post.
1. May I know which version BSP is used? Is it based on S32G2/3? on a custom board or RDB?

2. The issue could be reproduced from STR operation?

 

BR

Chenyin

0 Kudos
Reply
268 Views
Jeff-CF-Huang
Contributor III
1. BSP 40, custom board
2.Yes

The system resumes normally when the NOTICE("Print some debug messages here!\n"); line is removed.
0 Kudos
Reply
263 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your reply.

I had checked the code you mentioned, seems at the stage you pointed, the console had not been registered from default BSP's perspective, which may be the reason for the issue you met, may I know if you had done any modification regarding to code of the console part?

 

BR

Chenyin

0 Kudos
Reply
259 Views
Jeff-CF-Huang
Contributor III

Hi Chenyin,

The other log message can appear if it is located far from the wakeup_resume_point of the Linux kernel.

void bl2_el3_early_platform_setup(u_register_t arg0, u_register_t arg1,
				  u_register_t arg2, u_register_t arg3)
{
  enum reset_cause reset_cause;
  struct s32g_ssram_mailbox *ssram_mb = (void *)BL31SSRAM_MAILBOX;
  ...
  s32_early_plat_init();
  console_s32_register();

  NOTICE("Reset status: %s\n", get_reset_cause_str(reset_cause));

  if (reset_cause == CAUSE_WAKEUP_DURING_STANDBY) {
    /* Trampoline to bl31_warm_entrypoint */
    resume_bl31(ssram_mb);
    panic();
  }
  ...

 

0 Kudos
Reply
252 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for the reply.

I have mentioned that the console had been initialized in your code samples, then I will investigate it directly on my board.

May I know you tested it on a S32G2 or S32G3 board?

 

B R

Chenyin

0 Kudos
Reply
249 Views
Jeff-CF-Huang
Contributor III

S32G3 board

0 Kudos
Reply
220 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Jeff-CF-Huang 

Thanks for your reply.

I have checked the code and found you had put the print message after "ddrss_to_normal_mode", since DDR mod changed via executing the function, the buffer of the Notice macro may possibly impacted by the changes, thus caused the issue.

I suggest not putting your debug messages there and try putting it before the DDR state changes, which should work for print debug messages.

 

BR

Chenyin

0 Kudos
Reply