From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Jacob Keller <jacob.e.keller@intel.com>,
Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Cc: Siddaraju DH <siddaraju.dh@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH net-next 14/15] ice: make Tx and Rx vernier offset calibration independent
Date: Thu, 3 Nov 2022 13:45:06 -0700 [thread overview]
Message-ID: <adc1c428-0b70-eb89-b6f9-d5db987f6ba0@intel.com> (raw)
In-Reply-To: <20221101225240.421525-15-jacob.e.keller@intel.com>
On 11/1/2022 3:52 PM, Jacob Keller wrote:
<snip>
> @@ -1809,6 +1836,9 @@ static int ice_phy_cfg_tx_offset_e822(struct ice_hw *hw, u8 port)
> if (err)
> return err;
>
> + dev_info(ice_hw_to_dev(hw),
> + "Port=%d Tx vernier offset calibration complete\n", port);
nit: This can be one line
> +
> return 0;
> }
>
> @@ -2011,6 +2041,11 @@ ice_calc_fixed_rx_offset_e822(struct ice_hw *hw, enum ice_ptp_link_spd link_spd)
> * measurements taken in hardware with some data about known fixed delay as
> * well as adjusting for multi-lane alignment delay.
> *
> + * This function will not return successfully until the Rx offset calculations
> + * have been completed, which requires waiting until at least one packet has
> + * been received by the device. It is safe to call this function periodically
> + * until calibration succeeds, as it will only program the offset once.
> + *
> * This function must be called only after the offset registers are valid,
> * i.e. after the Vernier calibration wait has passed, to ensure that the PHY
> * has measured the offset.
> @@ -2019,13 +2054,38 @@ ice_calc_fixed_rx_offset_e822(struct ice_hw *hw, enum ice_ptp_link_spd link_spd)
> * latency values, we use measurements in 1/100th of a nanosecond, and divide
> * the TUs per second up front. This avoids overflow while allowing
> * calculation of the adjustment using integer arithmetic.
> + *
> + * Returns zero on success, -EBUSY if the hardware vernier offset
> + * calibration has not completed, or another error code on failure.
> */
> -static int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)
> +int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)
> {
> enum ice_ptp_link_spd link_spd;
> enum ice_ptp_fec_mode fec_mode;
> u64 total_offset, pmd, val;
> int err;
> + u32 reg;
> +
> + /* Nothing to do if we've already programmed the offset */
> + err = ice_read_phy_reg_e822(hw, port, P_REG_RX_OR, ®);
> + if (err) {
> + ice_debug(hw, ICE_DBG_PTP, "Failed to read RX_OR for port %u, err %d\n",
> + port, err);
> + return err;
> + }
> +
> + if (reg)
> + return 0;
> +
> + err = ice_read_phy_reg_e822(hw, port, P_REG_RX_OV_STATUS, ®);
> + if (err) {
> + ice_debug(hw, ICE_DBG_PTP, "Failed to read RX_OV_STATUS for port %u, err %d\n",
> + port, err);
> + return err;
> + }
> +
> + if (!(reg & P_REG_RX_OV_STATUS_OV_M))
> + return -EBUSY;
>
> err = ice_phy_get_speed_and_fec_e822(hw, port, &link_spd, &fec_mode);
> if (err)
> @@ -2086,6 +2146,9 @@ static int ice_phy_cfg_rx_offset_e822(struct ice_hw *hw, u8 port)
> if (err)
> return err;
>
> + dev_info(ice_hw_to_dev(hw),
> + "Port=%d Rx vernier offset calibration complete\n", port);
This one too.
> +
> return 0;
> }
>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2022-11-03 20:45 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 22:52 [Intel-wired-lan] [PATCH net-next 00/15] ice: improve Tx timestamp corner cases Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 01/15] ice: Use more generic names for ice_ptp_tx fields Jacob Keller
2022-11-03 20:44 ` Tony Nguyen
2022-11-03 20:50 ` Temerkhanov, Sergey
2022-11-03 20:54 ` Jacob Keller
2022-11-03 20:53 ` Jacob Keller
2022-11-17 10:40 ` G, GurucharanX
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 02/15] ice: Remove the E822 vernier "bypass" logic Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 03/15] ice: Reset TS memory for all quads Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 04/15] ice: fix misuse of "link err" with "link status" Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 05/15] ice: always call ice_ptp_link_change and make it void Jacob Keller
2022-11-02 0:01 ` Ertman, David M
2022-11-03 20:44 ` Tony Nguyen
2022-11-03 20:48 ` Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 06/15] ice: handle discarding old Tx requests in ice_ptp_tx_tstamp Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 07/15] ice: check Tx timestamp memory register for ready timestamps Jacob Keller
2022-11-03 19:23 ` Jacob Keller
2022-11-03 20:44 ` Tony Nguyen
2022-11-03 20:52 ` Jacob Keller
2022-11-03 20:45 ` Stillwell Jr, Paul M
2022-11-03 20:52 ` Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 08/15] ice: protect init and calibrating fields with spinlock Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 09/15] ice: return true if Tx tracker is uninitialized Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 10/15] ice: disable Tx timestamps while link is down Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 11/15] ice: cleanup allocations in ice_ptp_alloc_tx_tracker Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 12/15] ice: handle flushing stale Tx timestamps in ice_ptp_tx_tstamp Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 13/15] ice: only check set bits in ice_ptp_flush_tx_tracker Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 14/15] ice: make Tx and Rx vernier offset calibration independent Jacob Keller
2022-11-03 20:45 ` Tony Nguyen [this message]
2022-11-03 20:52 ` Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 15/15] ice: reschedule ice_ptp_wait_for_offset_valid during reset 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=adc1c428-0b70-eb89-b6f9-d5db987f6ba0@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=siddaraju.dh@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