Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Keller, Jacob E <jacob.e.keller@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [net-next v3 10/13] ice: implement basic E822 PTP support
Date: Mon, 23 Aug 2021 23:43:39 +0000	[thread overview]
Message-ID: <14819520-4ecf-85da-915d-2f384e275fe9@intel.com> (raw)
In-Reply-To: <20210707234108.4071506-11-jacob.e.keller@intel.com>

On 7/7/2021 4:41 PM, Keller, Jacob E wrote:
> Implement support for the basic operations needed to enable the PTP
> hardware clock on E822 devices.
> 
> This includes implementations for the various PHY access functions, as
> well as the ability to start and stop the PHY timers. This is different
> from the E810 device because the configuration depends on link speed, so
> we cannot just start the PHYs immediately. We must wait until the link
> is up to get proper values for the speed based initialization.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---

This patch has a bug, unfortunately....

>  
> +/**
> + * ice_ptp_init_tx_e822 - Initialize tracking for Tx timestamps
> + * @pf: Board private structure
> + * @tx: the Tx tracking structure to initialize
> + * @port: the port this structure tracks
> + *
> + * Initialize the Tx timestamp tracker for this port. For generic MAC devices,
> + * the timestamp block is shared for all ports in the same quad. To avoid
> + * ports using the same timestamp index, logically break the block of
> + * registers into chunks based on the port number.
> + */
> +static int
> +ice_ptp_init_tx_e822(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port)
> +{
> +	tx->quad = port % ICE_PORTS_PER_QUAD;

This quad calculation is wrong, it should be:

  tx->quad = port / ICE_PORTS_PER_QUAD;

This causes the incorrect quad number to be used for all ports except
for port 0. Because of this, Tx timestamps only work on port 0.

Can we fix this and have a v4? If not, a fix commit will be required.

Thanks,
Jake

> +	tx->quad_offset = tx->quad * INDEX_PER_PORT;
> +	tx->len = INDEX_PER_PORT;
> +
> +	return ice_ptp_alloc_tx_tracker(tx);
> +}
> +

  reply	other threads:[~2021-08-23 23:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 23:40 [Intel-wired-lan] [net-next v3 00/13] implement support for PTP on E822 hardware Jacob Keller
2021-07-07 23:40 ` [Intel-wired-lan] [net-next v3 01/13] ice: fix Tx queue iteration for Tx timestamp enablement Jacob Keller
2021-07-07 23:40 ` [Intel-wired-lan] [net-next v3 02/13] ice: remove dead code for allocating pin_config Jacob Keller
2021-07-07 23:40 ` [Intel-wired-lan] [net-next v3 03/13] ice: add lock around Tx timestamp tracker flush Jacob Keller
2021-07-07 23:40 ` [Intel-wired-lan] [net-next v3 04/13] ice: restart periodic outputs around time changes Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 05/13] ice: introduce ice_base_incval function Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 06/13] ice: PTP: move setting of tstamp_config Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 07/13] ice: use 'int err' instead of 'int status' Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 08/13] ice: introduce ice_ptp_init_phc function Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 09/13] ice: convert clk_freq capability into time_ref Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 10/13] ice: implement basic E822 PTP support Jacob Keller
2021-08-23 23:43   ` Keller, Jacob E [this message]
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 11/13] ice: ensure the hardware Clock Generation Unit is configured Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 12/13] ice: exit bypass mode once hardware finishes timestamp calibration Jacob Keller
2021-07-07 23:41 ` [Intel-wired-lan] [net-next v3 13/13] ice: support crosstimestamping on E822 devices if supported Jacob Keller

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=14819520-4ecf-85da-915d-2f384e275fe9@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /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