diff mbox series

[net] net: dsa: sja1105: Remove restriction of zero base-time for taprio offload

Message ID 20191227010354.26826-1-olteanv@gmail.com
State Accepted
Delegated to: David Miller
Headers show
Series [net] net: dsa: sja1105: Remove restriction of zero base-time for taprio offload | expand

Commit Message

Vladimir Oltean Dec. 27, 2019, 1:03 a.m. UTC
The check originates from the initial implementation which was not based
on PTP time but on a standalone clock source. In the meantime we can now
program the PTPSCHTM register at runtime with the dynamic base time
(actually with a value that is 200 ns smaller, to avoid writing DELTA=0
in the Schedule Entry Points Parameters Table). And we also have logic
for moving the actual base time in the future of the PHC's current time
base, so the check for zero serves no purpose, since even if the user
will specify zero, that's not what will end up in the static config
table where the limitation is.

Fixes: 86db36a347b4 ("net: dsa: sja1105: Implement state machine for TAS with PTP clock source")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
 drivers/net/dsa/sja1105/sja1105_tas.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

David Miller Dec. 31, 2019, 4:13 a.m. UTC | #1
From: Vladimir Oltean <olteanv@gmail.com>
Date: Fri, 27 Dec 2019 03:03:54 +0200

> The check originates from the initial implementation which was not based
> on PTP time but on a standalone clock source. In the meantime we can now
> program the PTPSCHTM register at runtime with the dynamic base time
> (actually with a value that is 200 ns smaller, to avoid writing DELTA=0
> in the Schedule Entry Points Parameters Table). And we also have logic
> for moving the actual base time in the future of the PHC's current time
> base, so the check for zero serves no purpose, since even if the user
> will specify zero, that's not what will end up in the static config
> table where the limitation is.
> 
> Fixes: 86db36a347b4 ("net: dsa: sja1105: Implement state machine for TAS with PTP clock source")
> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/dsa/sja1105/sja1105_tas.c b/drivers/net/dsa/sja1105/sja1105_tas.c
index 26b925b5dace..fa6750d973d7 100644
--- a/drivers/net/dsa/sja1105/sja1105_tas.c
+++ b/drivers/net/dsa/sja1105/sja1105_tas.c
@@ -477,11 +477,6 @@  int sja1105_setup_tc_taprio(struct dsa_switch *ds, int port,
 	if (admin->cycle_time_extension)
 		return -ENOTSUPP;
 
-	if (!ns_to_sja1105_delta(admin->base_time)) {
-		dev_err(ds->dev, "A base time of zero is not hardware-allowed\n");
-		return -ERANGE;
-	}
-
 	for (i = 0; i < admin->num_entries; i++) {
 		s64 delta_ns = admin->entries[i].interval;
 		s64 delta_cycles = ns_to_sja1105_delta(delta_ns);