Re: [PATCH net-next v2 2/2] net: micrel: Schedule work to read seconds for lan8841

From: Richard Cochran
Date: Wed Jun 14 2023 - 00:50:12 EST


On Tue, Jun 13, 2023 at 11:45:26AM +0200, Horatiu Vultur wrote:
> @@ -3840,6 +3847,12 @@ static void lan8841_ptp_enable_processing(struct kszphy_ptp_priv *ptp_priv,
> LAN8841_PTP_INSERT_TS_32BIT,
> LAN8841_PTP_INSERT_TS_EN |
> LAN8841_PTP_INSERT_TS_32BIT);
> +
> + /* Schedule the work to read the seconds, which will be used in
> + * the received timestamp
> + */
> + schedule_delayed_work(&ptp_priv->seconds_work,
> + nsecs_to_jiffies(LAN8841_GET_SEC_LTC_DELAY));

Why not do this in the PTP kworker thread?

The thread's scheduling can be easily tuned with chrt to give it
appropriate priority, but work can't.

Also, If you have seconds thread, then you don't have to defer the
received frames.

Thanks,
Richard