Skip to contentSkip to conversation

IEP clock module bug fixes

PATCH Superseded Meghana Malladi 2 participants 7 messages Dec 11, 2024 – Dec 13, 2024

Subsystems (3)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover IEP clock module bug fixes

Hi All,
This series has some bug fixes for IEP module needed by PPS and timesync operations.

Patch 1/2 fixes firmware load sequence to run all the firmwares when either of the ethernet interfaces is up. Move all the code common for firmware bringup under common functions.

Patch 2/2 fixes distorted PPS signal when the ethernet interfaces are brough down and up. This patch also fixes enabling PPS signal after bringing the interface up, without disabling PPS.

MD Danish Anwar (1):
net: ti: icssg-prueth: Fix firmware load sequence.

Meghana Malladi (1):
net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during
iep_init

 drivers/net/ethernet/ti/icssg/icss_iep.c      |   9 +
 drivers/net/ethernet/ti/icssg/icssg_common.c  |   1 -
 drivers/net/ethernet/ti/icssg/icssg_config.c  |  41 ++--
 drivers/net/ethernet/ti/icssg/icssg_config.h  |   1 +
 drivers/net/ethernet/ti/icssg/icssg_prueth.c  | 200 ++++++++++++------
 drivers/net/ethernet/ti/icssg/icssg_prueth.h  |   6 +-
 .../net/ethernet/ti/icssg/icssg_prueth_sr1.c  |   1 -
 7 files changed, 179 insertions(+), 80 deletions(-)

base-commit: dfc14664794a4706e0c2186a0c082386e6b14c4d

Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/2 net: ti: icssg-prueth: Fix firmware load sequence.

From: MD Danish Anwar <[email protected]>

Timesync related operations are ran in PRU0 cores for both ICSSG SLICE0 and SLICE1. Currently whenever any ICSSG interface comes up we load the respective firmwares to PRU cores and whenever interface goes down, we stop the resective cores. Due to this, when SLICE0 goes down while SLICE1 is still active, PRU0 firmwares are unloaded and PRU0 core is stopped. This results in clock jump for SLICE1 interface as the timesync related operations are no longer running.

As there are interdependencies between SLICE0 and SLICE1 firmwares, fix this by running both PRU0 and PRU1 firmwares as long as at least 1 ICSSG interface is up. Add new flag in prueth struct to check if all firmwares are running and remove the old flag (fw_running).

Use emacs_initialized as reference count to load the firmwares for the first and last interface up/down. Moving init_emac_mode and fw_offload_mode API outside of icssg_config to icssg_common_start API as they need to be called only once per firmware boot.

Change prueth_emac_restart() to return error code and add error prints inside the caller of this functions in case of any failures.

Fixes c1e0230eeaab ("net: ti: icss-iep: Add IEP driver")

---

Hi all,

This patch is based on net-next tagged next-20241205 v3:https://lore.kernel.org/all/[email protected]/

* Changes since v3 (v4-v3):
- Add error handling for prueth_emac_restart() suggested by Roger Quadros <[email protected]>
- Remove fw_running flag as suggested by Roger Quadros <[email protected]> and Diogo Ivo <[email protected]>
- Few cosmetic changes suggested by Kalesh Anakkur Purayil <[email protected]>

 drivers/net/ethernet/ti/icssg/icssg_common.c  |   1 -
 drivers/net/ethernet/ti/icssg/icssg_config.c  |  41 ++--
 drivers/net/ethernet/ti/icssg/icssg_config.h  |   1 +
 drivers/net/ethernet/ti/icssg/icssg_prueth.c  | 200 ++++++++++++------
 drivers/net/ethernet/ti/icssg/icssg_prueth.h  |   6 +-
 .../net/ethernet/ti/icssg/icssg_prueth_sr1.c  |   1 -
 6 files changed, 170 insertions(+), 80 deletions(-)
drivers/net/ethernet/ti/icssg/icssg_common.c +0 -1
index fdebeb2f84e0..179b5de58281 100644
@@ -872,7 +872,6 @@ void prueth_emac_stop(struct prueth_emac *emac)
 		return;
 	}
 
-	emac->fw_running = 0;
 	if (!emac->is_sr1)
 		rproc_shutdown(prueth->txpru[slice]);
 	rproc_shutdown(prueth->rtu[slice]);
drivers/net/ethernet/ti/icssg/icssg_config.c +28 -13

79 lines not on this page · raw message

drivers/net/ethernet/ti/icssg/icssg_config.h +1 -0
index 92c2deaa3068..c884e9fa099e 100644
@@ -55,6 +55,7 @@ struct icssg_rxq_ctx {
 #define ICSSG_FW_MGMT_FDB_CMD_TYPE	0x03
 #define ICSSG_FW_MGMT_CMD_TYPE		0x04
 #define ICSSG_FW_MGMT_PKT		0x80000000
+#define ICSSG_FW_MGMT_FDB_CMD_TYPE_RX_FLOW	0x05
 
 struct icssg_r30_cmd {
 	u32 cmd[4];
drivers/net/ethernet/ti/icssg/icssg_prueth.c +136 -64

355 lines not on this page · raw message

drivers/net/ethernet/ti/icssg/icssg_prueth.h +5 -1
index f5c1d473e9f9..d917945dad68 100644
@@ -140,7 +140,6 @@ struct prueth_rx_chn {
 /* data for each emac port */
 struct prueth_emac {
 	bool is_sr1;
-	bool fw_running;
 	struct prueth *prueth;
 	struct net_device *ndev;
 	u8 mac_addr[6];
@@ -257,6 +256,7 @@ struct icssg_firmwares {
  * @is_switchmode_supported: indicates platform support for switch mode
  * @switch_id: ID for mapping switch ports to bridge
  * @default_vlan: Default VLAN for host
+ * @prus_running: flag to indicate if all pru cores are running
  */
 struct prueth {
 	struct device *dev;
@@ -298,6 +298,7 @@ struct prueth {
 	int default_vlan;
 	/** @vtbl_lock: Lock for vtbl in shared memory */
 	spinlock_t vtbl_lock;
+	bool prus_running;
 };
 
 struct emac_tx_ts_response {
@@ -361,6 +362,8 @@ int icssg_set_port_state(struct prueth_emac *emac,
 			 enum icssg_port_state_cmd state);
 void icssg_config_set_speed(struct prueth_emac *emac);
 void icssg_config_half_duplex(struct prueth_emac *emac);
+void icssg_init_emac_mode(struct prueth *prueth);
+void icssg_init_fw_offload_mode(struct prueth *prueth);
 
 /* Buffer queue helpers */
 int icssg_queue_pop(struct prueth *prueth, u8 queue);
@@ -377,6 +380,7 @@ void icssg_vtbl_modify(struct prueth_emac *emac, u8 vid, u8 port_mask,
 		       u8 untag_mask, bool add);
 u16 icssg_get_pvid(struct prueth_emac *emac);
 void icssg_set_pvid(struct prueth *prueth, u8 vid, u8 port);
+int emac_fdb_flow_id_updated(struct prueth_emac *emac);
 #define prueth_napi_to_tx_chn(pnapi) \
 	container_of(pnapi, struct prueth_tx_chn, napi_tx)
 
drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c +0 -1
index 5024f0647a0d..a95b0150341a 100644
@@ -440,7 +440,6 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 		goto halt_pru;
 	}
 
-	emac->fw_running = 1;
 	return 0;
 
 halt_pru:
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH net v4 1/2] net: ti: icssg-prueth: Fix firmware load sequence.

Quoted 16 lines · Meghana Malladi
drivers/net/ethernet/ti/icssg/icssg_prueth.c +2 -4
-static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
+static int prueth_emac_start(struct prueth *prueth, int slice)
 {
 	struct icssg_firmwares *firmwares;
 	struct device *dev = prueth->dev;
-	int slice, ret;
+	int ret;
 
 	if (prueth->is_switch_mode)
 		firmwares = icssg_switch_firmwares;
@@ -177,16 +177,6 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 	else
 		firmwares = icssg_emac_firmwares;
 
-	slice = prueth_emac_slice(emac);
-	if (slice < 0) {

drivers/net/ethernet/ti/icssg/icssg_prueth.c static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) · line 181

Quoted 10 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +0 -8
-		netdev_err(emac->ndev, "invalid port\n");
-		return -EINVAL;
-	}
-
-	ret = icssg_config(prueth, emac, slice);
-	if (ret)
-		return ret;
-
 	ret = rproc_set_firmware(prueth->pru[slice], firmwares[slice].pru);
 	ret = rproc_boot(prueth->pru[slice]);

This isn't introduced by this patch but eventually Colin King is going to get annoyed with you for setting ret twice in a row.

Quoted 30 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +17 -1
 	if (ret) {
@@ -208,7 +198,6 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 		goto halt_rtu;
 	}
 
-	emac->fw_running = 1;
 	return 0;
 
 halt_rtu:
@@ -220,6 +209,78 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 	return ret;
 }
 
+static int prueth_emac_common_start(struct prueth *prueth)
+{
+	struct prueth_emac *emac;
+	int ret = 0;
+	int slice;
+
+	if (!prueth->emac[ICSS_SLICE0] && !prueth->emac[ICSS_SLICE1])
+		return -EINVAL;
+
+	/* clear SMEM and MSMC settings for all slices */
+	memset_io(prueth->msmcram.va, 0, prueth->msmcram.size);
+	memset_io(prueth->shram.va, 0, ICSSG_CONFIG_OFFSET_SLICE1 * PRUETH_NUM_MACS);
+
+	icssg_class_default(prueth->miig_rt, ICSS_SLICE0, 0, false);
+	icssg_class_default(prueth->miig_rt, ICSS_SLICE1, 0, false);
+
+	if (prueth->is_switch_mode || prueth->is_hsr_offload_mode)

drivers/net/ethernet/ti/icssg/icssg_prueth.c static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) · line 238

Quoted 10 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +10 -0
+		icssg_init_fw_offload_mode(prueth);
+	else
+		icssg_init_emac_mode(prueth);
+
+	for (slice = 0; slice < PRUETH_NUM_MACS; slice++) {
+		emac = prueth->emac[slice];
+		if (emac) {
+			ret |= icssg_config(prueth, emac, slice);
+			if (ret)
+				return ret;

Here we return directly.

drivers/net/ethernet/ti/icssg/icssg_prueth.c static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) · line 240

Quoted 2 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +2 -0
+		}
+		ret |= prueth_emac_start(prueth, slice);

Here we continue. Generally, I would expect there to be some clean up on this error path like this:

		ret = prueth_emac_start(prueth, slice);
		if (ret)
			goto unwind_slices;

	...

	return 0;

unwind_slices:

	while (--slice >= 0)
		prueth_emac_stop(prueth, slice);

	return ret;

I dread to see how the cleanup is handled on this path...

Ok. I've looked at it and, nope, it doesn't work. This is freed in prueth_emac_common_stop() but partial allocations are not freed. Also the prueth_emac_stop() is open coded as three calls to rproc_shutdown() which is ugly.

I've written a blog which describes a system for writing error handling code. If each function cleans up after itself by freeing its own partial allocations then you don't need to have a variable like "prueth->prus_running = 1;" to track how far the allocation process went before failing.
https://staticthinking.wordpress.com/2022/04/28/free-the-last-thing-style/

regards,
dan carpenter

#3 lore raw

Re: [EXTERNAL] Re: [PATCH net v4 1/2] net: ti: icssg-prueth: Fix firmware load sequence.

Quoted 26 lines · Dan Carpenter

On Wed, Dec 11, 2024 at 07: 29: 40PM +0530, Meghana Malladi wrote: > -static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) > +static int prueth_emac_start(struct prueth *prueth, int slice)

Quoted 1 line

{ > struct icssg_firmwares

ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe. Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uldqfRcOdo0RqyXEHNnjPxku43QuA2sRmrlczDVj-denyMX3qWPEeHokm6IS-fNmWZGSvK3Wn7nSFeNotanVMDOTlZZjZ8Ausf9AkMk$>
ZjQcmQRYFpfptBannerEnd

Quoted 14 lines · Meghana Malladi
drivers/net/ethernet/ti/icssg/icssg_prueth.c +2 -2
-static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
+static int prueth_emac_start(struct prueth *prueth, int slice)
 {
 	struct icssg_firmwares *firmwares;
 	struct device *dev = prueth->dev;
-	int slice, ret;
+	int ret;
 
 	if (prueth->is_switch_mode)
 		firmwares = icssg_switch_firmwares;
@@ -177,16 +177,6 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 	else
 		firmwares = icssg_emac_firmwares;
 
Quoted 16 lines

drivers/net/ethernet/ti/icssg/icssg_prueth.c static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) · line 181

Quoted 12 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +0 -10
-	slice = prueth_emac_slice(emac);
-	if (slice < 0) {
-		netdev_err(emac->ndev, "invalid port\n");
-		return -EINVAL;
-	}
-
-	ret = icssg_config(prueth, emac, slice);
-	if (ret)
-		return ret;
-
 	ret = rproc_set_firmware(prueth->pru[slice], firmwares[slice].pru);
 	ret = rproc_boot(prueth->pru[slice]);

This isn't introduced by this patch but eventually Colin King is going to get annoyed with you for setting ret twice in a row.

Yeah ok, I will fix this as part of this patch.

Quoted 70 lines
Quoted 30 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +17 -1
 	if (ret) {
@@ -208,7 +198,6 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 		goto halt_rtu;
 	}
 
-	emac->fw_running = 1;
 	return 0;
 
 halt_rtu:
@@ -220,6 +209,78 @@ static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac)
 	return ret;
 }
 
+static int prueth_emac_common_start(struct prueth *prueth)
+{
+	struct prueth_emac *emac;
+	int ret = 0;
+	int slice;
+
+	if (!prueth->emac[ICSS_SLICE0] && !prueth->emac[ICSS_SLICE1])
+		return -EINVAL;
+
+	/* clear SMEM and MSMC settings for all slices */
+	memset_io(prueth->msmcram.va, 0, prueth->msmcram.size);
+	memset_io(prueth->shram.va, 0, ICSSG_CONFIG_OFFSET_SLICE1 * PRUETH_NUM_MACS);
+
+	icssg_class_default(prueth->miig_rt, ICSS_SLICE0, 0, false);
+	icssg_class_default(prueth->miig_rt, ICSS_SLICE1, 0, false);
+
+	if (prueth->is_switch_mode || prueth->is_hsr_offload_mode)

drivers/net/ethernet/ti/icssg/icssg_prueth.c static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) · line 238

Quoted 10 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +10 -0
+		icssg_init_fw_offload_mode(prueth);
+	else
+		icssg_init_emac_mode(prueth);
+
+	for (slice = 0; slice < PRUETH_NUM_MACS; slice++) {
+		emac = prueth->emac[slice];
+		if (emac) {
+			ret |= icssg_config(prueth, emac, slice);
+			if (ret)
+				return ret;

Here we return directly.

drivers/net/ethernet/ti/icssg/icssg_prueth.c static int prueth_emac_start(struct prueth *prueth, struct prueth_emac *emac) · line 240

Quoted 2 lines
drivers/net/ethernet/ti/icssg/icssg_prueth.c +2 -0
+		}
+		ret |= prueth_emac_start(prueth, slice);

Here we continue. Generally, I would expect there to be some clean up on this error path like this:

		ret = prueth_emac_start(prueth, slice);
		if (ret)
			goto unwind_slices;

	...

	return 0;

unwind_slices:

	while (--slice >= 0)
		prueth_emac_stop(prueth, slice);

	return ret;

I dread to see how the cleanup is handled on this path...

Ok. I've looked at it and, nope, it doesn't work. This is freed in prueth_emac_common_stop() but partial allocations are not freed. Also the prueth_emac_stop() is open coded as three calls to rproc_shutdown() which is ugly.

Quoted 7 lines

I've written a blog which describes a system for writing error handling code. If each function cleans up after itself by freeing its own partial allocations then you don't need to have a variable like "prueth->prus_running = 1;" to track how far the allocation process went before failing.

https://urldefense.com/v3/__https://staticthinking.wordpress.com/2022/04/28/free-the-last-thing-style/__;!!G3vK!T5VCna8tMLVZNSL49zSwJOQBnoAQEa2xqXUUsIYY78CYm5mEH2wAdMX9CDEfMHXWsjTn0sG4mwKevVIOrgfAuQ$  <https://urldefense.com/v3/__https://staticthinking.wordpress.com/2022/04/28/free-the-last-thing-style/__;!!G3vK!T5VCna8tMLVZNSL49zSwJOQBnoAQEa2xqXUUsIYY78CYm5mEH2wAdMX9CDEfMHXWsjTn0sG4mwKevVIOrgfAuQ$>

I agree that current error handling is all over the place. But I wasn't sure what would be the cleanest approach here. Thanks for sharing the blog, I have looked into it and looks very promising. I will try this approach and get back to you.

thanks & regards,
Meghana Malladi.

Quoted 3 lines

regards,
dan carpenter

#4 lore raw

PATCH v4 2/2 net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init

In reply to Meghana Malladi

When ICSSG interfaces are brought down and brought up again, the pru cores are shut down and booted again, flushing out all the memories and start again in a clean state. Hence it is expected that the IEP_CMP_CFG register needs to be flushed during iep_init() to ensure that the existing residual configuration doesn't cause any unusual behavior. If the register is not cleared, existing IEP_CMP_CFG set for CMP1 will result in SYNC0_OUT signal based on the SYNC_OUT register values.

After bringing the interface up, calling PPS enable doesn't work as the driver believes PPS is already enabled, (iep->pps_enabled is not cleared during interface bring down) and driver will just return true even though there is no signal. Fix this by disabling pps and perout.

Fixes c1e0230eeaab ("net: ti: icss-iep: Add IEP driver")

---

Hi all,

This patch is based on net-next tagged next-20241205
v3: https://lore.kernel.org/all/[email protected]/

* Changes since v2 (v4-v2):
- Collected Reviewed-by tag from Roger Quadros <[email protected]>

 drivers/net/ethernet/ti/icssg/icss_iep.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/ti/icssg/icss_iep.c +9 -0
index 5d6d1cf78e93..a96861debbe3 100644
@@ -215,6 +215,10 @@ static void icss_iep_enable_shadow_mode(struct icss_iep *iep)
 	for (cmp = IEP_MIN_CMP; cmp < IEP_MAX_CMP; cmp++) {
 		regmap_update_bits(iep->map, ICSS_IEP_CMP_STAT_REG,
 				   IEP_CMP_STATUS(cmp), IEP_CMP_STATUS(cmp));
+
+		regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG,
+				   IEP_CMP_CFG_CMP_EN(cmp), 0);
+
 	}
 
 	/* enable reset counter on CMP0 event */
@@ -780,6 +784,11 @@ int icss_iep_exit(struct icss_iep *iep)
 	}
 	icss_iep_disable(iep);
 
+	if (iep->pps_enabled)
+		icss_iep_pps_enable(iep, false);
+	else if (iep->perout_enabled)
+		icss_iep_perout_enable(iep, NULL, false);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(icss_iep_exit);
Signature · 1 line
2.25.1
#5 lore raw

Re: [PATCH net v4 2/2] net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init

Quoted 8 lines · Meghana Malladi
 drivers/net/ethernet/ti/icssg/icss_iep.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/ti/icssg/icss_iep.c +0 -0
index 5d6d1cf78e93..a96861debbe3 100644

drivers/net/ethernet/ti/icssg/icss_iep.c static void icss_iep_enable_shadow_mode(struct icss_iep *iep) · line 221

Quoted 7 lines
drivers/net/ethernet/ti/icssg/icss_iep.c +4 -0
@@ -215,6 +215,10 @@ static void icss_iep_enable_shadow_mode(struct icss_iep *iep)
 	for (cmp = IEP_MIN_CMP; cmp < IEP_MAX_CMP; cmp++) {
 		regmap_update_bits(iep->map, ICSS_IEP_CMP_STAT_REG,
 				   IEP_CMP_STATUS(cmp), IEP_CMP_STATUS(cmp));
+
+		regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG,
+				   IEP_CMP_CFG_CMP_EN(cmp), 0);
+

Don't add this blank line.

You won't detect this by running checkpatch on the patch, but if you apply the patch and re-run checkpatch on the file then it will complain about this.

drivers/net/ethernet/ti/icssg/icss_iep.c int icss_iep_exit(struct icss_iep *iep) · line 790

Quoted 11 lines
drivers/net/ethernet/ti/icssg/icss_iep.c +4 -0
 	}
 
 	/* enable reset counter on CMP0 event */
@@ -780,6 +784,11 @@ int icss_iep_exit(struct icss_iep *iep)
 	}
 	icss_iep_disable(iep);
 
+	if (iep->pps_enabled)
+		icss_iep_pps_enable(iep, false);
+	else if (iep->perout_enabled)
+		icss_iep_perout_enable(iep, NULL, false);

Do we need the else? Could be written as:

	if (iep->pps_enabled)
		icss_iep_pps_enable(iep, false);
	if (iep->perout_enabled)
		icss_iep_perout_enable(iep, NULL, false);

regards,
dan carpenter

#6 lore raw

Re: [EXTERNAL] Re: [PATCH net v4 2/2] net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init

Quoted 27 lines · Dan Carpenter

On Wed, Dec 11, 2024 at 07: 29: 41PM +0530, Meghana Malladi wrote: > drivers/net/ethernet/ti/icssg/icss_iep. c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/ethernet/ti/icssg/icss_iep. c b/drivers/net/ethernet/ti/icssg/icss_iep. c ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe.
Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uldqd1eFN22R6yXOvHOpn5WAo9_VFQH5-v8XYKsQLuIl9SMCOgfm9hmv8Rr9Y_bMWd5wpdH9mAXBiUbw5VhHCnva7cOtZgfLcnsXKK4$>
ZjQcmQRYFpfptBannerEnd

