Re: [PATCH net 8/9] bnxt_en: Move bnxt_ptp_init() to bnxt_open()
From: Richard Cochran <richardcochran@gmail.com>
Date: 2021-07-19 17:22:35
From: Richard Cochran <richardcochran@gmail.com>
Date: 2021-07-19 17:22:35
On Mon, Jul 19, 2021 at 12:43:23PM +0200, Jakub Kicinski wrote:
On Sun, 18 Jul 2021 15:36:32 -0400, Michael Chan wrote:quoted
The device needs to be in ifup state for PTP to function, so move bnxt_ptp_init() to bnxt_open(). This means that the PHC will be registered during bnxt_open().I think it's an anti-pattern to have the clock registered only when the device is up. Right, Richard?
Yes, indeed.
IIRC Intel parts did it in the past because they had the clock hooked up to the MAC/PHY so the clock was not actually ticking. But seems like a wrong trade off to unreg PTP for SW convenience. Or maybe I'm biased against the live FW reset :) Let's see if Richard agrees.
Totally agree! Ideally the PHC appears as soon as the driver instantiates for a HW device. Telling time from the clock is independent from the network interface being up or down. Some drivers are lazy and fail to decouple these two orthogonal issues. In some (all?) cases, there is no HW limitation involved, just sloppy driver work. Thanks, Richard