Patch "net: stmmac: fix system hang if change mac address after interface ifdown" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: stmmac: fix system hang if change mac address after interface ifdown

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-stmmac-fix-system-hang-if-change-mac-address-after-interface-ifdown.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Fri Nov 19 02:27:53 PM CET 2021
From: Meng Li <Meng.Li@xxxxxxxxxxxxx>
Date: Fri, 19 Nov 2021 10:53:57 +0800
Subject: net: stmmac: fix system hang if change mac address after interface ifdown
To: stable@xxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, kuba@xxxxxxxxxx, mcoquelin.stm32@xxxxxxxxx, linux@xxxxxxxxxxxxxxx, andrew@xxxxxxx, qiangqing.zhang@xxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, meng.li@xxxxxxxxxxxxx
Message-ID: <20211119025359.30815-5-Meng.Li@xxxxxxxxxxxxx>

From: Joakim Zhang <qiangqing.zhang@xxxxxxx>

commit 4691ffb18ac908609aab07d13af7995b6b89d33c upstream.

Fix system hang with below sequences:
~# ifconfig ethx down
~# ifconfig ethx hw ether xx:xx:xx:xx:xx:xx

After ethx down, stmmac all clocks gated off and then register access causes
system hang.

Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver")
Signed-off-by: Joakim Zhang <qiangqing.zhang@xxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Meng Li <Meng.Li@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4324,12 +4324,21 @@ static int stmmac_set_mac_address(struct
 	struct stmmac_priv *priv = netdev_priv(ndev);
 	int ret = 0;
 
+	ret = pm_runtime_get_sync(priv->device);
+	if (ret < 0) {
+		pm_runtime_put_noidle(priv->device);
+		return ret;
+	}
+
 	ret = eth_mac_addr(ndev, addr);
 	if (ret)
-		return ret;
+		goto set_mac_error;
 
 	stmmac_set_umac_addr(priv, priv->hw, ndev->dev_addr, 0);
 
+set_mac_error:
+	pm_runtime_put(priv->device);
+
 	return ret;
 }
 


Patches currently in stable-queue which might be from Meng.Li@xxxxxxxxxxxxx are

queue-5.10/net-stmmac-fix-missing-unlock-on-error-in-stmmac_suspend.patch
queue-5.10/net-stmmac-fix-system-hang-if-change-mac-address-after-interface-ifdown.patch
queue-5.10/net-stmmac-dwmac-rk-fix-unbalanced-pm_runtime_enable-warnings.patch
queue-5.10/net-stmmac-fix-issue-where-clk-is-being-unprepared-twice.patch
queue-5.10/net-stmmac-add-clocks-management-for-gmac-driver.patch
queue-5.10/net-stmmac-platform-fix-build-error-with-config_pm_sleep.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux