2008-10-16 05:13:44     BUG: scheduling while atomic

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

2008-10-16 05:13:44     BUG: scheduling while atomic

DAVID ZHOU (CHINA)

Message: 63774   

 

I use microwin api GrCreateTimer to create timer for my demo, but when I running,it crashed and shows followed:

 

What's wrong with it?  Thanks! My version is blackfin uclinux 2008 release 1.

 

BUG: scheduling while atomic: demo/0x00000a38/174

Hardware Trace:

   0 Target : <0x00004718> { _dump_stack + 0x0 }

     Source : <0xffa019d2> { _schedule + 0x502 }

   1 Target : <0xffa019ce> { _schedule + 0x4fe }

     Source : <0x0000d50a> { _printk + 0x16 }

   2 Target : <0x0000d506> { _printk + 0x12 }

     Source : <0x0000d3bc> { _vprintk + 0x1b8 }

   3 Target : <0x0000d3b0> { _vprintk + 0x1ac }

     Source : <0xffa00d00> { __common_int_entry + 0xd8 }

   4 Target : <0xffa00c9e> { __common_int_entry + 0x76 }

     Source : <0xffa00ad0> { _return_from_int + 0x58 }

   5 Target : <0xffa00ad0> { _return_from_int + 0x58 }

     Source : <0xffa00aa6> { _return_from_int + 0x2e }

   6 Target : <0xffa00a78> { _return_from_int + 0x0 }

     Source : <0xffa00c9a> { __common_int_entry + 0x72 }

   7 Target : <0xffa00c98> { __common_int_entry + 0x70 }

     Source : <0xffa003ec> { _asm_do_IRQ + 0x68 }

   8 Target : <0xffa003e4> { _asm_do_IRQ + 0x60 }

     Source : <0x00011960> { _irq_exit + 0x2c }

   9 Target : <0x00011960> { _irq_exit + 0x2c }

     Source : <0x00011950> { _irq_exit + 0x1c }

  10 Target : <0x00011934> { _irq_exit + 0x0 }

     Source : <0xffa003e0> { _asm_do_IRQ + 0x5c }

  11 Target : <0xffa003e0> { _asm_do_IRQ + 0x5c }

     Source : <0xffa00aee> { _evt14_softirq + 0x6 }

  12 Target : <0xffa00ae8> { _evt14_softirq + 0x0 }

     Source : <0xffa00ae6> { _lower_to_irq14 + 0x12 }

  13 Target : <0xffa00ad4> { _lower_to_irq14 + 0x0 }

     Source : <0xffa003dc> { _asm_do_IRQ + 0x58 }

  14 Target : <0xffa003b6> { _asm_do_IRQ + 0x32 }

     Source : <0x00028e4c> { _handle_simple_irq + 0x68 }

  15 Target : <0x00028e40> { _handle_simple_irq + 0x5c }

     Source : <0x00028e56> { _handle_simple_irq + 0x72 }

Stack from 00311d00:

        001d3220 ffa019d6 00201800 0015d28c 001d3220 01b3a9ec 00000a38 000000ae

        00205874 001d0e48 0000001f 01ed2b20 0015d28c 00201800 00201800 00201800

        7fffffff 00311d90 00000001 00000004 0000d39e 00311d5c 00311d5c 3078303c

        00311df0 3e363565 5f207b20 646e6168 735f656c 000b00ec 00201800 7fffffff

        00311d90 00007d20 0000ffff 0000000a 00000000 01b3a860 0000a5c0 00201920

        00201920 000ad7c2 00005409 00000000 00000000 00311e48 000b747c 00000006

 

Call Trace:

[<000b49e0>] _uart_start+0xc/0x28

[<0000ffff>] _do_group_exit+0x13/0x84

[<0000ffff>] _do_group_exit+0x13/0x84

[<000b5544>] _uart_write+0x90/0xd4

[<000aea1e>] _write_chan+0x162/0x29c

[<000aea52>] _write_chan+0x196/0x29c

[<0000a5c0>] _default_wake_function+0x0/0x10

[<00100100>] _input_ff_upload+0x1ec/0x200

[<000111c0>] _current_fs_time+0x38/0x40

[<000ac000>] _tty_write+0x78/0x174

[<000410d0>] _do_ioctl+0x48/0x4c

[<00041120>] _vfs_ioctl+0x4c/0x1e4

[<0004130c>] _sys_ioctl+0x54/0x6c

[<00005409>] _set_gpio_edge+0x55/0x68

[<000412b8>] _sys_ioctl+0x0/0x6c

[<0000fffe>] _do_group_exit+0x12/0x84

[<00008000>] _l1sram_alloc+0x20/0x34

[<00005409>] _set_gpio_edge+0x55/0x68

 

BUG: scheduling while atomic: demo/0x00000a38/174

