Skip to content

Commit 01fd68e

Browse files
kubalewskianguy11
authored andcommitted
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]>
1 parent af8edae commit 01fd68e

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
@@ -542,7 +542,8 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
542542
/**
543543
* ice_find_netlist_node
544544
* @hw: pointer to the hw struct
545-
* @node_type_ctx: type of netlist node to look for
545+
* @node_type: type of netlist node to look for
546+
* @ctx: context of the search
546547
* @node_part_number: node part number to look for
547548
* @node_handle: output parameter if node found - optional
548549
*
@@ -552,10 +553,12 @@ ice_aq_get_netlist_node(struct ice_hw *hw, struct ice_aqc_get_link_topo *cmd,
552553
* valid if the function returns zero, and should be ignored on any non-zero
553554
* return value.
554555
*
555-
* Returns: 0 if the node is found, -ENOENT if no handle was found, and
556-
* a negative error code on failure to access the AQ.
556+
* Return:
557+
* * 0 if the node is found,
558+
* * -ENOENT if no handle was found,
559+
* * negative error code on failure to access the AQ.
557560
*/
558-
static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx,
561+
static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type, u8 ctx,
559562
u8 node_part_number, u16 *node_handle)
560563
{
561564
u8 idx;
@@ -566,8 +569,8 @@ static int ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx,
566569
int status;
567570

568571
cmd.addr.topo_params.node_type_ctx =
569-
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_TYPE_M,
570-
node_type_ctx);
572+
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_TYPE_M, node_type) |
573+
FIELD_PREP(ICE_AQC_LINK_TOPO_NODE_CTX_M, ctx);
571574
cmd.addr.topo_params.index = idx;
572575

573576
status = ice_aq_get_netlist_node(hw, &cmd,
@@ -2747,9 +2750,11 @@ bool ice_is_pf_c827(struct ice_hw *hw)
27472750
*/
27482751
bool ice_is_phy_rclk_in_netlist(struct ice_hw *hw)
27492752
{
2750-
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2753+
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_PHY,
2754+
ICE_AQC_LINK_TOPO_NODE_CTX_PORT,
27512755
ICE_AQC_GET_LINK_TOPO_NODE_NR_C827, NULL) &&
2752-
ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2756+
ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_PHY,
2757+
ICE_AQC_LINK_TOPO_NODE_CTX_PORT,
27532758
ICE_AQC_GET_LINK_TOPO_NODE_NR_E822_PHY, NULL))
27542759
return false;
27552760

@@ -2765,6 +2770,7 @@ bool ice_is_phy_rclk_in_netlist(struct ice_hw *hw)
27652770
bool ice_is_clock_mux_in_netlist(struct ice_hw *hw)
27662771
{
27672772
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX,
2773+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
27682774
ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX,
27692775
NULL))
27702776
return false;
@@ -2785,12 +2791,14 @@ bool ice_is_clock_mux_in_netlist(struct ice_hw *hw)
27852791
bool ice_is_cgu_in_netlist(struct ice_hw *hw)
27862792
{
27872793
if (!ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2794+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
27882795
ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032,
27892796
NULL)) {
27902797
hw->cgu_part_number = ICE_AQC_GET_LINK_TOPO_NODE_NR_ZL30632_80032;
27912798
return true;
27922799
} else if (!ice_find_netlist_node(hw,
27932800
ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL,
2801+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
27942802
ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384,
27952803
NULL)) {
27962804
hw->cgu_part_number = ICE_AQC_GET_LINK_TOPO_NODE_NR_SI5383_5384;
@@ -2809,6 +2817,7 @@ bool ice_is_cgu_in_netlist(struct ice_hw *hw)
28092817
bool ice_is_gps_in_netlist(struct ice_hw *hw)
28102818
{
28112819
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS,
2820+
ICE_AQC_LINK_TOPO_NODE_CTX_GLOBAL,
28122821
ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL))
28132822
return false;
28142823

0 commit comments

Comments
 (0)