Skip to content

Commit a51bcb7

Browse files
jacob-kellergregkh
authored andcommitted
ice: fix ice_ptp_read_tx_hwtstamp_status_eth56g
[ Upstream commit 1f75dbc ] The ice_ptp_read_tx_hwtstamp_status_eth56g function calls ice_read_phy_eth56g with a PHY index. However the function actually expects a port index. This causes the function to read the wrong PHY_PTP_INT_STATUS registers, and effectively makes the status wrong for the second set of ports from 4 to 7. The ice_read_phy_eth56g function uses the provided port index to determine which PHY device to read. We could refactor the entire chain to take a PHY index, but this would impact many code sites. Instead, multiply the PHY index by the number of ports, so that we read from the first port of each PHY. Fixes: 7cab44f ("ice: Introduce ETH56G PHY model for E825C products") Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Petr Oros <poros@redhat.com> Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260420-jk-iwl-net-2026-04-20-ptp-e825c-phy-interrupt-fixes-v1-4-bc2240f42251@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d2bebb8 commit a51bcb7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/net/ethernet/intel/ice/ice_ptp_hw.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,13 +2682,19 @@ int ice_ptp_read_tx_hwtstamp_status_eth56g(struct ice_hw *hw, u32 *ts_status)
26822682
*ts_status = 0;
26832683

26842684
for (phy = 0; phy < params->num_phys; phy++) {
2685+
u8 port;
26852686
int err;
26862687

2687-
err = ice_read_phy_eth56g(hw, phy, PHY_PTP_INT_STATUS, &status);
2688+
/* ice_read_phy_eth56g expects a port index, so use the first
2689+
* port of the PHY
2690+
*/
2691+
port = phy * hw->ptp.ports_per_phy;
2692+
2693+
err = ice_read_phy_eth56g(hw, port, PHY_PTP_INT_STATUS, &status);
26882694
if (err)
26892695
return err;
26902696

2691-
*ts_status |= (status & mask) << (phy * hw->ptp.ports_per_phy);
2697+
*ts_status |= (status & mask) << port;
26922698
}
26932699

26942700
ice_debug(hw, ICE_DBG_PTP, "PHY interrupt err: %x\n", *ts_status);

0 commit comments

Comments
 (0)