Skip to contentSkip to conversation

ice: refactor PTP feature flags

PATCH In review Jacob Keller 3 participants 12 messages Aug 17, 2023 – Aug 23, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover ice: refactor PTP feature flags

This series refactors and extends the feature flag detection for a couple of PTP feature flags. This includes ICE_F_GNSS and ICE_F_SMA_CTRL. Instead of blindly assuming the feature is enabled on all E810-T devices, check the netlist to confirm that the feature is supported on that device and platform.

For SMA control, this allows the driver to fallback to the fixed pin configuration that is supported by default E810 configurations when the SMA control is not accessible.

For GNSS, this ensures that we do not attempt to read the GNSS portion of the device if its not present, avoiding some unnecessary warning messages.

For ICE_F_SMA_CTRL this could be seen as a fix, but given the scope of the code I decided that its next material. I think of it more as extending the feature capability to support pins on more platforms.

Changes since v1:
* add a patch to fix E810-T pin counts when SMA is disabled
* use FIELD_PREP in ice_find_netlist_node
* reduce scope of variables in ice_find_netlist_node
* remove unnecessary local variable in ice_find_netlist_node
* rename "present" functions to use "in_netlist" terminology, and move them into ice_common.c
* call ice_is_gps_in_netlist_e810t() from ice_gnss_is_gps_present()

Jacob Keller (5):
ice: remove ICE_F_PTP_EXTTS feature flag
ice: fix pin assignment for E810-T without SMA control
ice: don't enable PTP related capabilities on non-owner PFs
ice: check the netlist before enabling ICE_F_SMA_CTRL
ice: check netlist before enabling ICE_F_GNSS

 drivers/net/ethernet/intel/ice/ice.h          |  1 -
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  8 +-
 drivers/net/ethernet/intel/ice/ice_common.c   | 77 +++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_common.h   |  2 +
 drivers/net/ethernet/intel/ice/ice_gnss.c     |  3 +
 drivers/net/ethernet/intel/ice/ice_lib.c      | 11 +--
 drivers/net/ethernet/intel/ice/ice_ptp.c      | 12 +--
 7 files changed, 101 insertions(+), 13 deletions(-)

base-commit: 361b86237e1afbf2c3be7cb604b6aac6f8b8c38c

Signature · 6 lines
2.41.0.1.g9857a21e0017.dirty

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
#1 lore raw

PATCH v2 1/5 ice: remove ICE_F_PTP_EXTTS feature flag

The ICE_F_PTP_EXTTS feature flag is ostensibly intended to support checking whether the device supports external timestamp pins. It is only checked in E810-specific code flows, and is enabled for all E810-based devices. E822 and E823 flows unconditionally enable external timestamp support.

This makes the feature flag meaningless, as it is always enabled. Just unconditionally enable support for external timestamp pins and remove this unnecessary flag.

---
No changes since v1.

 drivers/net/ethernet/intel/ice/ice.h     | 1 -
 drivers/net/ethernet/intel/ice/ice_lib.c | 1 -
 drivers/net/ethernet/intel/ice/ice_ptp.c | 4 +---
 3 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +0 -1
index 5d307bacf7c6..013ea8970fbc 100644
@@ -199,7 +199,6 @@
 
 enum ice_feature {
 	ICE_F_DSCP,
-	ICE_F_PTP_EXTTS,
 	ICE_F_SMA_CTRL,
 	ICE_F_GNSS,
 	ICE_F_ROCE_LAG,
drivers/net/ethernet/intel/ice/ice_lib.c +0 -1
index 201570cd2e0b..5dfcb824f817 100644
@@ -3986,7 +3986,6 @@ void ice_init_feature_support(struct ice_pf *pf)
 	case ICE_DEV_ID_E810C_QSFP:
 	case ICE_DEV_ID_E810C_SFP:
 		ice_set_feature_support(pf, ICE_F_DSCP);
-		ice_set_feature_support(pf, ICE_F_PTP_EXTTS);
 		if (ice_is_e810t(&pf->hw)) {
 			ice_set_feature_support(pf, ICE_F_SMA_CTRL);
 			if (ice_gnss_is_gps_present(&pf->hw))
drivers/net/ethernet/intel/ice/ice_ptp.c +1 -3
index 97b8581ae931..9524fcea9ae9 100644
@@ -2205,9 +2205,7 @@ static void
 ice_ptp_setup_pins_e810(struct ice_pf *pf, struct ptp_clock_info *info)
 {
 	info->n_per_out = N_PER_OUT_E810;
-
-	if (ice_is_feature_supported(pf, ICE_F_PTP_EXTTS))
-		info->n_ext_ts = N_EXT_TS_E810;
+	info->n_ext_ts = N_EXT_TS_E810;
 
 	if (ice_is_feature_supported(pf, ICE_F_SMA_CTRL)) {
 		info->n_ext_ts = N_EXT_TS_E810;
Signature · 6 lines
2.41.0.1.g9857a21e0017.dirty

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v2 1/5
#2 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v2 1/5] ice: remove ICE_F_PTP_EXTTS feature flag

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jacob Keller
Sent: Wednesday, August 16, 2023 5:01 PM
To: Intel Wired LAN <[email protected]>
Cc: Kolacinski, Karol <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v2 1/5] ice: remove ICE_F_PTP_EXTTS feature flag

The ICE_F_PTP_EXTTS feature flag is ostensibly intended to support checking

whether the device supports external timestamp pins. It is only checked in E810-specific code flows, and is enabled for all E810-based devices. E822
and E823 flows unconditionally enable external timestamp support.

Quoted 2 lines

This makes the feature flag meaningless, as it is always enabled. Just

unconditionally enable support for external timestamp pins and remove this unnecessary flag.

Quoted 10 lines

---
No changes since v1.

drivers/net/ethernet/intel/ice/ice.h | 1 -

 drivers/net/ethernet/intel/ice/ice_lib.c | 1 -
 drivers/net/ethernet/intel/ice/ice_ptp.c | 4 +---
 3 files changed, 1 insertion(+), 5 deletions(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#3 lore raw

PATCH v2 2/5 ice: fix pin assignment for E810-T without SMA control

In reply to Jacob Keller

Since commit 43c4958a3ddb ("ice: Merge pin initialization of E810 and E810T adapters"), the ice_ptp_setup_pins_e810() function has been used for both E810 and E810-T devices. The new implementation only distinguishes between whether the device has SMA control or not. It was assumed this is always true for E810-T devices. In addition, it does not set the n_per_out value appropriately when SMA control is enabled.

In some cases, the E810-T device may not have access to SMA control. In that case, the E810-T device actually has access to fewer pins than a standard E810 device.

Fix the implementation to correctly assign the appropriate pin counts for E810-T devices both with and without SMA control. The mentioned commit already includes the appropriate macro values for these pin counts but they were unused.

Instead of assigning the default E810 values and then overwriting them, handle the cases separately in order of E810-T with SMA, E810-T without SMA, and then standard E810. This flow makes following the logic easier.

Fixes 43c4958a3ddb ("ice: Merge pin initialization of E810 and E810T adapters")

---
New patch in v2.

This is not sent as a fix to net because it is effectively meaningless without the following change to conditionally enable or disable the ICE_F_SMA_CTRL flag. Currently for E810-T devices the driver always enables ICE_F_SMA_CTRL. On failure to setup SMA pins, the driver clears all pin functionality. Thus, this change does in some sense fix the mentioned commit, but is not sufficient to meaningfully change behavior on its own as it depends on the change to only enable SMA control when the device has access according to the netlist.

 drivers/net/ethernet/intel/ice/ice_ptp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_ptp.c +7 -3
index 9524fcea9ae9..ca40ca220cc9 100644
@@ -2204,16 +2204,20 @@ ice_ptp_setup_sma_pins_e810t(struct ice_pf *pf, struct ptp_clock_info *info)
 static void
 ice_ptp_setup_pins_e810(struct ice_pf *pf, struct ptp_clock_info *info)
 {
-	info->n_per_out = N_PER_OUT_E810;
-	info->n_ext_ts = N_EXT_TS_E810;
-
 	if (ice_is_feature_supported(pf, ICE_F_SMA_CTRL)) {
 		info->n_ext_ts = N_EXT_TS_E810;
+		info->n_per_out = N_PER_OUT_E810T;
 		info->n_pins = NUM_PTP_PINS_E810T;
 		info->verify = ice_verify_pin_e810t;
 
 		/* Complete setup of the SMA pins */
 		ice_ptp_setup_sma_pins_e810t(pf, info);
+	} else if (ice_is_e810t(&pf->hw)) {
+		info->n_ext_ts = N_EXT_TS_NO_SMA_E810T;
+		info->n_per_out = N_PER_OUT_NO_SMA_E810T;
+	} else {
+		info->n_per_out = N_PER_OUT_E810;
+		info->n_ext_ts = N_EXT_TS_E810;
 	}
 }
 
Signature · 6 lines
2.41.0.1.g9857a21e0017.dirty

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v2 2/5
#4 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v2 2/5] ice: fix pin assignment for E810-T without SMA control

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jacob Keller
Sent: Wednesday, August 16, 2023 5:01 PM
To: Intel Wired LAN <[email protected]>
Cc: Kolacinski, Karol <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v2 2/5] ice: fix pin assignment for E810-T without SMA control

Since commit 43c4958a3ddb ("ice: Merge pin initialization of E810 and E810T

adapters"), the ice_ptp_setup_pins_e810() function has been used for both E810 and E810-T devices. The new implementation only distinguishes between whether the device has SMA control or not. It was assumed this is always true for E810-T devices. In addition, it does not set the n_per_out value appropriately when SMA control is enabled.

Quoted 2 lines

In some cases, the E810-T device may not have access to SMA control. In

that case, the E810-T device actually has access to fewer pins than a standard E810 device.

Quoted 2 lines

Fix the implementation to correctly assign the appropriate pin counts for

E810-T devices both with and without SMA control. The mentioned commit already includes the appropriate macro values for these pin counts but they were unused.

Quoted 2 lines

Instead of assigning the default E810 values and then overwriting them,

handle the cases separately in order of E810-T with SMA, E810-T without SMA, and then standard E810. This flow makes following the logic easier.

Quoted 7 lines
Fixes 43c4958a3ddb ("ice: Merge pin initialization of E810 and E810T adapters")

---
New patch in v2.

This is not sent as a fix to net because it is effectively meaningless

without the following change to conditionally enable or disable the ICE_F_SMA_CTRL flag. Currently for E810-T devices the driver always enables ICE_F_SMA_CTRL. On failure to setup SMA pins, the driver clears all pin functionality. Thus, this change does in some sense fix the mentioned commit, but is not sufficient to meaningfully change behavior on its own as it depends on the change to only enable SMA control when the device has access according to the netlist.

Quoted 4 lines

drivers/net/ethernet/intel/ice/ice_ptp.c | 10 +++++++---

1 file changed, 7 insertions(+), 3 deletions(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#5 lore raw

PATCH v2 3/5 ice: don't enable PTP related capabilities on non-owner PFs

In reply to Jacob Keller

The ice driver currently sets feature flags for certain PTP related capabilities based on whether the device has support for the feature. Avoid enabling these capabilities except on the ports which own the timer. This ensures that the driver never attempts to access the features except on the ports designated as controlling the main timer functionality.

---
No changes in v2.

 drivers/net/ethernet/intel/ice/ice_lib.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ice/ice_lib.c +3 -0
index 5dfcb824f817..f29ff54383b5 100644
@@ -3986,6 +3986,9 @@ void ice_init_feature_support(struct ice_pf *pf)
 	case ICE_DEV_ID_E810C_QSFP:
 	case ICE_DEV_ID_E810C_SFP:
 		ice_set_feature_support(pf, ICE_F_DSCP);
+		/* If we don't own the timer - don't enable other caps */
+		if (!ice_pf_src_tmr_owned(pf))
+			break;
 		if (ice_is_e810t(&pf->hw)) {
 			ice_set_feature_support(pf, ICE_F_SMA_CTRL);
 			if (ice_gnss_is_gps_present(&pf->hw))
Signature · 6 lines
2.41.0.1.g9857a21e0017.dirty

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v2 3/5
#6 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: don't enable PTP related capabilities on non-owner PFs

Quoted 5 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jacob Keller
Sent: Wednesday, August 16, 2023 5:01 PM
To: Intel Wired LAN <[email protected]>
Cc: Kolacinski, Karol <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>

Subject: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: don't enable PTP related capabilities on non-owner PFs

Quoted 2 lines

The ice driver currently sets feature flags for certain PTP related

capabilities based on whether the device has support for the feature. Avoid enabling these capabilities except on the ports which own the timer. This ensures that the driver never attempts to access the features except on the ports designated as controlling the main timer functionality.

Quoted 8 lines

---
No changes in v2.

 drivers/net/ethernet/intel/ice/ice_lib.c | 3 +++
 1 file changed, 3 insertions(+)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#7 lore raw

PATCH v2 4/5 ice: check the netlist before enabling ICE_F_SMA_CTRL

In reply to Jacob Keller

Currently, the ice driver unconditionally enables ICE_F_SMA_CTRL for all E810-T based devices. In some cases, the SMA control access is not available in the netlist firmware component. In such a case, the driver will fail to setup the SMA pins. When this happens, the driver prints "Failed to configure E810-T SMA pin control" and forcibly disables all PTP pin configuration support.

This results in failure to use even the fixed pin capabilities of standard E810 devices, resulting in reduced functionality.

To avoid this, check the netlist for the SMA control module before enabling the ICE_F_SMA_CTRL feature. If the netlist lacks this module, then the feature will not be enabled. In this case, the driver flow for enabling periodic outputs and external timestamps will fall back to the standard fixed pin configuration.

This allows supporting the software defined pins on a wider array of platforms.

---
Changes since v1:
* rename ice_is_clock_mux_present_e810t() to ice_is_clock_mux_in_netlist_e810t() and move it into ice_common.c
* make ice_find_netlist_node() static
* reduce the scope of some variables in ice_find_netlist_node()
* use FIELD_PREP to set the node_type_ctx field
* remove rec_node_handle
* update function comment to indicate that node_handle contents should be ignored on error

 .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  6 +-
 drivers/net/ethernet/intel/ice/ice_common.c   | 62 +++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_common.h   |  1 +
 drivers/net/ethernet/intel/ice/ice_lib.c      |  3 +-
 4 files changed, 69 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +4 -2
index 90616750e779..82c4daf0a825 100644
@@ -1367,6 +1367,7 @@ struct ice_aqc_link_topo_params {
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CAGE	6
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ	7
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM	8
+#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX	10
 #define ICE_AQC_LINK_TOPO_NODE_CTX_S		4
 #define ICE_AQC_LINK_TOPO_NODE_CTX_M		\
 				(0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S)
@@ -1403,8 +1404,9 @@ struct ice_aqc_link_topo_addr {
 struct ice_aqc_get_link_topo {
 	struct ice_aqc_link_topo_addr addr;
 	u8 node_part_num;
-#define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575	0x21
-#define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827	0x31
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575			0x21
+#define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827			0x31
+#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX		0x47
 	u8 rsvd[9];
 };
 
drivers/net/ethernet/intel/ice/ice_common.c +62 -0

68 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_common.h +1 -0
index 2250a9c5f61e..a7a55c536150 100644
@@ -93,6 +93,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
 		    struct ice_aqc_get_phy_caps_data *caps,
 		    struct ice_sq_cd *cd);
 bool ice_is_pf_c827(struct ice_hw *hw);
+bool ice_is_clock_mux_in_netlist_e810t(struct ice_hw *hw);
 int
 ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count,
 		 enum ice_adminq_opc opc, struct ice_sq_cd *cd);
drivers/net/ethernet/intel/ice/ice_lib.c +2 -1
index f29ff54383b5..fe4bf5967d32 100644
@@ -3989,8 +3989,9 @@ void ice_init_feature_support(struct ice_pf *pf)
 		/* If we don't own the timer - don't enable other caps */
 		if (!ice_pf_src_tmr_owned(pf))
 			break;
-		if (ice_is_e810t(&pf->hw)) {
+		if (ice_is_clock_mux_in_netlist_e810t(&pf->hw))
 			ice_set_feature_support(pf, ICE_F_SMA_CTRL);
+		if (ice_is_e810t(&pf->hw)) {
 			if (ice_gnss_is_gps_present(&pf->hw))
 				ice_set_feature_support(pf, ICE_F_GNSS);
 		}
Signature · 6 lines
2.41.0.1.g9857a21e0017.dirty

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v2 4/5
#8 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v2 4/5] ice: check the netlist before enabling ICE_F_SMA_CTRL

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jacob Keller
Sent: Wednesday, August 16, 2023 5:01 PM
To: Intel Wired LAN <[email protected]>
Cc: Kolacinski, Karol <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v2 4/5] ice: check the netlist before enabling ICE_F_SMA_CTRL

Currently, the ice driver unconditionally enables ICE_F_SMA_CTRL for all

E810-T based devices. In some cases, the SMA control access is not available in the netlist firmware component. In such a case, the driver will fail to setup the SMA pins. When this happens, the driver prints "Failed to configure E810-T SMA pin control" and forcibly disables all PTP pin configuration support.

Quoted 2 lines

This results in failure to use even the fixed pin capabilities of standard

E810 devices, resulting in reduced functionality.

Quoted 2 lines

To avoid this, check the netlist for the SMA control module before enabling

the ICE_F_SMA_CTRL feature. If the netlist lacks this module, then the feature will not be enabled. In this case, the driver flow for enabling periodic outputs and external timestamps will fall back to the standard fixed pin configuration.

Quoted 2 lines

This allows supporting the software defined pins on a wider array of

platforms.

Quoted 5 lines

---
Changes since v1:
* rename ice_is_clock_mux_present_e810t() to

ice_is_clock_mux_in_netlist_e810t() and move it into ice_common.c

Quoted 5 lines

* make ice_find_netlist_node() static
* reduce the scope of some variables in ice_find_netlist_node()
* use FIELD_PREP to set the node_type_ctx field
* remove rec_node_handle
* update function comment to indicate that node_handle contents should be

ignored on error

Quoted 7 lines

.../net/ethernet/intel/ice/ice_adminq_cmd.h | 6 +-

 drivers/net/ethernet/intel/ice/ice_common.c   | 62 +++++++++++++++++++
 drivers/net/ethernet/intel/ice/ice_common.h   |  1 +
 drivers/net/ethernet/intel/ice/ice_lib.c      |  3 +-
 4 files changed, 69 insertions(+), 3 deletions(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#9 lore raw

PATCH v2 5/5 ice: check netlist before enabling ICE_F_GNSS

In reply to Jacob Keller

Similar to the change made for ICE_F_SMA_CTRL, check the netlist before enabling support for ICE_F_GNSS. This ensures that the driver only enables the GNSS feature on devices which actually have the feature enabled in the firmware device configuration.

---
Changes since v1:
* rename ice_is_gps_present_e810t() to ice_is_gps_in_netlist_e810t() and move it into ice_common.c
* call ice_is_gps_present_e810t() from ice_gnss_is_gps_present()

 drivers/net/ethernet/intel/ice/ice_adminq_cmd.h |  2 ++
 drivers/net/ethernet/intel/ice/ice_common.c     | 15 +++++++++++++++
 drivers/net/ethernet/intel/ice/ice_common.h     |  1 +
 drivers/net/ethernet/intel/ice/ice_gnss.c       |  3 +++
 drivers/net/ethernet/intel/ice/ice_lib.c        |  6 ++----
 5 files changed, 23 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +2 -0
index 82c4daf0a825..2f0d4bffe210 100644
@@ -1368,6 +1368,7 @@ struct ice_aqc_link_topo_params {
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_MEZZ	7
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM	8
 #define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX	10
+#define ICE_AQC_LINK_TOPO_NODE_TYPE_GPS		11
 #define ICE_AQC_LINK_TOPO_NODE_CTX_S		4
 #define ICE_AQC_LINK_TOPO_NODE_CTX_M		\
 				(0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S)
@@ -1407,6 +1408,7 @@ struct ice_aqc_get_link_topo {
 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_PCA9575			0x21
 #define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827			0x31
 #define ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX		0x47
+#define ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_GPS			0x48
 	u8 rsvd[9];
 };
 
drivers/net/ethernet/intel/ice/ice_common.c +15 -0
index 3d1b87151dc6..cbfe9ee2ffdf 100644
@@ -2565,6 +2565,21 @@ bool ice_is_clock_mux_in_netlist_e810t(struct ice_hw *hw)
 	return true;
 }
 
+/**
+ * ice_is_gps_in_netlist_e810t
+ * @hw: pointer to the hw struct
+ *
+ * Check if the GPS generic device is present in the netlist
+ */
+bool ice_is_gps_in_netlist_e810t(struct ice_hw *hw)
+{
+	if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS,
+				  ICE_ACQ_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL))
+		return false;
+
+	return true;
+}
+
 /**
  * ice_aq_list_caps - query function/device capabilities
  * @hw: pointer to the HW struct
drivers/net/ethernet/intel/ice/ice_common.h +1 -0
index a7a55c536150..14296c64b445 100644
@@ -94,6 +94,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
 		    struct ice_sq_cd *cd);
 bool ice_is_pf_c827(struct ice_hw *hw);
 bool ice_is_clock_mux_in_netlist_e810t(struct ice_hw *hw);
+bool ice_is_gps_in_netlist_e810t(struct ice_hw *hw);
 int
 ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count,
 		 enum ice_adminq_opc opc, struct ice_sq_cd *cd);
drivers/net/ethernet/intel/ice/ice_gnss.c +3 -0
index 75c9de675f20..e29f8067dd25 100644
@@ -389,6 +389,9 @@ bool ice_gnss_is_gps_present(struct ice_hw *hw)
 	if (!hw->func_caps.ts_func_info.src_tmr_owned)
 		return false;
 
+	if (!ice_is_gps_in_netlist_e810t(hw))
+		return false;
+
 #if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
 	if (ice_is_e810t(hw)) {
 		int err;
drivers/net/ethernet/intel/ice/ice_lib.c +2 -4
index fe4bf5967d32..2fec5dffe3bf 100644
@@ -3991,10 +3991,8 @@ void ice_init_feature_support(struct ice_pf *pf)
 			break;
 		if (ice_is_clock_mux_in_netlist_e810t(&pf->hw))
 			ice_set_feature_support(pf, ICE_F_SMA_CTRL);
-		if (ice_is_e810t(&pf->hw)) {
-			if (ice_gnss_is_gps_present(&pf->hw))
-				ice_set_feature_support(pf, ICE_F_GNSS);
-		}
+		if (ice_gnss_is_gps_present(&pf->hw))
+			ice_set_feature_support(pf, ICE_F_GNSS);
 		break;
 	default:
 		break;
Signature · 6 lines
2.41.0.1.g9857a21e0017.dirty

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v2 5/5
#10 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v2 5/5] ice: check netlist before enabling ICE_F_GNSS

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jacob Keller
Sent: Wednesday, August 16, 2023 5:01 PM
To: Intel Wired LAN <[email protected]>
Cc: Kolacinski, Karol <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v2 5/5] ice: check netlist before enabling ICE_F_GNSS

Similar to the change made for ICE_F_SMA_CTRL, check the netlist before

enabling support for ICE_F_GNSS. This ensures that the driver only enables the GNSS feature on devices which actually have the feature enabled in the firmware device configuration.

Quoted 5 lines

---
Changes since v1:
* rename ice_is_gps_present_e810t() to ice_is_gps_in_netlist_e810t() and

move it into ice_common.c

Quoted 9 lines

* call ice_is_gps_present_e810t() from ice_gnss_is_gps_present()

 drivers/net/ethernet/intel/ice/ice_adminq_cmd.h |  2 ++
 drivers/net/ethernet/intel/ice/ice_common.c     | 15 +++++++++++++++
 drivers/net/ethernet/intel/ice/ice_common.h     |  1 +
 drivers/net/ethernet/intel/ice/ice_gnss.c       |  3 +++
 drivers/net/ethernet/intel/ice/ice_lib.c        |  6 ++----
 5 files changed, 23 insertions(+), 4 deletions(-)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

maintainer Reviewed-by on the v2 series
#11 lore raw
In reply to Jacob Keller
Quoted 43 lines · Jacob Keller

This series refactors and extends the feature flag detection for a couple of PTP feature flags. This includes ICE_F_GNSS and ICE_F_SMA_CTRL. Instead of blindly assuming the feature is enabled on all E810-T devices, check the netlist to confirm that the feature is supported on that device and platform.

For SMA control, this allows the driver to fallback to the fixed pin configuration that is supported by default E810 configurations when the SMA control is not accessible.

For GNSS, this ensures that we do not attempt to read the GNSS portion of the device if its not present, avoiding some unnecessary warning messages.

For ICE_F_SMA_CTRL this could be seen as a fix, but given the scope of the code I decided that its next material. I think of it more as extending the feature capability to support pins on more platforms.

Changes since v1:
* add a patch to fix E810-T pin counts when SMA is disabled
* use FIELD_PREP in ice_find_netlist_node
* reduce scope of variables in ice_find_netlist_node
* remove unnecessary local variable in ice_find_netlist_node
* rename "present" functions to use "in_netlist" terminology, and move them into ice_common.c
* call ice_is_gps_in_netlist_e810t() from ice_gnss_is_gps_present()

Jacob Keller (5):
ice: remove ICE_F_PTP_EXTTS feature flag
ice: fix pin assignment for E810-T without SMA control
ice: don't enable PTP related capabilities on non-owner PFs
ice: check the netlist before enabling ICE_F_SMA_CTRL
ice: check netlist before enabling ICE_F_GNSS

  drivers/net/ethernet/intel/ice/ice.h          |  1 -
  .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  8 +-
  drivers/net/ethernet/intel/ice/ice_common.c   | 77 +++++++++++++++++++
  drivers/net/ethernet/intel/ice/ice_common.h   |  2 +
  drivers/net/ethernet/intel/ice/ice_gnss.c     |  3 +
  drivers/net/ethernet/intel/ice/ice_lib.c      | 11 +--
  drivers/net/ethernet/intel/ice/ice_ptp.c      | 12 +--
  7 files changed, 101 insertions(+), 13 deletions(-)
Quoted 1 line

base-commit: 361b86237e1afbf2c3be7cb604b6aac6f8b8c38c

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan