RE: LED heartbeat trigger - in_atomic() while allocs

2007-11-26 Thread Benedict, Michael
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 

> -Original Message-
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
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
> 
> 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.
> ___
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


Re: LED heartbeat trigger - in_atomic() while allocs

2007-11-26 Thread Nathan Lynch
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.
___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded


LED heartbeat trigger - in_atomic() while allocs

2007-11-26 Thread Benedict, Michael
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.  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

___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded