[ARM-LINUX]Booting is stopped at CPSIE instruction

2013-04-02 Thread sandeep kumar
Hi all
I am trying to port opensource kernel on top of Qualcomm board.
I am struck at local_irq_enable() point in init/main.c,

start_kernel()
{
   --- snip ---
   call_function_init();
if (!irqs_disabled())
printk(KERN_CRIT start_kernel(): bug: interrupts were 
 enabled early\n);
early_boot_irqs_disabled = false;
 local_irq_enable();
}

This functions implementation is like this...

static inline void arch_local_irq_enable(void)
  {
  asm volatile(
 cpsie i @ arch_local_irq_enable
  :
  :
  : memory, cc);
  }

if i comment that local_irq_enable(), still the booting is not progressing.

Can any one pls help me out here??

-- 
With regards,
Sandeep Kumar Anantapalli,
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: kernel build error

2013-04-02 Thread Kumar amit mehta
On Tue, Apr 02, 2013 at 10:04:31AM +0700, Mulyadi Santosa wrote:
 Could you paste roughly 20-30 lines of boot messages when you hit the hung
 point? Kernel config alone usually can't help much

I'm trying this on a Virtual Machine using VMware Player. When the VM boots up,
it throws lots of messages on the console and then gets stuck. I'd like to know,
how I can capture all those console logs till it hits the hung point.

-Amit

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cgroup.procs versus tasks (cgroups)

2013-04-02 Thread Vlad Dogaru
On Tue, Apr 02, 2013 at 05:54:56AM +0300, Kevin Wilson wrote:
 Hi?
 Any idea what is the difference  cgroup.procs entry and tasks
 entry of cgroup sysfs?
 both represent pid lists.
 I ran:
 cat /sys/fs/cgroup/cpuset/cgroup.procs
 and
 cat  /sys/fs/cgroup/cpuset/tasks
 and entries of cgroup.procs appear in tasks.
 
 However there are many more tasks than cgroup.procs:
 
 cat  /sys/fs/cgroup/cpuset/cgroup.procs | wc -l
 153
 cat  /sys/fs/cgroup/cpuset/tasks | wc -l
 383

The difference you are seeing is because there are some multithreaded
processes in your cpuset.  In the cgroup.procs file, each such process
apears only once (listed by its TGID).  In the tasks file, each thread
appears once (listed by its PID).

Check the pidlist_array_load function in kernel/cgroup.c.  procs is a
list of (unique) TGIDs, while tasks is a list of PIDs.

Hope this helps,
Vlad

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


What is idr_alloc()

2013-04-02 Thread Manavendra Nath Manav
In the source code implementation it says idr_alloc() is used to
allocate new idr entry. I couldn't find the man page and want to know
why it is used especially when writing drivers for MTD devices.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: [help] kernel oops in function gpio_to_irq

2013-04-02 Thread Mylene Josserand
Hi Matthias,


