Closed thebel1 closed 3 years ago
The cause is the DMA buffer being allocated above 2GB:
2020-09-01T14:15:35.920Z cpu0:67976)thpimon: rpiq_mboxSend:147: writing mboxOut 0xe651228 to DMA buffer 0x430076601220 (MA 0xe651220) on channel 8
(gdb) p/d 0xe651220 > (1<<31)
$3 = 1
Never mind, I just re-used the same allocation 353 times and the VC still stopped sending a response. Might be a firmware bug.
Issue was caused by build-up of mailbox buffers and a CPU caching issue. Fixed in this commit:
https://github.com/thebel1/thpimon/commit/a8a44e9c2841ea3e105dcb2a93c93bfe5998dccc
Evidence:
Ran the pimon_util.py script 20k times:
i=0; while :; do echo "[${i}]"; /scratch/downloads/pyUtil/pimon_util.py; i=$((${i} + 1)); done | tee /tmp/test.txt
Results:
cat /tmp/test.txt | awk -e 'BEGIN{ errcount=0; totalcount=0; } /timed out/{ errcount += 1; } /\[[0-9]+\]/{ totalcount += 1; } END{ print "err:\t"
, errcount; print "total:\t", totalcount; print "ratio:\t", (errcount/totalcount); }'
err: 66
total: 20015
ratio: 0.00329753
Failure rate of 0.3%. If this becomes a problem, the retry count can be increased further.
24hrs testing and no issues - great work!
This only recovers after a reboot.
Log: