All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.33.5 rt23: sleeping function called from invalid context
@ 2010-07-08  3:54 Fernando Lopez-Lezcano
  2010-07-08 17:37 ` john stultz
  0 siblings, 1 reply; 6+ messages in thread
From: Fernando Lopez-Lezcano @ 2010-07-08  3:54 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, rt-users, Steven Rostedt, Nick Piggin, John Stultz, nando

After a suspend/wake up cycle, just after upgrading to fc12 (I did not
see this with the same basic kernel - that is, compiled from the same
source + patches - under fc11). 

BUG: sleeping function called from invalid context at
kernel/rtmutex.c:684
pcnt: 0 0 in_atomic(): 0, irqs_disabled(): 1, pid: 10582, name:
pm-suspend
Pid: 10582, comm: pm-suspend Not tainted
2.6.33.5-120.rt23.1.fc11.ccrma.i686.rtPAE #1
Call Trace:
[<c042eced>] __might_sleep+0xcc/0xd4
[<c0464f57>] rt_spin_lock_fastlock.clone.1+0x26/0x5f
[<c0792862>] rt_spin_lock+0x8/0xa
[<c040dddc>] read_persistent_clock+0x11/0x30
[<c045d1de>] timekeeping_suspend+0xe/0x4e
[<c0640c9e>] sysdev_suspend+0x15c/0x356
[<c0792906>] ? _mutex_unlock+0x8/0xa
[<c046afc1>] suspend_devices_and_enter+0xea/0x17f
[<c046b11e>] enter_state+0xc8/0x114
[<c046a9cf>] state_store+0x93/0xa7
[<c046a93c>] ? state_store+0x0/0xa7
[<c05a6505>] kobj_attr_store+0x16/0x22
[<c0515afa>] sysfs_write_file+0xbf/0xea
[<c0515a3b>] ? sysfs_write_file+0x0/0xea
[<c04d26ba>] vfs_write+0x80/0xdf
[<c0465134>] ? rt_up_read+0x13/0x15
[<c04d27ad>] sys_write+0x3b/0x5d
[<c040895f>] sysenter_do_call+0x12/0x28

-- Fernando



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

* Re: 2.6.33.5 rt23: sleeping function called from invalid context
  2010-07-08  3:54 2.6.33.5 rt23: sleeping function called from invalid context Fernando Lopez-Lezcano
@ 2010-07-08 17:37 ` john stultz
  2010-07-08 17:49   ` Fernando Lopez-Lezcano
  2010-07-09  1:44   ` john stultz
  0 siblings, 2 replies; 6+ messages in thread
From: john stultz @ 2010-07-08 17:37 UTC (permalink / raw)
  To: Fernando Lopez-Lezcano
  Cc: Thomas Gleixner, LKML, rt-users, Steven Rostedt, Nick Piggin

On Wed, 2010-07-07 at 20:54 -0700, Fernando Lopez-Lezcano wrote:
> After a suspend/wake up cycle, just after upgrading to fc12 (I did not
> see this with the same basic kernel - that is, compiled from the same
> source + patches - under fc11). 
> 
> BUG: sleeping function called from invalid context at
> kernel/rtmutex.c:684
> pcnt: 0 0 in_atomic(): 0, irqs_disabled(): 1, pid: 10582, name:
> pm-suspend
> Pid: 10582, comm: pm-suspend Not tainted
> 2.6.33.5-120.rt23.1.fc11.ccrma.i686.rtPAE #1
> Call Trace:
> [<c042eced>] __might_sleep+0xcc/0xd4
> [<c0464f57>] rt_spin_lock_fastlock.clone.1+0x26/0x5f
> [<c0792862>] rt_spin_lock+0x8/0xa
> [<c040dddc>] read_persistent_clock+0x11/0x30
> [<c045d1de>] timekeeping_suspend+0xe/0x4e
> [<c0640c9e>] sysdev_suspend+0x15c/0x356
> [<c0792906>] ? _mutex_unlock+0x8/0xa
> [<c046afc1>] suspend_devices_and_enter+0xea/0x17f
> [<c046b11e>] enter_state+0xc8/0x114
> [<c046a9cf>] state_store+0x93/0xa7
> [<c046a93c>] ? state_store+0x0/0xa7
> [<c05a6505>] kobj_attr_store+0x16/0x22
> [<c0515afa>] sysfs_write_file+0xbf/0xea
> [<c0515a3b>] ? sysfs_write_file+0x0/0xea
> [<c04d26ba>] vfs_write+0x80/0xdf
> [<c0465134>] ? rt_up_read+0x13/0x15
> [<c04d27ad>] sys_write+0x3b/0x5d
> [<c040895f>] sysenter_do_call+0x12/0x28

