linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG: sleeping function called from invalid context at include/linux/freezer.h:45
@ 2012-01-10  4:27 Kyungmin Park
  2012-01-10  5:52 ` Amit Sahrawat
  2012-01-10 13:04 ` Srivatsa S. Bhat
  0 siblings, 2 replies; 5+ messages in thread
From: Kyungmin Park @ 2012-01-10  4:27 UTC (permalink / raw)
  To: Pavel Machek, Rafael J. Wysocki
  Cc: Len Brown, linux-pm, linux-kernel, Tejun Heo

Dear all

with the latest kernel. I got the below bug message.
It calls the sleep function. Does it intended operation?

static inline bool try_to_freeze(void)
{
        might_sleep();
        if (likely(!freezing(current)))
                return false;
        return __refrigerator(false);
}

# poweroff
[    6.852523] BUG: sleeping function called from invalid context at
include/linux/freezer.h:45
[    6.859489] in_atomic(): 0, irqs_disabled(): 128, pid: 1, name: init
[    6.865846] [<c0013508>] (unwind_backtrace+0x0/0xec) from
[<c0010124>] (do_signal+0x88/0x588)
[    6.874337] [<c0010124>] (do_signal+0x88/0x588) from [<c001063c>]
(do_notify_resume+0x18/0x38)
[    6.882928] [<c001063c>] (do_notify_resume+0x18/0x38) from
[<c000dc18>] (work_pending+0x24/0x28)

commit e4e11180dfa545233e5145919b75b7fac88638df
Merge: 37cfc3f adc0e91
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon Jan 9 17:37:37 2012 -0800

    Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vi

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BUG: sleeping function called from invalid context at include/linux/freezer.h:45
  2012-01-10  4:27 BUG: sleeping function called from invalid context at include/linux/freezer.h:45 Kyungmin Park
@ 2012-01-10  5:52 ` Amit Sahrawat
  2012-01-10  5:59   ` Kyungmin Park
  2012-01-10 13:04 ` Srivatsa S. Bhat
  1 sibling, 1 reply; 5+ messages in thread
From: Amit Sahrawat @ 2012-01-10  5:52 UTC (permalink / raw)
  To: Kyungmin Park
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, linux-pm,
	linux-kernel, Tejun Heo

On Tue, Jan 10, 2012 at 9:57 AM, Kyungmin Park <kmpark@infradead.org> wrote:
> Dear all
>
> with the latest kernel. I got the below bug message.
> It calls the sleep function. Does it intended operation?
>
> static inline bool try_to_freeze(void)
> {
>        might_sleep();
>        if (likely(!freezing(current)))
>                return false;
>        return __refrigerator(false);
> }
this change is part of this GIT:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=a0acae0e886d44bd5ce6d2f173c1ace0fcf0d9f6

>
> # poweroff
> [    6.852523] BUG: sleeping function called from invalid context at
> include/linux/freezer.h:45
> [    6.859489] in_atomic(): 0, irqs_disabled(): 128, pid: 1, name: init
> [    6.865846] [<c0013508>] (unwind_backtrace+0x0/0xec) from
> [<c0010124>] (do_signal+0x88/0x588)
> [    6.874337] [<c0010124>] (do_signal+0x88/0x588) from [<c001063c>]
> (do_notify_resume+0x18/0x38)
> [    6.882928] [<c001063c>] (do_notify_resume+0x18/0x38) from
> [<c000dc18>] (work_pending+0x24/0x28)
is this the complete backtrace...?
The above backtrace shows that freezing was called from a context
wherein - IRQs are disabled - which resulted in this error.
How about checking ...
BUG_ON(irqs_disabled()); in try_to_freeze()...
not sure though... please check and update me also...
>
> commit e4e11180dfa545233e5145919b75b7fac88638df
> Merge: 37cfc3f adc0e91
> Author: Linus Torvalds <torvalds@linux-foundation.org>
> Date:   Mon Jan 9 17:37:37 2012 -0800
>
>    Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vi
>
> Thank you,
> Kyungmin Park
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BUG: sleeping function called from invalid context at include/linux/freezer.h:45
  2012-01-10  5:52 ` Amit Sahrawat
