2009-12-05 07:30:25     Hang after Freeing unused Kernel memory on bf537 No RTC

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2009-12-05 07:30:25     Hang after Freeing unused Kernel memory on bf537 No RTC

vinuste zhou (CHINA)

Message: 83105   

 

Hi, our new design of a BF537 board, there is no RTC, hang after Freeing unused Kernel memory. I had unset RTC in the kernel options config.

 

 

I traced the process of kernel, it hang at line "run_init_process("/sbin/init");" in main.c . But if I comment the line to skip init, it can run run_init_process("/bin/sh"); , but only can press enter and echo "root:~>", any other command will also hang up the system.

 

And then I had trace in simpleinit.c, in this function

 

--------------------------------------------------

 

static void enter_single(void)

{

pid_t pid;

char *av[2];

 

    fprintf(stderr, "Booting to single user mode\n");

    av[0] = _PATH_BSHELL;

    av[1] = NULL;

    if((pid = vfork()) == 0) {

    DEBUGBREAK();

    extern char **environ;

    if(environ!= NULL&& *environ!= NULL)

    {

        fprintf(stderr, "%s %s \n", av, *environ);

    }

/* the child */

execve(_PATH_BSHELL, av, environ);

fprintf(stderr,"exec of single user shell failed\n");

_exit(0);

    } else if(pid > 0) {

  

    DEBUGBREAK();

    int i;

while(wait(&i) != pid) /* nothing */;

    } else if(pid < 0) {

  

fprintf(stderr,"fork of single user shell failed\n");

    }

    unlink(_PATH_SINGLE);

  

    DEBUGBREAK();

}

 

-------------------------------------------------

 

It break at  while(wait(&i) != pid) /* nothing */; The process is waitting for shell. It seems OK, But I cannot get into the shell in fact , it like hang on the system.

 

 

But if I try to run with same image on another BF537 board which has RTC hardware, it runs OK.

 

My kernel version is 2.6.16.27-ADI-2006R2.

 

I think that there is something wrong with vfork or busybox.

 

 

Anybody can give some advice? Thanks!

QuoteReplyEditDelete

 

 

2009-12-05 17:04:55     Re: Hang after Freeing unused Kernel memory on bf537 No RTC

Mike Frysinger (UNITED STATES)

Message: 83106   

 

2006R2 is pretty ancient.

 

are you sure you disabled RTC support in the kernel and u-boot ?

QuoteReplyEditDelete

 

 

2009-12-05 19:46:57     Re: Hang after Freeing unused Kernel memory on bf537 No RTC

vinuste zhou (CHINA)

Message: 83107   

 

Thanks for your reply.

 

Yes, if I donnot disable the RTC support, the u-boot  cannot pass at rtc init and kernel hang on when starting the kernel, even it cannot printf the  linux version at start .

 

  I had unset the RTC defined in u-boot and unset the options in the kernel ( include unset the build-in RTC  at Blackfin Processor Options and watch dog device drivers.)

 

---------------------------------------------

 

#CONFIG_BFIN_HAVE_RTC=y

 

#CONFIG_BLACKFIN_RTC=y

 

--------------------------------------------

 

is there something others I need to disable for  RTC?   Now the kernel can finished the init function at main.c expect the run_in_process for /sbin/init  . It seems that it cannot run another process . Does the rtc affect the thread switch process?

 

I will try to use the 2009 version on Monday, but I think 2006R2 is OK too because the image can run normally on the board with RTC hardware.  I donnot know what's the different influence with NO RTC  .

QuoteReplyEditDelete

 

 

2009-12-06 04:06:44     Re: Hang after Freeing unused Kernel memory on bf537 No RTC

Mike Frysinger (UNITED STATES)

Message: 83120   

 

see what the system time in the kernel is set to before it starts executing userspace

 

we've fixed many things and i dont recall seeing people complain about no-RTC hangs in the latest versions

Attachments

    Outcomes