Huh. Looks like the lock protecting the RTC/CMOS might need to be
converted to a raw spinlock, since suspend/resume is probably done with
irqs off.

A little baffled why the same kernel didn't see this with fc11.

Does this reproduce easily?

thanks
-john


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

* Re: 2.6.33.5 rt23: sleeping function called from invalid context
  2010-07-08 17:37 ` john stultz
@ 2010-07-08 17:49   ` Fernando Lopez-Lezcano
  2010-07-09  1:44   ` john stultz
  1 sibling, 0 replies; 6+ messages in thread
From: Fernando Lopez-Lezcano @ 2010-07-08 17:49 UTC (permalink / raw)
  To: john stultz
  Cc: nando, Thomas Gleixner, LKML, rt-users, Steven Rostedt, Nick Piggin

On Thu, 2010-07-08 at 10:37 -0700, john stultz wrote:
> On Wed, 2010-07-07 at 20:54 -0700, Fernando Lopez-Lezcano wrote:
> > After a suspend/wake up cycle, just after upgrading to fc12 (I did not
> > see this with the same basic kernel - that is, compiled from the same
> > source + patches - under fc11). 
> > 
> > BUG: sleeping function called from invalid context at
> > kernel/rtmutex.c:684
> > pcnt: 0 0 in_atomic(): 0, irqs_disabled(): 1, pid: 10582, name:
> > pm-suspend
> > Pid: 10582, comm: pm-suspend Not tainted
> > 2.6.33.5-120.rt23.1.fc11.ccrma.i686.rtPAE #1
> > Call Trace:
> > [<c042eced>] __might_sleep+0xcc/0xd4
> > [<c0464f57>] rt_spin_lock_fastlock.clone.1+0x26/0x5f
> > [<c0792862>] rt_spin_lock+0x8/0xa
> > [<c040dddc>] read_persistent_clock+0x11/0x30
> > [<c045d1de>] timekeeping_suspend+0xe/0x4e
> > [<c0640c9e>] sysdev_suspend+0x15c/0x356
> > [<c0792906>] ? _mutex_unlock+0x8/0xa
> > [<c046afc1>] suspend_devices_and_enter+0xea/0x17f
> > [<c046b11e>] enter_state+0xc8/0x114
> > [<c046a9cf>] state_store+0x93/0xa7
> > [<c046a93c>] ? state_store+0x0/0xa7
> > [<c05a6505>] kobj_attr_store+0x16/0x22
> > [<c0515afa>] sysfs_write_file+0xbf/0xea
> > [<c0515a3b>] ? sysfs_write_file+0x0/0xea
> > [<c04d26ba>] vfs_write+0x80/0xdf
> > [<c0465134>] ? rt_up_read+0x13/0x15
> > [<c04d27ad>] sys_write+0x3b/0x5d
> > [<c040895f>] sysenter_do_call+0x12/0x28
> 
> Huh. Looks like the lock protecting the RTC/CMOS might need to be
> converted to a raw spinlock, since suspend/resume is probably done with
> irqs off.
> 
> A little baffled why the same kernel didn't see this with fc11.

Same here, maybe I did not notice before?

> Does this reproduce easily?

Happens every time I suspend/resume (I think). No apparent side
effects. 

-- Fernando



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

* Re: 2.6.33.5 rt23: sleeping function called from invalid context
  2010-07-08 17:37 ` john stultz
  2010-07-08 17:49   ` Fernando Lopez-Lezcano
@ 2010-07-09  1:44   ` john stultz
  2010-07-14 22:06     ` Fernando Lopez-Lezcano
  1 sibling, 1 reply; 6+ messages in thread
From: john stultz @ 2010-07-09  1:44 UTC (permalink / raw)
  To: Fernando Lopez-Lezcano
  Cc: Thomas Gleixner, LKML, rt-users, Steven Rostedt, Nick Piggin

On Thu, 2010-07-08 at 10:37 -0700, john stultz wrote:
> On Wed, 2010-07-07 at 20:54 -0700, Fernando Lopez-Lezcano wrote:
> > After a suspend/wake up cycle, just after upgrading to fc12 (I did not
> > see this with the same basic kernel - that is, compiled from the same
> > source + patches - under fc11). 
> > 
> > BUG: sleeping function called from invalid context at
> > kernel/rtmutex.c:684
> > pcnt: 0 0 in_atomic(): 0, irqs_disabled(): 1, pid: 10582, name:
> > pm-suspend
> > Pid: 10582, comm: pm-suspend Not tainted
> > 2.6.33.5-120.rt23.1.fc11.ccrma.i686.rtPAE #1
> > Call Trace:
> > [<c042eced>] __might_sleep+0xcc/0xd4
> > [<c0464f57>] rt_spin_lock_fastlock.clone.1+0x26/0x5f
> > [<c0792862>] rt_spin_lock+0x8/0xa
> > [<c040dddc>] read_persistent_clock+0x11/0x30
> > [<c045d1de>] timekeeping_suspend+0xe/0x4e
> > [<c0640c9e>] sysdev_suspend+0x15c/0x356
> > [<c0792906>] ? _mutex_unlock+0x8/0xa
> > [<c046afc1>] suspend_devices_and_enter+0xea/0x17f
> 
> Huh. Looks like the lock protecting the RTC/CMOS might need to be
> converted to a raw spinlock, since suspend/resume is probably done with
> irqs off.

Oof. The rtc_lock is used all over the place. Not sure if we really want
to convert it to a raw_spinlock. 

However, sysdev_suspend() wants interrupts off on all the .suspend
calls. I'm surprised we haven't hit this issue with more drivers. Maybe
no one is testing suspend w/ -rt? Or am I just missing an obvious
solution?

Thomas, any thoughts on this? 

thanks
-john




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

* Re: 2.6.33.5 rt23: sleeping function called from invalid context
  2010-07-09  1:44   ` john stultz
