Find the answer to your Linux question:
Results 1 to 4 of 4
i'm writting my usb driver. while mounting usb device file system i'm getting this error but kernel is not crashing.. if anyone knows anything regarding this plz rply.. here test_app9 ...
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Posts
    11

    Question BUG: at kernel/sched.c

    i'm writting my usb driver.
    while mounting usb device file system i'm getting this error but kernel is not crashing..
    if anyone knows anything regarding this plz rply..
    here test_app9 is my driver and wait_for_completion_interruptible_timeout or wait_for_completion (i have tried for both API) function giving this bug..


    BUG: sleeping function called from invalid context at kernel/sched.c:4684
    Feb 22 17:12:55 localhost kernel: in_atomic():0, irqs_disabled():1
    Feb 22 17:12:55 localhost kernel: Pid: 14728, comm: mount Not tainted 2.6.27.42 #1
    Feb 22 17:12:55 localhost kernel: [<c041f1d4>] __might_sleep+0xae/0xb3
    Feb 22 17:12:55 localhost kernel: [<c063ae43>] wait_for_common+0x1f/0x117
    Feb 22 17:12:55 localhost kernel: [<c063a3fe>] ? printk+0xf/0x11
    Feb 22 17:12:55 localhost kernel: [<c063afad>] wait_for_completion+0x12/0x14
    Feb 22 17:12:55 localhost kernel: [<f8f91250>] usb_stor_msg_common+0x78/0x90 [test_app9]
    Feb 22 17:12:55 localhost kernel: [<f8f9145d>] usb_stor_bulk_transfer+0x62/0x181 [test_app9]
    Feb 22 17:12:55 localhost kernel: [<f8f916dd>] handle_cmd+0x161/0x422 [test_app9]
    Feb 22 17:12:55 localhost kernel: [<f8f91fe6>] test_request+0x232/0x2ab [test_app9]
    Feb 22 17:12:55 localhost kernel: [<c04ee9e7>] __generic_unplug_device+0x1d/0x20
    Feb 22 17:12:55 localhost kernel: [<c04eec67>] generic_unplug_device+0x21/0x3a
    Feb 22 17:12:55 localhost kernel: [<c04ed77d>] blk_unplug+0x51/0x58
    Feb 22 17:12:55 localhost kernel: [<c04ed78f>] blk_backing_dev_unplug+0xb/0xd
    Feb 22 17:12:55 localhost kernel: [<c04a3e65>] block_sync_page+0x32/0x34
    Feb 22 17:12:55 localhost kernel: [<c0464a6d>] sync_page+0x31/0x3a
    Feb 22 17:12:55 localhost kernel: [<c0464a7e>] sync_page_killable+0x8/0x2e
    Feb 22 17:12:55 localhost kernel: [<c063b10b>] __wait_on_bit_lock+0x34/0x70
    Feb 22 17:12:55 localhost kernel: [<c0464a76>] ? sync_page_killable+0x0/0x2e
    Feb 22 17:12:55 localhost kernel: [<c04649a7>] __lock_page_killable+0x7b/0x83
    Feb 22 17:12:55 localhost kernel: [<c043b272>] ? wake_bit_function+0x0/0x43
    Feb 22 17:12:55 localhost kernel: [<c0466553>] generic_file_aio_read+0x385/0x588
    Feb 22 17:12:55 localhost kernel: [<c0487242>] do_sync_read+0xab/0xe9
    Feb 22 17:12:55 localhost kernel: [<c043b23f>] ? autoremove_wake_function+0x0/0x33
    Feb 22 17:12:55 localhost kernel: [<c04db692>] ? selinux_file_permission+0xff/0x105
    Feb 22 17:12:55 localhost kernel: [<c04d49be>] ? security_file_permission+0xf/0x11
    Feb 22 17:12:55 localhost kernel: [<c0487197>] ? do_sync_read+0x0/0xe9
    Feb 22 17:12:55 localhost kernel: [<c0487bdb>] vfs_read+0x87/0x12b
    Feb 22 17:12:55 localhost kernel: [<c0487d18>] sys_read+0x3b/0x60
    Feb 22 17:12:55 localhost kernel: [<c0403a2f>] sysenter_do_call+0x12/0x2f
    Feb 22 17:12:55 localhost kernel: =======================

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Just a guess but I think you made a sleep call or some call that could sleep (blocking I/O perhaps?) inside your IRQ function that is not allowed in such a context.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Posts
    11
    Quote Originally Posted by Rubberman View Post
    Just a guess but I think you made a sleep call or some call that could sleep (blocking I/O perhaps?) inside your IRQ function that is not allowed in such a context.
    i'm calling wait_for_completion_interruptible_timeout that may be internally calling sleep function i'm not sure
    and what is "mount Not tainted 2.6.27.42 #1"
    ??

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Quote Originally Posted by arch07 View Post
    i'm calling wait_for_completion_interruptible_timeout that may be internally calling sleep function i'm not sure
    and what is "mount Not tainted 2.6.27.42 #1"
    ??
    The question is whether wait_for_completion_interruptible_timeout can be called from an interrupt handler. It is interruptible, but I doubt you can call it from inside a handler. As for the "mount Not tainted" message, I really don't know for sure.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...