cancel
Showing results for 
Search instead for 
Did you mean: 

Initrd won't boot up because one for-loop got stuck due to preempt - How to disable?

DMårt
Lead

Hi!

I having a question. I'm using STM32MP151 processor and my initrd won't work because it got stuck at the initialization of the inird inside init/main.c file inside Linux source. Follow the arrows <------

 

 

static int __ref kernel_init(void *unused)
{
	int ret;

	/*
	 * Wait until kthreadd is all set-up.
	 */
	pr_info("static int __ref kernel_init(void *unused):  	wait_for_completion(&kthreadd_done);");
	wait_for_completion(&kthreadd_done);
	pr_info("static int __ref kernel_init(void *unused):  kernel_init_freeable();");
	kernel_init_freeable(); <-----
	pr_info("static int __ref kernel_init(void *unused):  kernel_init_freeable(); OK");
	/* need to finish all async __init code before freeing the memory */
	async_synchronize_full();

....
....
....
}

static noinline void __init kernel_init_freeable(void)
{
..
...
...

	pr_info("static noinline void __init kernel_init_freeable(void): 	do_basic_setup();");
	do_basic_setup(); <----
	pr_info("static noinline void __init kernel_init_freeable(void): 	do_basic_setup(); OK");

....
....
....
}

static void __init do_basic_setup(void)
{
	cpuset_init_smp();
	driver_init();
	init_irq_proc();
	do_ctors();
	pr_info("static void __init do_basic_setup(void): 	do_initcalls();");
	do_initcalls(); <-----
	pr_info("static void __init do_basic_setup(void): 	do_initcalls(); OK");
}

static void __init do_initcalls(void)
{
	int level;
	size_t len = strlen(saved_command_line) + 1;
	char *command_line;

	command_line = kzalloc(len, GFP_KERNEL);
	if (!command_line)
		panic("%s: Failed to allocate %zu bytes\n", __func__, len);

	for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++) {
		/* Parser modifies command_line, restore it each time */
		strcpy(command_line, saved_command_line);
		pr_info("static void __init do_initcalls(void): 		do_initcall_level(level, command_line);");
		do_initcall_level(level, command_line); <-----
		pr_info("static void __init do_initcalls(void): 		do_initcall_level(level, command_line); OK");
	}
	pr_info("static void __init do_initcalls(void) - For loop done");

....
....
....
}


static void __init do_initcall_level(int level, char *command_line)
{
	initcall_entry_t *fn;

	parse_args(initcall_level_names[level],
		   command_line, __start___param,
		   __stop___param - __start___param,
		   level, level,
		   NULL, ignore_unknown_bootoption);
	pr_info("static void __init do_initcall_level(int level, char *command_line): 	trace_initcall_level(initcall_level_names[level]);");
	trace_initcall_level(initcall_level_names[level]);
	pr_info("static void __init do_initcall_level(int level, char *command_line): 	trace_initcall_level(initcall_level_names[level]); OK");
	for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++){
		//pr_info("static void __init do_initcall_level(int level, char *command_line): 		do_one_initcall(initcall_from_entry(fn));");
		do_one_initcall(initcall_from_entry(fn)); <------
		//pr_info("static void __init do_initcall_level(int level, char *command_line): 		do_one_initcall(initcall_from_entry(fn)); OK");
	}
	pr_info("static void __init do_initcall_level(int level, char *command_line) - 	Fo loop done - Leaving function");

}

 

Question:

This for-loop won't exit. Is there any way in the build/.config that I can disable so I can proceed with my custom STM32MP151AAC3 board?

I have tried to disable preempt but then I could not even boot my linux kernel. Right now, my linux kernel is booting, but the initrd won't start. So the blue LED heartbeat is just blinking as it should. Nothing more is happening.

I would consider this as a bug for the software for STM32MP1 series.

 

 

STM32MP151AAC3 custom board with STM32-OS as operating system: https://github.com/DanielMartensson/STM32-Computer
0 REPLIES 0