RevolutionPi / piControl

Kernel module for data exchange with RevPi I/O-Modules and Gateways
81 stars 24 forks source link

piControl: increase priority of io-thread #90

Closed linosanfilippo-kunbus closed 1 year ago

linosanfilippo-kunbus commented 1 year ago

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.

l1k commented 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. :(

l1k commented 1 year ago

Could you s/quick/quickly/ in that code comment as requested please? (If only to assuage my grammar OCD... ;) )