EmbLogic's Blog

sytem crashes while implementing compleion

hi,
i am trying o implement completion. i have to simple applications one for read and other for write.
my code is as follows
struct sculldev{
………..
………..
struct completiom my_completion;
…….
…………
};

scullread(……..)
{declare vriables……struct sculldev *lsculldev;
wait_for_completion(lsculldev->my_completion);
………….
}
scull_write(………..)
{
declare vriables……struct sculldev *lsculldev;
……………………………………..
…………code……………………
…………code…………………..
complete(&lsculldev->my_completion);
return 0;
}
HOWEVER WHEN I RUN THE APPLICATION THE SYSTEM CRASHES.
the messages in var/log/messages is
BUG: sleeping function called from invalid context at arch/x86/mm fault.c
in_atomic(): 0, irqs_disabled:1, pid 2207

i would appreciate if any one could help

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>