Hardware Trace:

   0 Target : <0x00004718> { _dump_stack + 0x0 }

     Source : <0xffa019d2> { _schedule + 0x502 }

   1 Target : <0xffa019ce> { _schedule + 0x4fe }

     Source : <0x0000d50a> { _printk + 0x16 }

   2 Target : <0x0000d506> { _printk + 0x12 }

     Source : <0x0000d3bc> { _vprintk + 0x1b8 }

   3 Target : <0x0000d3b0> { _vprintk + 0x1ac }

     Source : <0xffa00d00> { __common_int_entry + 0xd8 }

   4 Target : <0xffa00c9e> { __common_int_entry + 0x76 }

     Source : <0xffa00ad0> { _return_from_int + 0x58 }

   5 Target : <0xffa00ad0> { _return_from_int + 0x58 }

     Source : <0xffa00aa6> { _return_from_int + 0x2e }

   6 Target : <0xffa00a78> { _return_from_int + 0x0 }

     Source : <0xffa00c9a> { __common_int_entry + 0x72 }

   7 Target : <0xffa00c98> { __common_int_entry + 0x70 }

     Source : <0xffa003ec> { _asm_do_IRQ + 0x68 }

   8 Target : <0xffa003e4> { _asm_do_IRQ + 0x60 }

     Source : <0x00011960> { _irq_exit + 0x2c }

   9 Target : <0x00011960> { _irq_exit + 0x2c }

     Source : <0x00011950> { _irq_exit + 0x1c }

  10 Target : <0x00011934> { _irq_exit + 0x0 }

     Source : <0xffa003e0> { _asm_do_IRQ + 0x5c }

  11 Target : <0xffa003e0> { _asm_do_IRQ + 0x5c }

     Source : <0xffa00aee> { _evt14_softirq + 0x6 }

  12 Target : <0xffa00ae8> { _evt14_softirq + 0x0 }

     Source : <0xffa00ae6> { _lower_to_irq14 + 0x12 }

  13 Target : <0xffa00ad4> { _lower_to_irq14 + 0x0 }

     Source : <0xffa003dc> { _asm_do_IRQ + 0x58 }

  14 Target : <0xffa003b6> { _asm_do_IRQ + 0x32 }

     Source : <0x00028e4c> { _handle_simple_irq + 0x68 }

  15 Target : <0x00028e40> { _handle_simple_irq + 0x5c }

     Source : <0x00028e56> { _handle_simple_irq + 0x72 }

Stack from 00311e1c:

        00311e9c ffa019d6 00311e9c 0015d6da 0a624f58 01b3a9ec 00000a38 000000ae

        00000000 00000000 00000000 0030eb54 0015d6da 00311e9c 00310000 01a68648

        00310000 00000001 00311e9c 00000001 01ed2080 00000000 01a68648 00000001

        0001f5aa 00311ef4 0030ed18 0000001e 00000000 00000003 00006b09 00000010

        0189cce0 00000000 00000000 0a624f58 000000dd 0001f1f4 001d4088 00000001

        01b3a860 00000000 0004130c 0001f6a4 0001f64c 000000a2 0030ed18 0030ed18

 

Call Trace:

[<0000fffe>] _do_group_exit+0x12/0x84

[<00008000>] _l1sram_alloc+0x20/0x34

QuoteReplyEditDelete

 

 

2008-10-16 07:09:28     Re: BUG: scheduling while atomic

DAVID ZHOU (CHINA)

Message: 63782   

 

This may caused by the gettimeofday() system call.

QuoteReplyEditDelete

 

 

2008-10-16 07:10:08     Re: BUG: scheduling while atomic

DAVID ZHOU (CHINA)

Message: 63783   

 

This may caused by the gettimeofday() system call.

 

My program is multithread program.

QuoteReplyEditDelete

 

 

2008-10-17 00:32:31     Re: BUG: scheduling while atomic

Mike Frysinger (UNITED STATES)

Message: 63825   

 

seems pretty straight forward ... you cannot sleep in atomic context, or call any functions that may sleep

QuoteReplyEditDelete

 

 

2009-01-14 03:23:17     Re: BUG: scheduling while atomic

Li Yuqian (CHINA)

Message: 67906   

 

Hi Mike

 

i have same problem when using my I2C device, my main program is a only atomic operation(is a sport DMA ISR operation), but need read data from i2c device, as the i2c device need sleep, and is a no-atomic operation, when the main program to access the i2c, the kernel will be crash.

 

does we have any solution for such problem?

 

regards,

QuoteReplyEditDelete

 

 

2009-01-14 06:09:39     Re: BUG: scheduling while atomic

Mike Frysinger (UNITED STATES)

Message: 67936   

 

you cannot call a function that will sleep from atomic context.  therefore you cannot do i2c traffic.  rearchitect your driver to operate in a different way (deferred work -- workqueues, softirqs, etc...).

Attachments

    Outcomes