Skip to content

Commit d130546

Browse files
committed
ice: fix PHY Clock Recovery availability check
JIRA: https://issues.redhat.com/browse/RHEL-29207 Upstream commit(s): commit 01fd68e Author: Arkadiusz Kubalewski <[email protected]> Date: Mon Sep 30 20:36:22 2024 +0200 ice: fix PHY Clock Recovery availability check To check if PHY Clock Recovery mechanic is available for a device, there is a need to verify if given PHY is available within the netlist, but the netlist node type used for the search is wrong, also the search context shall be specified. Modify the search function to allow specifying the context in the search. Use the PHY node type instead of CLOCK CONTROLLER type, also use proper search context which for PHY search is PORT, as defined in E810 Datasheet [1] ('3.3.8.2.4 Node Part Number and Node Options (0x0003)' and 'Table 3-105. Program Topology Device NVM Admin Command'). [1] https://cdrdv2.intel.com/v1/dl/getContent/613875?explicitVersion=true Fixes: 91e43ca ("ice: fix linking when CONFIG_PTP_1588_CLOCK=n") Reviewed-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Arkadiusz Kubalewski <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Petr Oros <[email protected]>
1 parent 26cfc69 commit d130546

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
578578
/**
579579
* ice_find_netlist_node
580580
* @hw: pointer to the hw struct
581-
* @node_type_ctx: type of netlist node to look for
581+
* @node_type: type of netlist node to look for
582+
* @ctx: context of the search
582583
* @node_part_number: node part number to look for
583584
* @node_handle: output parameter if node found - optional
584585
*
@@ -588,10 +589,12 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
588589
* valid if the function returns zero, and should be ignored on any non-zero
589590
* return value.
590591
*
591-
* Returns: 0 if the node is found, -ENOENT if no handle was found, and
592-
* a negative error code on failure to access the AQ.
592+
* Return:
593+
* * 0 if the node is found,
594+
* * -ENOENT if no handle was found,
595+
* * negative error code on failure to access the AQ.
593596
*/
594-
static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx,
597+
static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type, u8 ctx,
595598
u8 node_part_number, u16 *node_handle)
596599
{
597600
u8 idx;
@@ -602,8 +605,8 @@ static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx,
602605
int status;
603606

604607
cmd.addr.topo_params.node_type_ctx =
605-
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_TYPE_M,
606-
node_type_ctx);
608+
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_TYPE_M, node_type) |
609+
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_CTX_M, ctx);
607610
cmd.addr.topo_params.index = idx;
608611

609612
status = ice_aq_get_netlist_node(hw, &cmd,
@@ -2769,9 +2772,11 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p,
27692772
*/
27702773
bool ice_is_phy_rclk_in_netlist(struct ice_hw *hw)
27712774
{
2772-
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2775+
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_PHY,
2776+
ICE_AQC_LINK_TOPO_NODE_CTX_PORT,
27732777
ICE_AQC_GET_LINK_TOPO_NODE_NR_C827, NULL) &&
2774-
ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2778+
ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_PHY,
2779+
ICE_AQC_LINK_TOPO_NODE_CTX_PORT,
27752780
ICE_AQC_GET_LINK_TOPO_NODE_NR_E822_PHY, NULL))
27762781
return false;
27772782

@@ -2787,6 +2792,7 @@ bool ice_is_phy_rclk_in_netlist(struct ice_hw *hw)
27872792
bool ice_is_clock_mux_in_netlist(struct ice_hw *hw)
27882793
{
27892794
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX,
2795+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
27902796
ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX,
27912797
NULL))
27922798
return false;
@@ -2807,12 +2813,14 @@ bool ice_is_clock_mux_in_netlist(struct ice_hw *hw)
28072813
bool ice_is_cgu_in_netlist(struct ice_hw *hw)
28082814
{
28092815
if (!ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2816+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
28102817
ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032,
28112818
NULL)) {
28122819
hw->cgu_part_number = ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032;
28132820
return true;
28142821
} else if (!ice_find_netlist_node(hw,
28152822
ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2823+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
28162824
ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384,
28172825
NULL)) {
28182826
hw->cgu_part_number = ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384;
@@ -2831,6 +2839,7 @@ bool ice_is_cgu_in_netlist(struct ice_hw *hw)
28312839
bool ice_is_gps_in_netlist(struct ice_hw *hw)
28322840
{
28332841
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS,
2842+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
28342843
ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL))
28352844
return false;
28362845

0 commit comments

Comments
 (0)