See the issue on Github for an answer: https://github.com/awesometic/realtek-r8125-dkms/issues/9
In short, the issue with compilation was that in the newest version of the driver (9.006.04) Realtek had removed the spinlock_t lock
member variable from struct rtl8125_private
, but not updated the PTP file accordingly. Hence, all the spin_lock_irqsave
and spin_lock_irqrestore
routines won't compile. There are two ways to fix this:
- Comment out all of the
spin_lock_irqsave
and spin_lock_irqrestore
routines in the PTP file, or
- Add back the
spinlock_t lock
member in the struct rtl8125_private
.
The latter is probably more safe since we don't know if the IRQs are vital for the function of the driver. That being said, I did try both solutions and both made the driver compile and report PTP HW capabilities, so I don't know which is best.
However, I still think the driver is quite buggy, as I still can't use HW timestamping is slave mode, and I have trouble getting reliable results. I often run into the problem that ptp4l
from linuxptp
times out trying to get a timestamp from the driver. I have two different computers with r8125
NICs, and it works sometimes on one computer and very seldomly on the other. I suspect the PTP function has not been well tested by Realtek, although this is just speculation on my part.