Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@kernel.org, andrew+netdev@lunn.ch,
	netdev@vger.kernel.org, maciej.machnikowski@intel.com,
	jacob.e.keller@intel.com, przemyslaw.korba@intel.com,
	grzegorz.nitka@intel.com, sergey.temerkhanov@intel.com,
	arkadiusz.kubalewski@intel.com, poros@redhat.com,
	richardcochran@gmail.com, horms@kernel.org,
	pmenzel@molgen.mpg.de, aleksandr.loktionov@intel.com,
	alexander.nowlin@intel.com
Subject: Re: [PATCH net v2 09/15] ice: E825: clear PHY_REG_TX_MEMORY_STATUS prior to soft reset
Date: Mon, 12 Oct 2026 23:15:27 +0000	[thread overview]
Message-ID: <179184692717.434549.6585696302155195497@kernel.org> (raw)
In-Reply-To: <20261008215614.1987250-10-anthony.l.nguyen@intel.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The kernel-doc for ice_clear_ptp_tstamp_eth56g() in
  drivers/net/ethernet/intel/ice/ice_ptp_hw.c no longer matches the code.
- [Low] The new kernel-doc for ice_ptp_phy_soft_reset_eth56g()
  (ice_ptp_hw.c:2301-2305) says 'The PHY_REG_TX_MEMORY_STATUS reads…

--

ice: E825: clear PHY_REG_TX_MEMORY_STATUS prior to soft reset

This commit removes ice_ptp_reset_ts_memory_eth56g(), which wrote zeros to
PHY_REG_TX_MEMORY_STATUS. It also drops the write from
ice_clear_ptp_tstamp_eth56g(). In its place, every timestamp index of a port
is now read just before the PHY soft reset in
ice_ptp_phy_soft_reset_eth56g().

> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> index 07b55fbb88dde..e83ad2bb8d420 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c

[ ... ]

> @@ -1134,16 +1116,12 @@ static int ice_read_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx,
>   * @port: the quad to read from
>   * @idx: the timestamp index to reset
>   *
> - * Read and then forcibly clear the timestamp index to ensure the valid bit is
> - * cleared and the timestamp status bit is reset in the PHY port memory of
> - * internal PHYs of the 56G devices.
> - *
> - * To directly clear the contents of the timestamp block entirely, discarding
> - * all timestamp data at once, software should instead use
> - * ice_ptp_reset_ts_memory_quad_eth56g().
> + * Read the timestamp index to ensure that the valid bit is cleared and the
> + * timestamp status bit is reset in the PHY port memory.
>   *
> - * This function should only be called on an idx whose bit is set according to
> - * ice_get_phy_tx_tstamp_ready().
> + * This function should only be called on an index whose bit is set according
> + * to ice_get_phy_tx_tstamp_ready(), or as part of a full sweep when paired
> + * with a PHY soft reset via ice_ptp_phy_soft_reset_eth56g().
>   *
>   * Return:
>   * * %0     - success

[Severity: Low]
This isn't a bug, but the kernel-doc for ice_clear_ptp_tstamp_eth56g()
now looks a bit out of date. The Return section just below this hunk still
says:

 * * %other - failed to write to PHY

After this patch the function does not write anything. The only error it
returns comes from ice_read_ptp_tstamp_eth56g(). That is either a sideband
read failure or -EINVAL from the port range check in
ice_read_port_eth56g().

Since this block is being rewritten anyway, could the summary line and the
@port line be updated too? They still read:

 * ice_clear_ptp_tstamp_eth56g - Clear a timestamp from the quad block
 * @port: the quad to read from

On ETH56G the timestamp memory is per port. The new sibling helper uses
"Reset one port's Tx timestamp memory" and "@port: port number to clear".

