diff --git a/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.15.patch b/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.15.patch index 014c34b156..ac5bbdd8bd 100644 --- a/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.15.patch +++ b/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.15.patch @@ -3368,3 +3368,56 @@ index 000000000000..7c4d47fe80c2 +MODULE_AUTHOR("Shawn Lin "); +MODULE_AUTHOR("Chris Morgan "); +MODULE_AUTHOR("Jon Lin "); +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Punit Agrawal +Date: Wed, 29 Sep 2021 22:50:49 +0900 +Subject: [PATCH] net: stmmac: dwmac-rk: Fix ethernet on rk3399 based devices + +Commit 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings") +while getting rid of a runtime PM warning ended up breaking ethernet +on rk3399 based devices. By dropping an extra reference to the device, +the commit ends up enabling suspend / resume of the ethernet device - +which appears to be broken. + +While the issue with runtime pm is being investigated, partially +revert commit 2d26f6e39afb to restore the network on rk3399. + +Fixes: 2d26f6e39afb ("net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings") +Suggested-by: Heiko Stuebner +Signed-off-by: Punit Agrawal +Cc: Michael Riesch +Tested-by: Heiko Stuebner +--- + drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +index ed817011a94a..6924a6aacbd5 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "stmmac_platform.h" + +@@ -1528,6 +1529,8 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) + return ret; + } + ++ pm_runtime_get_sync(dev); ++ + if (bsp_priv->integrated_phy) + rk_gmac_integrated_phy_powerup(bsp_priv); + +@@ -1539,6 +1542,8 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac) + if (gmac->integrated_phy) + rk_gmac_integrated_phy_powerdown(gmac); + ++ pm_runtime_put_sync(&gmac->pdev->dev); ++ + phy_power_on(gmac, false); + gmac_clk_enable(gmac, false); + } diff --git a/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch b/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch index 1a39f05dc1..10f98e8c41 100644 --- a/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch +++ b/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch @@ -644,72 +644,4 @@ index 3d98e2251ea5..b201700ccc8a 100644 .irqs = rockchip_vdpu2_irqs, .num_irqs = ARRAY_SIZE(rockchip_vdpu2_irqs), -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alex Bee -Date: wed, 1 Sep 2021 14:00:00 +1000 -Subject: [PATCH] net: stmmac: dwmac-rk: fix unbalanced pm_runtime_enable warnings -This LE11 REVERTS 5.14.0 commit -- reverts 2d26f6e39afb88d32b8f39e76a51b542c3c51674 - -BETWEEN THE LINE - -This reverts commit 2c896fb02e7f65299646f295a007bda043e0f382 -"net: stmmac: dwmac-rk: add pd_gmac support for rk3399" and fixes -unbalanced pm_runtime_enable warnings. - -In the commit to be reverted, support for power management was -introduced to the Rockchip glue code. Later, power management support -was introduced to the stmmac core code, resulting in multiple -invocations of pm_runtime_{enable,disable,get_sync,put_sync}. - -The multiple invocations happen in rk_gmac_powerup and -stmmac_{dvr_probe, resume} as well as in rk_gmac_powerdown and -stmmac_{dvr_remove, suspend}, respectively, which are always called -in conjunction. - -Fixes: 5ec55823438e850c91c6b92aec93fb04ebde29e2 ("net: stmmac: add clocks management for gmac driver") -Signed-off-by: Michael Riesch -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 9 --------- - 1 file changed, 9 deletions(-) - -ABOVE THE LINE - -diff -Nu a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - - #include "stmmac_platform.h" - -@@ -1528,6 +1529,9 @@ - return ret; - } - -+ pm_runtime_enable(dev); -+ pm_runtime_get_sync(dev); -+ - if (bsp_priv->integrated_phy) - rk_gmac_integrated_phy_powerup(bsp_priv); - -@@ -1536,9 +1540,14 @@ - - static void rk_gmac_powerdown(struct rk_priv_data *gmac) - { -+ struct device *dev = &gmac->pdev->dev; -+ - if (gmac->integrated_phy) - rk_gmac_integrated_phy_powerdown(gmac); - -+ pm_runtime_put_sync(dev); -+ pm_runtime_disable(dev); -+ - phy_power_on(gmac, false); - gmac_clk_enable(gmac, false); - }