openpilot
openpilot copied to clipboard
comma 3X: switch to kernel driver for low level SPI comms
trafficstars
The comma 3X talks to its internal panda over SPI using the spidev driver. We want to move the low-level SPI transactions into the kernel for better performance and efficiency.
I already started this a while ago at panda/drivers/spi/.
Minimum requirements for this bounty:
- Switch to the kernel driver for the panda Python library (
panda/python/) - Make it interrupt driven (no busy waiting!)
- Good auto loading + updating the driver
- Better throughput than the existing panda SPI stack
- for bonus points, you can patch the kernel to fix the SPI overhead. apparently tracking the "SPI stats" has a ton of overhead in our kernel version, and this was fixed in newer kernels.
- Performance needs to be good enough to support https://github.com/commaai/openpilot/pull/34711
- since the easiest way to validate may end up being to finish that move, there's an extra $250 on this bounty ($1k total) for finishing that up and merging it together
We'll be switching pandad in openpilot to Python soon, so no need to implement this for the C++ panda library (just the one in panda/python/).