@ 2012-01-10  5:59   ` Kyungmin Park
  0 siblings, 0 replies; 5+ messages in thread
From: Kyungmin Park @ 2012-01-10  5:59 UTC (permalink / raw)
  To: Amit Sahrawat
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, linux-pm,
	linux-kernel, Tejun Heo

On 1/10/12, Amit Sahrawat <amit.sahrawat83@gmail.com> wrote:
> On Tue, Jan 10, 2012 at 9:57 AM, Kyungmin Park <kmpark@infradead.org> wrote:
>> Dear all
>>
>> with the latest kernel. I got the below bug message.
>> It calls the sleep function. Does it intended operation?
>>
>> static inline bool try_to_freeze(void)
>> {
>>        might_sleep();
>>        if (likely(!freezing(current)))
>>                return false;
>>        return __refrigerator(false);
>> }
> this change is part of this GIT:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=a0acae0e886d44bd5ce6d2f173c1ace0fcf0d9f6
>
>>
>> # poweroff
>> [    6.852523] BUG: sleeping function called from invalid context at
>> include/linux/freezer.h:45
>> [    6.859489] in_atomic(): 0, irqs_disabled(): 128, pid: 1, name: init
>> [    6.865846] [<c0013508>] (unwind_backtrace+0x0/0xec) from
>> [<c0010124>] (do_signal+0x88/0x588)
>> [    6.874337] [<c0010124>] (do_signal+0x88/0x588) from [<c001063c>]
>> (do_notify_resume+0x18/0x38)
>> [    6.882928] [<c001063c>] (do_notify_resume+0x18/0x38) from
>> [<c000dc18>] (work_pending+0x24/0x28)
> is this the complete backtrace...?
yes
> The above backtrace shows that freezing was called from a context
> wherein - IRQs are disabled - which resulted in this error.
> How about checking ...
> BUG_ON(irqs_disabled()); in try_to_freeze()...
> not sure though... please check and update me also...
Here's update trace with BUG_ON(irqs_disabled())

# poweroff
[    8.147056] ------------[ cut here ]------------
[    8.150205] kernel BUG at include/linux/freezer.h:45!
[    8.155236] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP
[    8.162266] Modules linked in:
[    8.165306] CPU: 1    Not tainted  (3.2.0+ #97)
[    8.169830] PC is at do_signal+0x84/0x598
[    8.173814] LR is at do_notify_resume+0x18/0x38
[    8.178327] pc : [<c0010120>]    lr : [<c001064c>]    psr: 20000093
[    8.178333] sp : df849ed0  ip : 00100100  fp : 00000000
[    8.189781] r10: b6cd089c  r9 : df848000  r8 : 00000000
[    8.194991] r7 : c000dd44  r6 : fffffe00  r5 : b6cd08a0  r4 : df849fb0
[    8.201500] r3 : ffffffff  r2 : 00000080  r1 : c000dd44  r0 : df849fb0
[    8.208011] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment use
r
[    8.215215] Control: 10c53c7d  Table: 5f9c004a  DAC: 00000015
[    8.220945] Process init (pid: 1, stack limit = 0xdf8482f0)
[    8.226498] Stack: (0xdf849ed0 to 0xdf84a000)
[    8.230840] 9ec0:                                     df848000 00000000 00000
000 c0042b18
[    8.239001] 9ee0: df849f30 c0269028 0000c350 00000001 bee6fc08 df849f30 0000c
350 0000c350
[    8.247161] 9f00: 00000000 3b9aca00 00000001 df84a00c 00000001 00000001 df849
f2c c004bc18
[    8.255320] 9f20: df849f60 df848000 00000000 c026aa60 df849f60 c0025890 df849
f60 df844168
[    8.263478] 9f40: 00000004 00000003 00000000 00000000 00000000 df848000 00000
000 c0025960
[    8.271637] 9f60: 00000003 00000004 00000000 00000000 00000000 00000000 00000
000 df844000
[    8.279797] 9f80: c0024468 00000001 00000000 00000000 00000072 00000000 df848
000 00000000
[    8.287956] 9fa0: 00000000 c001064c b6f0fa88 c000dc18 ffffffff 00000000 00000
000 00000000
[    8.296115] 9fc0: b6f0fa88 00000000 00000000 00000072 ffffffff 00000000 00000
2fe 00000000
[    8.304275] 9fe0: b6d73000 bee6fc18 b6ed2c8c b6cd089c 60000010 ffffffff fffff
fff ffffffff
[    8.312442] [<c0010120>] (do_signal+0x84/0x598) from [<c001064c>] (do_notify_
resume+0x18/0x38)
[    8.321032] [<c001064c>] (do_notify_resume+0x18/0x38) from [<c000dc18>] (work
_pending+0x24/0x28)
[    8.329795] Code: e5843000 e10f2000 e2122080 0a000001 (e7f001f2)
[    8.335894] ---[ end trace 036b1d3292ef9478 ]---
# [    8.340671] Kernel panic - not syncing: Attempted to kill init!
[    8.346579] [<c0013508>] (unwind_backtrace+0x0/0xec) from [<c0267eac>] (panic
+0x5c/0x1a0)
[    8.354724] [<c0267eac>] (panic+0x5c/0x1a0) from [<c0025b54>] (do_exit+0xa0/0
x6d4)
[    8.362279] [<c0025b54>] (do_exit+0xa0/0x6d4) from [<c0011534>] (die+0x1c4/0x
1f0)
[    8.369735] [<c0011534>] (die+0x1c4/0x1f0) from [<c0008368>] (do_undefinstr+0
x164/0x188)
[    8.377806] [<c0008368>] (do_undefinstr+0x164/0x188) from [<c000d868>] (__und
_svc+0x48/0x60)
[    8.386221] Exception stack(0xdf849e88 to 0xdf849ed0)
[    8.391256] 9e80:                   df849fb0 c000dd44 00000080 ffffffff df849
fb0 b6cd08a0
[    8.399416] 9ea0: fffffe00 c000dd44 00000000 df848000 b6cd089c 00000000 00100
100 df849ed0
[    8.407571] 9ec0: c001064c c0010120 20000093 ffffffff
[    8.412612] [<c000d868>] (__und_svc+0x48/0x60) from [<c0010120>] (do_signal+0
x84/0x598)
[    8.420598] [<c0010120>] (do_signal+0x84/0x598) from [<c001064c>] (do_notify_
resume+0x18/0x38)
[    8.429190] [<c001064c>] (do_notify_resume+0x18/0x38) from [<c000dc18>] (work
_pending+0x24/0x28)
[    8.437952] CPU0: stopping
[    8.440645] [<c0013508>] (unwind_backtrace+0x0/0xec) from [<c0012524>] (handl
e_IPI+0xec/0x168)
[    8.449234] [<c0012524>] (handle_IPI+0xec/0x168) from [<c0008558>] (gic_handl
e_irq+0xa0/0xac)
[    8.457740] [<c0008558>] (gic_handle_irq+0xa0/0xac) from [<c000d7c0>] (__irq_
svc+0x40/0x70)
[    8.466066] Exception stack(0xc036df40 to 0xc036df88)
[    8.471106] df40: 0006542c 00001f40 00000008 18b8ce13 c0801318 00000000 c036c
000 c03859d4
[    8.479264] df60: c03a6538 412fc091 00000000 00000000 18b8cdfb c036df88 c0058
f6c c001da9c
[    8.487419] df80: 20000013 ffffffff
[    8.490904] [<c000d7c0>] (__irq_svc+0x40/0x70) from [<c001da9c>] (exynos4_ent
er_idle+0x2c/0x5c)
[    8.499583] [<c001da9c>] (exynos4_enter_idle+0x2c/0x5c) from [<c021c3e4>] (cp
uidle_idle_call+0x1a0/0x340)
[    8.509128] [<c021c3e4>] (cpuidle_idle_call+0x1a0/0x340) from [<c000ed24>] (c
pu_idle+0x74/0xe0)
[    8.517810] [<c000ed24>] (cpu_idle+0x74/0xe0) from [<c034a858>] (start_kernel
+0x32c/0x384)
[    8.526049] Rebooting in 1 seconds..
>>
>> commit e4e11180dfa545233e5145919b75b7fac88638df
>> Merge: 37cfc3f adc0e91
>> Author: Linus Torvalds <torvalds@linux-foundation.org>
>> Date:   Mon Jan 9 17:37:37 2012 -0800
>>
>>    Merge branch 'for-linus' of
>> git://git.kernel.org/pub/scm/linux/kernel/git/vi
>>
>> Thank you,
>> Kyungmin Park
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BUG: sleeping function called from invalid context at include/linux/freezer.h:45
  2012-01-10  4:27 BUG: sleeping function called from invalid context at include/linux/freezer.h:45 Kyungmin Park
  2012-01-10  5:52 ` Amit Sahrawat