> @@ -1152,24 +1130,16 @@ static int ice_read_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx,
>  static int ice_clear_ptp_tstamp_eth56g(struct ice_hw *hw, u8 port, u8 idx)
>  {
>  	u64 unused_tstamp;
> -	u16 lo_addr;
>  	int err;
>  
> -	/* Read the timestamp register to ensure the timestamp status bit is
> -	 * cleared.
> +	/* Per the PHY spec, reading the timestamp memory location is what
> +	 * clears the entry's valid bit and its corresponding (read-only)
> +	 * ts_memory_status bit.
>  	 */
>  	err = ice_read_ptp_tstamp_eth56g(hw, port, idx, &unused_tstamp);

[ ... ]

> @@ -2303,6 +2298,12 @@ int ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)
>   * to settle. This provides a controlled way to reinitialize the PHY
>   * without requiring a full device reset.
>   *
> + * To ensure that the internal counter matches the contents of the
> + * PHY_REG_TX_MEMORY_STATUS, read every timestamp index prior to performing
> + * the soft reset. The PHY_REG_TX_MEMORY_STATUS reads ensure that the region
> + * is cleared, while the soft reset procedure ensures that the timestamp
> + * counter is reset to zero.

[Severity: Low]
Does this comment name the wrong register? The sweep never reads
PHY_REG_TX_MEMORY_STATUS. The reads go through this path:

ice_ptp_clear_tx_memory_status_eth56g()
  ice_clear_ptp_tstamp_eth56g()
    ice_read_ptp_tstamp_eth56g()

ice_read_ptp_tstamp_eth56g() reads the per-index timestamp memory words via
the ETH56G_PHY_MEM_PTP resource:

	lo_addr = (u16)PHY_TSTAMP_L(idx);
	hi_addr = (u16)PHY_TSTAMP_U(idx);

	err = ice_read_port_mem_eth56g(hw, port, lo_addr, &lo);

PHY_REG_TX_MEMORY_STATUS_L/U is the ready bitmap in ETH56G_PHY_REG_PTP. It
is only read by ice_get_phy_tx_tstamp_ready_eth56g(), and reading it does
not clear anything.

The commit message has the same wording:

    We must read the PHY_REG_TX_MEMORY_STATUS in order to clear stale
    timestamps.

and:

    The reads to PHY_REG_TX_MEMORY_STATUS will reset the region valid
    bits ensuring that no stale data is left behind.

Could the comment and commit message say the timestamp memory entries
(PHY_TSTAMP_L/U) are being read? Otherwise a later change might "fix" the
sweep by reading the status bitmap, which would not clear any entries.

> + *
>   * Return: 0 on success, or a negative error code on failure when
>   *         reading or writing the PHY register.
>   */

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261008215614.1987250-1-anthony.l.nguyen%40intel.com

  reply	other threads:[~2026-10-12 23:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 21:55 [PATCH net v2 00/15][pull request] ice: E82x: timestamp processing logic fixes Tony Nguyen
2026-10-08 21:55 ` [PATCH net v2 01/15] ice: fix removal of PTP timestamp tracker during reset Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:55 ` [PATCH net v2 02/15] ice: use reference counting and SRCU for PTP port access Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 03/15] ice: fix PHY port restart serialization Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 04/15] ice: set in_use only after preparing Tx timestamp index Tony Nguyen
2026-10-08 21:56 ` [PATCH net v2 05/15] ice: call PTP link change only from link events Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 06/15] ice: E822: keep Tx timestamps disabled during offset calibration Tony Nguyen
2026-10-08 21:56 ` [PATCH net v2 07/15] ice: E822: cancel offset verification work during reset preparation Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 08/15] ice: E825: stop clearing PHY_REG_TX_OFFSET_READY Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 09/15] ice: E825: clear PHY_REG_TX_MEMORY_STATUS prior to soft reset Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko [this message]
2026-10-08 21:56 ` [PATCH net v2 10/15] ice: E825: perform a soft reset when starting the PHY timer Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 11/15] ice: wait for in-flight Tx timestamps before flushing the tracker Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 12/15] ice: keep Tx timestamp slots tracked until completion or timeout Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 13/15] ice: skip reading Tx ready bitmap on ports with no timestamps Tony Nguyen
2026-10-08 21:56 ` [PATCH net v2 14/15] ice: don't clear in_use until HW clears ready bitmap Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 15/15] ice: Recalibrate PHY after settime64 on E825-C Tony Nguyen
2026-10-12 23:15   ` netdev-bot+sashiko

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=179184692717.434549.6585696302155195497@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=alexander.nowlin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=grzegorz.nitka@intel.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=maciej.machnikowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=poros@redhat.com \
    --cc=przemyslaw.korba@intel.com \
    --cc=richardcochran@gmail.com \
    --cc=sergey.temerkhanov@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