Skip to content

Commit 9b11536

Browse files
MeghanaMalladiTIdavem330
authored andcommitted
net: ti: icssg-prueth: Fix clearing of IEP_CMP_CFG registers during iep_init
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: c1e0230 ("net: ti: icss-iep: Add IEP driver") Signed-off-by: Meghana Malladi <m-malladi@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9facce8 commit 9b11536

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/ethernet/ti/icssg/icss_iep.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ static void icss_iep_enable_shadow_mode(struct icss_iep *iep)
215215
for (cmp = IEP_MIN_CMP; cmp < IEP_MAX_CMP; cmp++) {
216216
regmap_update_bits(iep->map, ICSS_IEP_CMP_STAT_REG,
217217
IEP_CMP_STATUS(cmp), IEP_CMP_STATUS(cmp));
218+
219+
regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG,
220+
IEP_CMP_CFG_CMP_EN(cmp), 0);
218221
}
219222

220223
/* enable reset counter on CMP0 event */
@@ -780,6 +783,11 @@ int icss_iep_exit(struct icss_iep *iep)
780783
}
781784
icss_iep_disable(iep);
782785

786+
if (iep->pps_enabled)
787+
icss_iep_pps_enable(iep, false);
788+
else if (iep->perout_enabled)
789+
icss_iep_perout_enable(iep, NULL, false);
790+
783791
return 0;
784792
}
785793
EXPORT_SYMBOL_GPL(icss_iep_exit);

0 commit comments

Comments
 (0)