@ 2012-01-10 13:04 ` Srivatsa S. Bhat
  2012-01-11  0:57   ` Kyungmin Park
  1 sibling, 1 reply; 5+ messages in thread
From: Srivatsa S. Bhat @ 2012-01-10 13:04 UTC (permalink / raw)
  To: Kyungmin Park
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, linux-pm,
	linux-kernel, Tejun Heo, Russell King - ARM Linux,
	linux-arm-kernel

On 01/10/2012 09:57 AM, Kyungmin Park wrote:

> Dear all
> 
> with the latest kernel. I got the below bug message.
> It calls the sleep function. Does it intended operation?
> 
> static inline bool try_to_freeze(void)
> {
>         might_sleep();
>         if (likely(!freezing(current)))
>                 return false;
>         return __refrigerator(false);
> }
> 
> # poweroff
> [    6.852523] BUG: sleeping function called from invalid context at
> include/linux/freezer.h:45
> [    6.859489] in_atomic(): 0, irqs_disabled(): 128, pid: 1, name: init
> [    6.865846] [<c0013508>] (unwind_backtrace+0x0/0xec) from
> [<c0010124>] (do_signal+0x88/0x588)
> [    6.874337] [<c0010124>] (do_signal+0x88/0x588) from [<c001063c>]
> (do_notify_resume+0x18/0x38)
> [    6.882928] [<c001063c>] (do_notify_resume+0x18/0x38) from
> [<c000dc18>] (work_pending+0x24/0x28)
> 


