[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241106074040.3361730-3-m-malladi@ti.com>
Date: Wed, 6 Nov 2024 13:10:40 +0530
From: Meghana Malladi <m-malladi@...com>
To: <vigneshr@...com>, <m-karicheri2@...com>, <m-malladi@...com>,
<jan.kiszka@...mens.com>, <javier.carrasco.cruz@...il.com>,
<jacob.e.keller@...el.com>, <horms@...nel.org>,
<diogo.ivo@...mens.com>, <pabeni@...hat.com>, <kuba@...nel.org>,
<edumazet@...gle.com>, <davem@...emloft.net>, <andrew+netdev@...n.ch>
CC: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <srk@...com>,
Roger Quadros
<rogerq@...nel.org>, <danishanwar@...com>
Subject: [PATCH net 2/2] 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 setting the iep->pps_enable
and iep->perout_enable flags to false during the link down.
Fixes: c1e0230eeaab ("net: ti: icss-iep: Add IEP driver")
Signed-off-by: Meghana Malladi <m-malladi@...com>
---
drivers/net/ethernet/ti/icssg/icss_iep.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/ti/icssg/icss_iep.c b/drivers/net/ethernet/ti/icssg/icss_iep.c
index 5d6d1cf78e93..03abc25ced12 100644
--- a/drivers/net/ethernet/ti/icssg/icss_iep.c
+++ b/drivers/net/ethernet/ti/icssg/icss_iep.c
@@ -195,6 +195,12 @@ static void icss_iep_enable_shadow_mode(struct icss_iep *iep)
icss_iep_disable(iep);
+ /* clear compare config */
+ for (cmp = IEP_MIN_CMP; cmp < IEP_MAX_CMP; cmp++) {
+ regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG,
+ IEP_CMP_CFG_CMP_EN(cmp), 0);
+ }
+
/* disable shadow mode */
regmap_update_bits(iep->map, ICSS_IEP_CMP_CFG_REG,
IEP_CMP_CFG_SHADOW_EN, 0);
@@ -778,6 +784,10 @@ int icss_iep_exit(struct icss_iep *iep)
ptp_clock_unregister(iep->ptp_clock);
iep->ptp_clock = NULL;
}
+
+ iep->pps_enabled = false;
+ iep->perout_enabled = false;
+
icss_iep_disable(iep);
return 0;
--
2.25.1
Powered by blists - more mailing lists