The issue might be related to by PCI bus, but it is difficult to say without deeper analyzing of the whole source code including OS. I may recommend to put more prints in FreeBSD and your code, and following them to see if you getting the same flow on both systems. Hopefully, you will see some differences in the logic.
On the other hand, can you check if using the latest firmware helps?