From: Jakub Kicinski <kuba@kernel.org>
To: Tianfei Zhang <tianfei.zhang@intel.com>
Cc: richardcochran@gmail.com, netdev@vger.kernel.org,
linux-fpga@vger.kernel.org, ilpo.jarvinen@linux.intel.com,
andriy.shevchenko@linux.intel.com, vinicius.gomes@intel.com,
pierre-louis.bossart@linux.intel.com, marpagan@redhat.com,
russell.h.weight@intel.com, matthew.gerlach@linux.intel.com,
nico@fluxnic.net,
Raghavendra Khadatare <raghavendrax.anand.khadatare@intel.com>
Subject: Re: [PATCH v2] ptp: add ToD device driver for Intel FPGA cards
Date: Wed, 22 Mar 2023 20:33:20 -0700 [thread overview]
Message-ID: <20230322203320.798a1f77@kernel.org> (raw)
In-Reply-To: <20230322143547.233250-1-tianfei.zhang@intel.com>
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.
prev parent reply other threads:[~2023-03-23 3:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 14:35 [PATCH v2] ptp: add ToD device driver for Intel FPGA cards Tianfei Zhang
2023-03-22 14:48 ` Andy Shevchenko
2023-03-22 14:59 ` Zhang, Tianfei
2023-03-22 15:03 ` Andy Shevchenko
2023-03-22 15:36 ` Zhang, Tianfei
2023-03-22 15:07 ` Ilpo Järvinen
2023-03-22 15:17 ` Zhang, Tianfei
2023-03-23 3:33 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230322203320.798a1f77@kernel.org \
--to=kuba@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=marpagan@redhat.com \
--cc=matthew.gerlach@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=nico@fluxnic.net \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=raghavendrax.anand.khadatare@intel.com \
--cc=richardcochran@gmail.com \
--cc=russell.h.weight@intel.com \
--cc=tianfei.zhang@intel.com \
--cc=vinicius.gomes@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).