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