do_div soft lock up for ppc architectures. Assembly code
It seems that the function do_div () locks up for IBM ppc architecture. The function do_div is implemented in assembly (file div64.S for IBM ppc architectures). When I use the generic implementation (C implementation), the lock up is gone. I still need the do_div for high performance since I am doing a proprietary video over ip application.
Try the numbers "55834565048000000" for dividend and "4294967079" for divisor in order to reproduce the lock up (it takes one second for the CPU to carry out the operation).
I have checked in other forums and a soft lock up was reported for the generic C implementation but no changes has been done in the assembly implementation.
This function is called in a kernel timer thread so it can not be swapped or preempted.
The code to reproduce the issue will be:
long long unsigned divid;
unsigned int divisor;
divid = 55834565048000000ULL;
divisor = 4294967079U;
printk(KERN_WARNING "Start 2nd division divid=%llX divisor=0x%x\n", divid, divisor);
do_div (divid, divisor);
printk(KERN_WARNING "End division result=0x%llX\n", divid);
Besides, the result wich is stored in the "divid" variable is incorrect.
Has anybody seen this issue, Can somebody check the assembly implementation (arch/powerpc/lib/div64.S) and try to analyze what is wrong with it
I will appreciate any help...