[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230322203320.798a1f77@kernel.org>
Date: Wed, 22 Mar 2023 20:33:20 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tianfei Zhang <tianfei.zhang@...el.com>
Cc: richardcochran@...il.com, netdev@...r.kernel.org,
linux-fpga@...r.kernel.org, ilpo.jarvinen@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, vinicius.gomes@...el.com,
pierre-louis.bossart@...ux.intel.com, marpagan@...hat.com,
russell.h.weight@...el.com, matthew.gerlach@...ux.intel.com,
nico@...xnic.net,
Raghavendra Khadatare <raghavendrax.anand.khadatare@...el.com>
Subject: Re: [PATCH v2] ptp: add ToD device driver for Intel FPGA cards
On Wed, 22 Mar 2023 10:35:47 -0400 Tianfei Zhang wrote:
> + * A fine ToD HW clock offset adjustment. To perform the fine offset adjustment, the
> + * adjust_period and adjust_count argument are used to update the TOD_ADJUST_PERIOD
> + * and TOD_ADJUST_COUNT register for in hardware. The dt->tod_lock spinlock must be
> + * held when calling this function.
> + */
> +static int fine_adjust_tod_clock(struct dfl_tod *dt, u32 adjust_period,
> + u32 adjust_count)
> +{
> + void __iomem *base = dt->tod_ctrl;
> + u32 val;
> +
> + writel(adjust_period, base + TOD_ADJUST_PERIOD);
> + writel(adjust_count, base + TOD_ADJUST_COUNT);
> +
> + /* Wait for present offset adjustment update to complete */
> + return readl_poll_timeout_atomic(base + TOD_ADJUST_COUNT, val, !val, TOD_ADJUST_INTERVAL_US,
> + TOD_ADJUST_MAX_US);
> +}
> +
> +/*
> + * A coarse ToD HW clock offset adjustment.
> + * The coarse time adjustment performs by adding or subtracting the delta value
You should wrap the code at 80 characters in places
where it's easily done.
Powered by blists - more mailing lists