Quoted 8 lines · Meghana Malladi
 drivers/net/ethernet/ti/icssg/icss_iep.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/ti/icssg/icss_iep.c +0 -0
index 5d6d1cf78e93..a96861debbe3 100644

drivers/net/ethernet/ti/icssg/icss_iep.c static void icss_iep_enable_shadow_mode(struct icss_iep *iep) · line 221

Quoted 7 lines
drivers/net/ethernet/ti/icssg/icss_iep.c +4 -0
@@ -215,6 +215,10 @@ static void icss_iep_enable_shadow_mode(struct icss_iep *iep)
 	for (cmp = IEP_MIN_CMP; cmp < IEP_MAX_CMP; cmp++) {
 		regmap_update_bits(iep->map, ICSS_IEP_CMP_STAT_REG,
 				   IEP_CMP_STATUS(cmp), IEP_CMP_STATUS(cmp));
+
+		regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG,
+				   IEP_CMP_CFG_CMP_EN(cmp), 0);
+

Don't add this blank line.

Quoted 4 lines

You won't detect this by running checkpatch on the patch, but if you apply the patch and re-run checkpatch on the file then it will complain about this.

I see, I will remove the blank line then.

Quoted 15 lines

drivers/net/ethernet/ti/icssg/icss_iep.c int icss_iep_exit(struct icss_iep *iep) · line 790

Quoted 11 lines
drivers/net/ethernet/ti/icssg/icss_iep.c +4 -0
 	}
 
 	/* enable reset counter on CMP0 event */
@@ -780,6 +784,11 @@ int icss_iep_exit(struct icss_iep *iep)
 	}
 	icss_iep_disable(iep);
 
+	if (iep->pps_enabled)
+		icss_iep_pps_enable(iep, false);
+	else if (iep->perout_enabled)
+		icss_iep_perout_enable(iep, NULL, false);

Do we need the else? Could be written as:

Quoted 5 lines
	if (iep->pps_enabled)
		icss_iep_pps_enable(iep, false);
	if (iep->perout_enabled)
		icss_iep_perout_enable(iep, NULL, false);

pps and perout and mutually exclusive, hence used if and else if.

Quoted 4 lines

regards,
dan carpenter