You seem to be running on Arm architecture. Can you please try the patch
at https://lkml.org/lkml/2011/8/25/231 ?

Regards,
Srivatsa S. Bhat
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: BUG: sleeping function called from invalid context at include/linux/freezer.h:45
  2012-01-10 13:04 ` Srivatsa S. Bhat
@ 2012-01-11  0:57   ` Kyungmin Park
  0 siblings, 0 replies; 5+ messages in thread
From: Kyungmin Park @ 2012-01-11  0:57 UTC (permalink / raw)
  To: Srivatsa S. Bhat
  Cc: Pavel Machek, Rafael J. Wysocki, Len Brown, linux-pm,
	linux-kernel, Tejun Heo, Russell King - ARM Linux,
	linux-arm-kernel

On 1/10/12, Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> wrote:
> On 01/10/2012 09:57 AM, Kyungmin Park wrote:
>
>> Dear all
>>
>> with the latest kernel. I got the below bug message.
>> It calls the sleep function. Does it intended operation?
>>
>> static inline bool try_to_freeze(void)
>> {
>>         might_sleep();
>>         if (likely(!freezing(current)))
>>                 return false;
>>         return __refrigerator(false);
>> }
>>
>> # poweroff
>> [    6.852523] BUG: sleeping function called from invalid context at
>> include/linux/freezer.h:45
>> [    6.859489] in_atomic(): 0, irqs_disabled(): 128, pid: 1, name: init
>> [    6.865846] [<c0013508>] (unwind_backtrace+0x0/0xec) from
>> [<c0010124>] (do_signal+0x88/0x588)
>> [    6.874337] [<c0010124>] (do_signal+0x88/0x588) from [<c001063c>]
>> (do_notify_resume+0x18/0x38)
>> [    6.882928] [<c001063c>] (do_notify_resume+0x18/0x38) from
>> [<c000dc18>] (work_pending+0x24/0x28)
>>
>
>
> You seem to be running on Arm architecture. Can you please try the patch
> at https://lkml.org/lkml/2011/8/25/231 ?

Thank you,
It's working and I read the all mails related with this issue. and
need to fix it at arm side.

I think some more codes from arm are needed to work it properly.

Thank you,
Kyungmin Park
>
> Regards,
> Srivatsa S. Bhat
> IBM Linux Technology Center
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-11  0:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-10  4:27 BUG: sleeping function called from invalid context at include/linux/freezer.h:45 Kyungmin Park
2012-01-10  5:52 ` Amit Sahrawat
2012-01-10  5:59   ` Kyungmin Park
2012-01-10 13:04 ` Srivatsa S. Bhat
2012-01-11  0:57   ` Kyungmin Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).