Le 30/03/2013 14:09, Matthias Brugger a écrit :

 El 27/03/2013 18:16, Mylene Josserand mylene.josser...@navocap.com
 mailto:mylene.josser...@navocap.com va escriure:
  
   Hi everyone,
  
  
   I have a problem with gpio functions.
   My kernel version is 3.8.2 and my SoC is a imX27 on a home-made board.
  
   First, when I boot, I had only the Starting kernel... message.
   So I rebuild my kernel with CONFIG_DEBUG_KERNEL, CONFIG_DEBUG_LL and
   CONFIG_EARLY_PRINTK. I have also add the line
   earlyprintk=console,UART0,115200 on the bootargs of my Barebox.
  
   With that, I can see more messages :
  
   [...]
   Unable to handle kernel NULL pointer dereference at virtual address
 002c
   pgd = c0004000
   [002c] *pgd=
   Internal error: Oops: 5 [#1] PREEMPT ARM
   Modules linked in:
   CPU: 0Not tainted  (3.8.2+ #4)
   PC is at __gpio_to_irq+0x1c/0x44
   LR is at navocap_baseboard_init+0xd8/0x2c8
   pc : [c01fd194]lr : [c04fd468]psr: 6053
   sp : c7835ef0  ip : 0079  fp : c05a5628
   r10: c04f817c  r9 :   r8 : c05a562c
   r7 : c7834000  r6 : 0004  r5 : c05158c4  r4 : c0578844
   r3 : 05ac  r2 : c05b0410  r1 : c7834000  r0 : 
   Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
   Control: 0005317f  Table: a0004000  DAC: 0017
   Process swapper (pid: 1, stack limit = 0xc78341b8)
   Stack: (0xc7835ef0 to 0xc7836000)
   5ee0: c05158c4 c04fd468 0002
   10009000
   5f00: 10009fff  0200    c05158c4
   c04fd348
   5f20: c0578844 c04f819c c04d23dc c00087f8 0003 0003 c04d1b2c
   c06bd6a0
   5f40:  c0578844 c05158c4 0004 008b c05a562c c0515898
   c04f6378
   5f60: c05a5620 c04f62a0 0003 0003 c04f6378 c00403e0 
   
   5f80: c03cfee0      
   c03cfeec
   5fa0:   c03cfee0 c00093b0   
   
   5fc0:       
   
   5fe0:     0013  0010
   000a1000
   [c01fd194] (__gpio_to_irq+0x1c/0x44) from [c04fd468]
   (navocap_baseboard_init+0xd8/0x2c8)
   [c04fd468] (navocap_baseboard_init+0xd8/0x2c8) from [c04f819c]
   (customize_machine+0x20/0x30)
   [c04f819c] (customize_machine+0x20/0x30) from [c00087f8]
   (do_one_initcall+0x2c/0x168)
   [c00087f8] (do_one_initcall+0x2c/0x168) from [c04f62a0]
   (kernel_init_freeable+0xf4/0x1cc)
   [c04f62a0] (kernel_init_freeable+0xf4/0x1cc) from [c03cfeec]
   (kernel_init+0xc/0x164)
   [c03cfeec] (kernel_init+0xc/0x164) from [c00093b0]
   (ret_from_fork+0x14/0x24)
   Code: e0433100 e1a0c000 e7920003 e24dd004 (e590302c)
   ---[ end trace 61bb09c25216d85b ]---
   Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b
  
  
   The problem is in the function gpio_to_irq in my board init functions
   (navocap_baseboard_init).
  
   To know which lines the opps appears, I have followed this tutorial :
   https://wiki.ubuntu.com/Kernel/KernelDebuggingTricks
  
   Thanks to it, I can notice that the opps appears when I called the
   gpio_to_irq function in :
  
   ret = request_irq(gpio_to_irq(IMX_GPIO_NR(2,14)), detect_irq,
   IRQF_TRIGGER_FALLING, imx-mmc-detect, data);

 Make sure your arguments are not NULL (IMX_GPIO_NR, detect_irq and data).

 Some extra printk's before calling request_irq should do.


Thank you very much for your help !
I will try that.


  
  
   I have checked in other boards how to use this function and it is
   configured in the same way.
   I did see where I have made a mistake. Maybe in my config file where I
   have missed a configuration option ? How to solve this opps problem ? It
   would be very great if someone could give me some helps / feedbacks on
   this problem.
  
   Thank you in advance !
  
   Best regards,
  
  
   --
   Mylène JOSSERAND
   Navocap
  
   ___
   Kernelnewbies mailing list
   Kernelnewbies@kernelnewbies.org mailto:Kernelnewbies@kernelnewbies.org
   http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Best regards,

-- 
Mylène JOSSERAND
Navocap

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Method to calculate user space thread size

2013-04-02 Thread naveen yadav
Dear All,

I have very complex user space application contain more then 400 threads. I
want to limit the stack size in user space, for this I want to know how
much stack size each thread use in worst case.

To calculate this is I need to modify in kernel ? or current kernel have
any support ?
or is there a method I can get from smaps?

Thanks
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: kernel build error

2013-04-02 Thread Mulyadi Santosa
On Tue, Apr 2, 2013 at 1:19 PM, Kumar amit mehta gmate.a...@gmail.comwrote:

 On Tue, Apr 02, 2013 at 10:04:31AM +0700, Mulyadi Santosa wrote:
  Could you paste roughly 20-30 lines of boot messages when you hit the
 hung
  point? Kernel config alone usually can't help much

 I'm trying this on a Virtual Machine using VMware Player. When the VM
 boots up,
 it throws lots of messages on the console and then gets stuck. I'd like to
 know,
 how I can capture all those console logs till it hits the hung point.

 -Amit


Never do such thing on VMWare, but I think Qemu-kvm is more convenient for
such task. You just need to learn how to use its serial console.or just
use its ncurses display so you simply copy and paste from your terminal
program.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cgroup.procs versus tasks (cgroups)

2013-04-02 Thread Kevin Wilson
Hi,
Thanks  a lot Vlad. This explains it.
- Does anybody know of a ps command (or a filter to  ps command)
which will display only multithreaded
processes (list processes by TGID) ?  (I know now about the option of
displaying cgroup.procs , but is something parallel can be done with ps ? )

rgs,
Kevin


On Tue, Apr 2, 2013 at 10:40 AM, Vlad Dogaru ddv...@herebedragons.ro wrote:
 On Tue, Apr 02, 2013 at 05:54:56AM +0300, Kevin Wilson wrote:
 Hi?
 Any idea what is the difference  cgroup.procs entry and tasks
 entry of cgroup sysfs?
 both represent pid lists.
 I ran:
 cat /sys/fs/cgroup/cpuset/cgroup.procs
 and
 cat  /sys/fs/cgroup/cpuset/tasks
 and entries of cgroup.procs appear in tasks.

 However there are many more tasks than cgroup.procs:

 cat  /sys/fs/cgroup/cpuset/cgroup.procs | wc -l
 153
 cat  /sys/fs/cgroup/cpuset/tasks | wc -l
 383

 The difference you are seeing is because there are some multithreaded
 processes in your cpuset.  In the cgroup.procs file, each such process
 apears only once (listed by its TGID).  In the tasks file, each thread
 appears once (listed by its PID).

 Check the pidlist_array_load function in kernel/cgroup.c.  procs is a
 list of (unique) TGIDs, while tasks is a list of PIDs.

 Hope this helps,
 Vlad

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Reading linux boot args

2013-04-02 Thread Valdis . Kletnieks
On Tue, 02 Apr 2013 12:12:09 +0900, manty kuma said:

 Is there any way i could read the reason for reboot.
 I want to read it so that i can get the reason that is stored.
 like 0xABADBABE is watchdog 0xCODEDEAD is panic. Etc..

 Please suggest an alternative approach.


See the 'pstore' persistent storage filesystem in fs/pstore.
That lets you store more than just an int (you can even get it
to stash your dmesg buffer).

'more fs/pstore/Kconfig' would be a good place to start.


pgpRELPvKNH33.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cgroup.procs versus tasks (cgroups)

2013-04-02 Thread Valdis . Kletnieks
On Tue, 02 Apr 2013 16:46:24 +0300, Kevin Wilson said:
 Hi,
 Thanks  a lot Vlad. This explains it.
 - Does anybody know of a ps command (or a filter to  ps command)
 which will display only multithreaded
 processes (list processes by TGID) ?  (I know now about the option of
 displaying cgroup.procs , but is something parallel can be done with ps ? )

Have you tried 'ps -m' and friends?  Though it doesn't do exactly
what you wanted and *only* display multithreaded, you need to do some
post-processing:

$ ps max
...
   928 ?-  0:00 /sbin/auditd -n
 - -Ssl   0:00 -
 - -Ssl   0:00 -
   940 ?-  0:00 /sbin/audispd
 - -Ssl   0:00 -
 - -Ssl   0:00 -
   951 ?-  0:00 /usr/sbin/abrtd -d -s
 - -Ss 0:00 -
   960 ?-  0:00 /usr/bin/abrt-watch-log -F Backtrace 
/var/log/Xorg.0.log -- /usr/bin/abrt-dump-xorg -xD
 - -Ss 0:00 -

If there's 2 or more '- -' after the process entry, it's multi=threaded.

Note however that as far as the kernel is concerned, a single-threaded
process is handled by the code as a multi-threaded that happens to have
only one thread at the moment.  In other words, thinking that single and
multi threaded is different in some mystical way will probably end up
causing trouble for  you...


pgpcu3BQco7sL.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Online migration of arbitrary filesystems, possible?

2013-04-02 Thread Valdis . Kletnieks
On Mon, 01 Apr 2013 17:50:43 -0300, Daniel Hilst said:

  Any reason you can't just 'rsync /source-fs /dest-fs'?
 
 because I can't use dest-fs while rsynching

Sure you can. You just have to remember to pay attention to race
conditions - if you create foo/bar.dat on the dest and then rsync
wants to copy over a foo/bar.tar from the source, things will go
poorly.

However, if you wanted to write to the dest while doing your sync,
you'll have that issue no matter *what* method you use to do it.

 Read operations:
   1. See if data is already on dest fs,
   2. If is then read data and bright back to caller (lets call this
 cold read)
   3. If is not, then read file from source fs, put it on page cache,
 and change the backstorage of that page..
   3.1 So when this page get dirty or too old, it will be writed to

You may want to look for 'overlayfs' and 'unionfs', which may provide
you the function you need. (Note there's several different patchsets
calling themselves 'unionfs').



pgpTPJOBUFmxB.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Reading linux boot args

2013-04-02 Thread manty kuma
Hi Valdis,

Thansk for answer. I have made use of saved_command_linbe buffer that is
available in all modules(extern present in linux/init.h)

Best Regards,
Manty

On Wed, Apr 3, 2013 at 3:07 AM, valdis.kletni...@vt.edu wrote:

 On Tue, 02 Apr 2013 12:12:09 +0900, manty kuma said:

  Is there any way i could read the reason for reboot.
  I want to read it so that i can get the reason that is stored.
  like 0xABADBABE is watchdog 0xCODEDEAD is panic. Etc..
 
  Please suggest an alternative approach.
 

 See the 'pstore' persistent storage filesystem in fs/pstore.
 That lets you store more than just an int (you can even get it
 to stash your dmesg buffer).

 'more fs/pstore/Kconfig' would be a good place to start.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: cgroup.procs versus tasks (cgroups)

2013-04-02 Thread Rami Rosen
Hi,

BTW, for a given thread group with a specified TGID, you can view all the
threads PIDs in that thread group thus:
pstree -p TGID

and:
pstree TGID
 will give one line; It visually merges identical branches by putting
them in square brackets and prefixing them with the repetition count.

Regards,
Rami Rosen
http://ramirose.wix.com/ramirosen


On Tue, Apr 2, 2013 at 9:14 PM,  valdis.kletni...@vt.edu wrote:
 On Tue, 02 Apr 2013 16:46:24 +0300, Kevin Wilson said:
 Hi,
 Thanks  a lot Vlad. This explains it.
 - Does anybody know of a ps command (or a filter to  ps command)
 which will display only multithreaded
 processes (list processes by TGID) ?  (I know now about the option of
 displaying cgroup.procs , but is something parallel can be done with ps ? )

 Have you tried 'ps -m' and friends?  Though it doesn't do exactly
 what you wanted and *only* display multithreaded, you need to do some
 post-processing:

 $ ps max
 ...
928 ?-  0:00 /sbin/auditd -n
  - -Ssl   0:00 -
  - -Ssl   0:00 -
940 ?-  0:00 /sbin/audispd
  - -Ssl   0:00 -
  - -Ssl   0:00 -
951 ?-  0:00 /usr/sbin/abrtd -d -s
  - -Ss 0:00 -
960 ?-  0:00 /usr/bin/abrt-watch-log -F Backtrace 
 /var/log/Xorg.0.log -- /usr/bin/abrt-dump-xorg -xD
  - -Ss 0:00 -

 If there's 2 or more '- -' after the process entry, it's multi=threaded.

 Note however that as far as the kernel is concerned, a single-threaded
 process is handled by the code as a multi-threaded that happens to have
 only one thread at the moment.  In other words, thinking that single and
 multi threaded is different in some mystical way will probably end up
 causing trouble for  you...

 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Method to calculate user space thread size

2013-04-02 Thread Mulyadi Santosa
On Tue, Apr 2, 2013 at 7:55 PM, naveen yadav yad.nav...@gmail.com wrote:
 Dear All,

 I have very complex user space application contain more then 400 threads. I
 want to limit the stack size in user space, for this I want to know how much
 stack size each thread use in worst case.

 To calculate this is I need to modify in kernel ? or current kernel have any
 support ?
 or is there a method I can get from smaps?

try to check /proc/pid/status on VmStk line. But IMHO that indicates
the whole stack size (sum of all thread's stack size).

BTW, sure what you want to do is safe? what if you miscalculate it?
Certainly your application would crash some ways. So, maybe you need
other workaround. If you need to reserve memory, perhaps what you need
to do is doing malloc() wisely.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies