aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJose Abreu <Jose.Abreu@synopsys.com>2019-12-18 23:55:01 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-18 15:12:33 -0800
commita1ec57c020201ba29608a5a3588832d07de1a518 (patch)
treee103e9fdd0a398dee96af7768d816dfb915fe8c3 /drivers
parentMerge branch 'ETS-qdisc' (diff)
downloadlinux-dev-a1ec57c020201ba29608a5a3588832d07de1a518.tar.xz
linux-dev-a1ec57c020201ba29608a5a3588832d07de1a518.zip
net: stmmac: tc: Fix TAPRIO division operation
For ARCHs that don't support 64 bits division we need to use the helpers. Fixes: b60189e0392f ("net: stmmac: Integrate EST with TAPRIO scheduler API") Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
index 8ff8f9b9bb22..6c4686b77516 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
@@ -599,6 +599,7 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
struct timespec64 time;
bool fpe = false;
int i, ret = 0;
+ u64 ctr;
if (!priv->dma_cap.estsel)
return -EOPNOTSUPP;
@@ -694,8 +695,9 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
priv->plat->est->btr[0] = (u32)time.tv_nsec;
priv->plat->est->btr[1] = (u32)time.tv_sec;
- priv->plat->est->ctr[0] = (u32)(qopt->cycle_time % NSEC_PER_SEC);
- priv->plat->est->ctr[1] = (u32)(qopt->cycle_time / NSEC_PER_SEC);
+ ctr = qopt->cycle_time;
+ priv->plat->est->ctr[0] = do_div(ctr, NSEC_PER_SEC);
+ priv->plat->est->ctr[1] = (u32)ctr;
if (fpe && !priv->dma_cap.fpesel)
return -EOPNOTSUPP;