On Thu, Aug 08, 2002 at 05:16:52PM +0900, ?????? wrote: > I am trying to use tasklet_schedule() function. > CODE 1 works OK. > but calling tasklet_schedule() via some_bad_function() - like CODE 2 > - results in a system hang with [error messages]. > > Can anyone tell me why? > Please help. > Thanks. > > code 1> > > void my_tasklet_func(unsigned long data) > { > printk("tasklet working...\n"); > } > > static int __init init_module_() > { > DECLARE_TASKLET(my_tasklet, my_tasklet_func, 0); > tasklet_schedule(&my_tasklet); > } > > code 2> > > void some_bad_function() { > DECLARE_TASKLET(my_tasklet, my_tasklet_func, 0); > tasklet_schedule(&my_tasklet); > } > > static int __init init_module_() > { > some_bad_function(); > } > > [error messages] First, you should run the trace you got through ksymoops. It will assign function names to the addresses, so what happened can be seen in the source. Second, the tasklet_struct structure is not copied in tasklet_schedule. So it must still exist when the tasklet runs. Thus it can't be an automatic variable (which is bug in both pieces of code). > Unhandled kernel unaligned access in unaligned.c:emulate_load_store_insn, > line 3 > 72: > $0 : 00000000 30008401 00000000 00000008 > $4 : ffffffea 80315598 811170c0 8111aac0 > $8 : 00000008 0000000f 00000000 c000008c > $12: c00002a4 c0000060 00000005 c0000060 > $16: ffffffea 802e6080 00000007 8031559c > $20: 80315590 00000000 00000000 00000000 > $24: 00000000 2aba4820 > $28: 83b40000 83b41ee8 10001db0 80120b38 > epc : 80120c94 > Status: 30008403 > Cause : 00800010 > Process insmod (pid: 46, stackpage=83b40000) > Stack: 00000000 00000000 00000000 00000000 00000001 802e60d8 80120b38 > 0080000c > 10009408 10007e40 100098a0 00000000 10009408 10007e40 100098a0 > 00000000 > 00000310 8010da3c 100198d0 00000fff 10017f10 00000000 100087a0 > 00000000 > 00000000 fefefeff 00000000 ffffffff 10001db0 100098a0 00000000 > 00000000 > 00000000 10009798 2ac44e74 00000045 00000008 2ac44e7c 00000005 > c0000060 > 10009408 ... > Call Trace: [<80120b38>] [<8010da3c>] [<c0000060>] > Code: 00408821 02002021 8c820008 <1440000c> 8e100000 c0820004 2401fffe > 0041 > 1024 e0820004 ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz> -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/