linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* LED heartbeat trigger - in_atomic() while allocs
@ 2007-11-26 20:07 Benedict, Michael
  2007-11-26 20:36 ` Nathan Lynch
  0 siblings, 1 reply; 3+ messages in thread
From: Benedict, Michael @ 2007-11-26 20:07 UTC (permalink / raw)
  To: linuxppc-embedded

I was playing around with the LED heartbeat trigger and it caught the
BUG() code when trying to activate.  Does anyone know why this call
stack would be in_atomic()?  Or any ideas for a patch that would allow
the heartbeat trigger to allocate when it is not in atomic context?

BUG: sleeping function called from invalid context at mm/slab.c:3024
in_atomic():1, irqs_disabled():0
Call Trace:
[def3dd90] [c0008e60] show_stack+0x48/0x194 (unreliable)
[def3ddc0] [c0014160] __might_sleep+0xd0/0xdc
[def3dde0] [c0063e60] kmem_cache_zalloc+0xdc/0x12c
[def3de00] [c01975c0] heartbeat_trig_activate+0x24/0x80
[def3de20] [c0196844] led_trigger_set+0x128/0x160
[def3de40] [c0196988] led_trigger_store+0x10c/0x1a8
[def3deb0] [c0162f40] class_device_attr_store+0x44/0x5c
[def3dec0] [c00ae614] sysfs_write_file+0x114/0x1dc
[def3def0] [c0068ea4] vfs_write+0x9c/0x110
[def3df10] [c0068ff4] sys_write+0x4c/0x90
[def3df40] [c000fc00] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xfe83818
    LR =3D 0xfe35448

Kernel 2.6.22-4, powerpc, targeting an MPC 8347.  I don't think this
issue is PowerPC specific but I was hoping other embedded people might
have experience with the LED class driver.

Thank you,
	Michael

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

* Re: LED heartbeat trigger - in_atomic() while allocs
  2007-11-26 20:07 LED heartbeat trigger - in_atomic() while allocs Benedict, Michael
@ 2007-11-26 20:36 ` Nathan Lynch
  2007-11-27  1:02   ` Benedict, Michael
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Lynch @ 2007-11-26 20:36 UTC (permalink / raw)
  To: Benedict, Michael; +Cc: linuxppc-embedded

Benedict, Michael wrote:
> I was playing around with the LED heartbeat trigger and it caught the
> BUG() code when trying to activate.  Does anyone know why this call
> stack would be in_atomic()?  Or any ideas for a patch that would allow
> the heartbeat trigger to allocate when it is not in atomic context?
> 
> BUG: sleeping function called from invalid context at mm/slab.c:3024
> in_atomic():1, irqs_disabled():0
> Call Trace:
> [def3dd90] [c0008e60] show_stack+0x48/0x194 (unreliable)
> [def3ddc0] [c0014160] __might_sleep+0xd0/0xdc
> [def3dde0] [c0063e60] kmem_cache_zalloc+0xdc/0x12c
> [def3de00] [c01975c0] heartbeat_trig_activate+0x24/0x80
> [def3de20] [c0196844] led_trigger_set+0x128/0x160
> [def3de40] [c0196988] led_trigger_store+0x10c/0x1a8
> [def3deb0] [c0162f40] class_device_attr_store+0x44/0x5c
> [def3dec0] [c00ae614] sysfs_write_file+0x114/0x1dc
> [def3def0] [c0068ea4] vfs_write+0x9c/0x110
> [def3df10] [c0068ff4] sys_write+0x4c/0x90
> [def3df40] [c000fc00] ret_from_syscall+0x0/0x38
> --- Exception: c01 at 0xfe83818
>     LR = 0xfe35448
> 
> Kernel 2.6.22-4, powerpc, targeting an MPC 8347.

>From a brief glance at the code, looks like led_trigger_store is
holding a rwlock while calling led_trigger_set.

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

* RE: LED heartbeat trigger - in_atomic() while allocs
  2007-11-26 20:36 ` Nathan Lynch
@ 2007-11-27  1:02   ` Benedict, Michael
  0 siblings, 0 replies; 3+ messages in thread
From: Benedict, Michael @ 2007-11-27  1:02 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: linuxppc-embedded

Thanks, yeah I see that now.  I just changed the alloc to be GPF_ATOMIC
for now, but I don't really know how this was intended to work.
	-Michael=20

> -----Original Message-----
> From:=20
> linuxppc-embedded-bounces+mbenedict=3Dtwacs.com@ozlabs.org=20
> [mailto:linuxppc-embedded-bounces+mbenedict=3Dtwacs.com@ozlabs.o
rg] On Behalf Of Nathan Lynch
> Sent: Monday, November 26, 2007 2:37 PM
> To: Benedict, Michael
> Cc: linuxppc-embedded@ozlabs.org
> Subject: Re: LED heartbeat trigger - in_atomic() while allocs
>=20
> Benedict, Michael wrote:
> > I was playing around with the LED heartbeat trigger and it=20
> caught the
> > BUG() code when trying to activate.  Does anyone know why this call
> > stack would be in_atomic()?  Or any ideas for a patch that=20
> would allow
> > the heartbeat trigger to allocate when it is not in atomic context?
> >=20
> > BUG: sleeping function called from invalid context at mm/slab.c:3024
> > in_atomic():1, irqs_disabled():0
> > Call Trace:
> > [def3dd90] [c0008e60] show_stack+0x48/0x194 (unreliable)
> > [def3ddc0] [c0014160] __might_sleep+0xd0/0xdc
> > [def3dde0] [c0063e60] kmem_cache_zalloc+0xdc/0x12c
> > [def3de00] [c01975c0] heartbeat_trig_activate+0x24/0x80
> > [def3de20] [c0196844] led_trigger_set+0x128/0x160
> > [def3de40] [c0196988] led_trigger_store+0x10c/0x1a8
> > [def3deb0] [c0162f40] class_device_attr_store+0x44/0x5c
> > [def3dec0] [c00ae614] sysfs_write_file+0x114/0x1dc
> > [def3def0] [c0068ea4] vfs_write+0x9c/0x110
> > [def3df10] [c0068ff4] sys_write+0x4c/0x90
> > [def3df40] [c000fc00] ret_from_syscall+0x0/0x38
> > --- Exception: c01 at 0xfe83818
> >     LR =3D 0xfe35448
> >=20
> > Kernel 2.6.22-4, powerpc, targeting an MPC 8347.
>=20
> From a brief glance at the code, looks like led_trigger_store is
> holding a rwlock while calling led_trigger_set.
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>=20
>=20

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

end of thread, other threads:[~2007-11-27  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-26 20:07 LED heartbeat trigger - in_atomic() while allocs Benedict, Michael
2007-11-26 20:36 ` Nathan Lynch
2007-11-27  1:02   ` Benedict, Michael

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).