@ 2010-07-14 22:06     ` Fernando Lopez-Lezcano
  2010-07-14 22:12       ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Fernando Lopez-Lezcano @ 2010-07-14 22:06 UTC (permalink / raw)
  To: john stultz
  Cc: nando, Thomas Gleixner, LKML, rt-users, Steven Rostedt, Nick Piggin

On Thu, 2010-07-08 at 18:44 -0700, john stultz wrote:
> On Thu, 2010-07-08 at 10:37 -0700, john stultz wrote:
> > On Wed, 2010-07-07 at 20:54 -0700, Fernando Lopez-Lezcano wrote:
> > > After a suspend/wake up cycle, just after upgrading to fc12 (I did not
> > > see this with the same basic kernel - that is, compiled from the same
> > > source + patches - under fc11). 
> > > 
> > > BUG: sleeping function called from invalid context at
> > > kernel/rtmutex.c:684
> > > pcnt: 0 0 in_atomic(): 0, irqs_disabled(): 1, pid: 10582, name:
> > > pm-suspend
> > > Pid: 10582, comm: pm-suspend Not tainted
> > > 2.6.33.5-120.rt23.1.fc11.ccrma.i686.rtPAE #1
> > > Call Trace:
> > > [<c042eced>] __might_sleep+0xcc/0xd4
> > > [<c0464f57>] rt_spin_lock_fastlock.clone.1+0x26/0x5f
> > > [<c0792862>] rt_spin_lock+0x8/0xa
> > > [<c040dddc>] read_persistent_clock+0x11/0x30
> > > [<c045d1de>] timekeeping_suspend+0xe/0x4e
> > > [<c0640c9e>] sysdev_suspend+0x15c/0x356
> > > [<c0792906>] ? _mutex_unlock+0x8/0xa
> > > [<c046afc1>] suspend_devices_and_enter+0xea/0x17f
> > 
> > Huh. Looks like the lock protecting the RTC/CMOS might need to be
> > converted to a raw spinlock, since suspend/resume is probably done with
> > irqs off.
> 
> Oof. The rtc_lock is used all over the place. Not sure if we really want
> to convert it to a raw_spinlock. 
> 
> However, sysdev_suspend() wants interrupts off on all the .suspend
> calls. I'm surprised we haven't hit this issue with more drivers. Maybe
> no one is testing suspend w/ -rt? Or am I just missing an obvious
> solution?
> 
> Thomas, any thoughts on this? 

(BTW, this is still happening in rt26...)
-- Fernando




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

* Re: 2.6.33.5 rt23: sleeping function called from invalid context
  2010-07-14 22:06     ` Fernando Lopez-Lezcano
