]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fix up net-stmmac-add-mutex-lock-to-protect-est-parameters.patch on 5.10
authorSasha Levin <sashal@kernel.org>
Thu, 2 Sep 2021 13:50:35 +0000 (09:50 -0400)
committerSasha Levin <sashal@kernel.org>
Thu, 2 Sep 2021 13:50:35 +0000 (09:50 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/net-stmmac-add-mutex-lock-to-protect-est-parameters.patch

index f829c9c3d4243c8e69a8264be4ad0dcd980fe18b..e63e9711155b9e35fc01bfa712b6d4705544a8f7 100644 (file)
@@ -1,4 +1,4 @@
-From 94c442a8f2c6ef87b31b855106753ddaaa39d72d Mon Sep 17 00:00:00 2001
+From 0f2d8e3d01ee074f7bf4e255f6a21502d75b29e2 Mon Sep 17 00:00:00 2001
 From: Sasha Levin <sashal@kernel.org>
 Date: Mon, 5 Jul 2021 18:26:54 +0800
 Subject: net: stmmac: add mutex lock to protect est parameters
@@ -12,14 +12,15 @@ EST parameters can be updated by other threads.
 
 Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
 Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 1++++++++++++-
+ drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c | 14 +++++++++++++-
  include/linux/stmmac.h                          |  1 +
- 2 files changed, 13 insertions(+), 1 deletion(-)
+ 2 files changed, 14 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
-index 40dc14d1415f..8c2eae2a7efd 100644
+index 40dc14d1415f..6bd9f0c50ffe 100644
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
 @@ -689,14 +689,18 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
@@ -49,7 +50,7 @@ index 40dc14d1415f..8c2eae2a7efd 100644
        /* Adjust for real system time */
        priv->ptp_clock_ops.gettime64(&priv->ptp_clock_ops, &current_time);
        current_time_ns = timespec64_to_ktime(current_time);
-@@ -751,8 +756,10 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
+@@ -751,19 +756,23 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
        priv->plat->est->ctr[0] = do_div(ctr, NSEC_PER_SEC);
        priv->plat->est->ctr[1] = (u32)ctr;
  
@@ -61,7 +62,12 @@ index 40dc14d1415f..8c2eae2a7efd 100644
  
        ret = stmmac_fpe_configure(priv, priv->ioaddr,
                                   priv->plat->tx_queues_to_use,
-@@ -764,6 +771,7 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
+                                  priv->plat->rx_queues_to_use, fpe);
+       if (ret && fpe) {
++              mutex_unlock(&priv->plat->est->lock);
+               netdev_err(priv->dev, "failed to enable Frame Preemption\n");
+               return ret;
+       }
  
        ret = stmmac_est_configure(priv, priv->ioaddr, priv->plat->est,
                                   priv->plat->clk_ptp_rate);
@@ -69,7 +75,7 @@ index 40dc14d1415f..8c2eae2a7efd 100644
        if (ret) {
                netdev_err(priv->dev, "failed to configure EST\n");
                goto disable;
-@@ -773,9 +781,12 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
+@@ -773,9 +782,12 @@ static int tc_setup_taprio(struct stmmac_priv *priv,
        return 0;
  
  disable: