Closed linosanfilippo-kunbus closed 1 year ago
Thanks for bottoming out on this, good catch. Turns out the priority was sufficiently high until 0ae981ad6 reduced it 5 years ago. :(
Could you s/quick/quickly/ in that code comment as requested please? (If only to assuage my grammar OCD... ;) )
During the piBridge communication lots of messages are logged in the kernel log that indicate UART data reception errors like parity, frame and (occassionally) overflow errors.
As it turned out increasing the realtime priority of the thread that handles the piBridge communication to 54 (which is the same as the SPI thread priority) fixes these issues.
Before this change an error rate (ratio of total errors to received bytes) of 0,000812359 (i.e. 0,081%) could be observerd during a 45 minute test. After this change the error rate is decreased to 0 (i.e. no errors at all). This rate is even below the error rate that is observed with the 4.19 Revpi kernel (0,0000262%)
NOTE: The reason for this effect is still not completely clear, presumably the UART has to switch as quickly as possible from transmitting to receiving data.