@ 2010-07-14 22:12       ` Thomas Gleixner
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2010-07-14 22:12 UTC (permalink / raw)
  To: Fernando Lopez-Lezcano
  Cc: john stultz, LKML, rt-users, Steven Rostedt, Nick Piggin

On Wed, 14 Jul 2010, Fernando Lopez-Lezcano wrote:
> On Thu, 2010-07-08 at 18:44 -0700, john stultz wrote:
> > On Thu, 2010-07-08 at 10:37 -0700, john stultz wrote:
> > > On Wed, 2010-07-07 at 20:54 -0700, Fernando Lopez-Lezcano wrote:
> > > > After a suspend/wake up cycle, just after upgrading to fc12 (I did not
> > > > see this with the same basic kernel - that is, compiled from the same
> > > > source + patches - under fc11). 
> > > > 
> > > > BUG: sleeping function called from invalid context at
> > > > kernel/rtmutex.c:684
> > > > pcnt: 0 0 in_atomic(): 0, irqs_disabled(): 1, pid: 10582, name:
> > > > pm-suspend
> > > > Pid: 10582, comm: pm-suspend Not tainted
> > > > 2.6.33.5-120.rt23.1.fc11.ccrma.i686.rtPAE #1
> > > > Call Trace:
> > > > [<c042eced>] __might_sleep+0xcc/0xd4
> > > > [<c0464f57>] rt_spin_lock_fastlock.clone.1+0x26/0x5f
> > > > [<c0792862>] rt_spin_lock+0x8/0xa
> > > > [<c040dddc>] read_persistent_clock+0x11/0x30
> > > > [<c045d1de>] timekeeping_suspend+0xe/0x4e
> > > > [<c0640c9e>] sysdev_suspend+0x15c/0x356
> > > > [<c0792906>] ? _mutex_unlock+0x8/0xa
> > > > [<c046afc1>] suspend_devices_and_enter+0xea/0x17f
> > > 
> > > Huh. Looks like the lock protecting the RTC/CMOS might need to be
> > > converted to a raw spinlock, since suspend/resume is probably done with
> > > irqs off.
> > 
> > Oof. The rtc_lock is used all over the place. Not sure if we really want
> > to convert it to a raw_spinlock. 
> > 
> > However, sysdev_suspend() wants interrupts off on all the .suspend
> > calls. I'm surprised we haven't hit this issue with more drivers. Maybe
> > no one is testing suspend w/ -rt? Or am I just missing an obvious
> > solution?
> >
> > Thomas, any thoughts on this? 

Yep, it's basically the same scenario which we have during bootup
where we know that we cannot run into lock contention, so we can apply
the same rules. Still working on a sane solution for this.
 
> (BTW, this is still happening in rt26...)

See announce mail :)

> There are some pending issues:
> - rtc_lock suspend/resume (working on a patch)
> ...

Thanks,

	tglx

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

end of thread, other threads:[~2010-07-14 22:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-08  3:54 2.6.33.5 rt23: sleeping function called from invalid context Fernando Lopez-Lezcano
2010-07-08 17:37 ` john stultz
2010-07-08 17:49   ` Fernando Lopez-Lezcano
2010-07-09  1:44   ` john stultz
2010-07-14 22:06     ` Fernando Lopez-Lezcano
2010-07-14 22:12       ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.