From: Greg Kroah-Hartman Date: Fri, 29 Apr 2022 09:23:03 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.19.241~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=158817bcc24617464f622ad1fba98e10cc5e4703;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: revert-net-ethernet-stmmac-fix-altr_tse_pcs-function-when-using-a-fixed-link.patch --- diff --git a/queue-4.19/revert-net-ethernet-stmmac-fix-altr_tse_pcs-function-when-using-a-fixed-link.patch b/queue-4.19/revert-net-ethernet-stmmac-fix-altr_tse_pcs-function-when-using-a-fixed-link.patch new file mode 100644 index 00000000000..354bdce5ba7 --- /dev/null +++ b/queue-4.19/revert-net-ethernet-stmmac-fix-altr_tse_pcs-function-when-using-a-fixed-link.patch @@ -0,0 +1,103 @@ +From 13f647dd4eac2f063bc08c6aa03701fe7f4bce96 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Fri, 29 Apr 2022 11:19:38 +0200 +Subject: Revert "net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link" + +This reverts commit e2423aa174e6c3e9805e96db778245ba73cdd88c which is +commit a6aaa00324240967272b451bfa772547bd576ee6 upstream. + +Pavel reports that it causes boot issues, so revert it for now. + +Link: https://lore.kernel.org/r/20220429074341.GB1423@amd +Reported-by: Pavel Machek +Cc: Dinh Nguyen +Cc: David S. Miller +Cc: Sasha Levin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c | 8 ++++++++ + drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h | 4 ---- + drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 13 ++++++++----- + 3 files changed, 16 insertions(+), 9 deletions(-) + +--- a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c ++++ b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c +@@ -68,6 +68,10 @@ + #define TSE_PCS_USE_SGMII_ENA BIT(0) + #define TSE_PCS_IF_USE_SGMII 0x03 + ++#define SGMII_ADAPTER_CTRL_REG 0x00 ++#define SGMII_ADAPTER_DISABLE 0x0001 ++#define SGMII_ADAPTER_ENABLE 0x0000 ++ + #define AUTONEGO_LINK_TIMER 20 + + static int tse_pcs_reset(void __iomem *base, struct tse_pcs *pcs) +@@ -209,8 +213,12 @@ void tse_pcs_fix_mac_speed(struct tse_pc + unsigned int speed) + { + void __iomem *tse_pcs_base = pcs->tse_pcs_base; ++ void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base; + u32 val; + ++ writew(SGMII_ADAPTER_ENABLE, ++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); ++ + pcs->autoneg = phy_dev->autoneg; + + if (phy_dev->autoneg == AUTONEG_ENABLE) { +--- a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h ++++ b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h +@@ -21,10 +21,6 @@ + #include + #include + +-#define SGMII_ADAPTER_CTRL_REG 0x00 +-#define SGMII_ADAPTER_ENABLE 0x0000 +-#define SGMII_ADAPTER_DISABLE 0x0001 +- + struct tse_pcs { + struct device *dev; + void __iomem *tse_pcs_base; +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +@@ -29,6 +29,9 @@ + + #include "altr_tse_pcs.h" + ++#define SGMII_ADAPTER_CTRL_REG 0x00 ++#define SGMII_ADAPTER_DISABLE 0x0001 ++ + #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0 + #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1 + #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII 0x2 +@@ -62,14 +65,16 @@ static void socfpga_dwmac_fix_mac_speed( + { + struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv; + void __iomem *splitter_base = dwmac->splitter_base; ++ void __iomem *tse_pcs_base = dwmac->pcs.tse_pcs_base; + void __iomem *sgmii_adapter_base = dwmac->pcs.sgmii_adapter_base; + struct device *dev = dwmac->dev; + struct net_device *ndev = dev_get_drvdata(dev); + struct phy_device *phy_dev = ndev->phydev; + u32 val; + +- writew(SGMII_ADAPTER_DISABLE, +- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); ++ if ((tse_pcs_base) && (sgmii_adapter_base)) ++ writew(SGMII_ADAPTER_DISABLE, ++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); + + if (splitter_base) { + val = readl(splitter_base + EMAC_SPLITTER_CTRL_REG); +@@ -91,9 +96,7 @@ static void socfpga_dwmac_fix_mac_speed( + writel(val, splitter_base + EMAC_SPLITTER_CTRL_REG); + } + +- writew(SGMII_ADAPTER_ENABLE, +- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); +- if (phy_dev) ++ if (tse_pcs_base && sgmii_adapter_base) + tse_pcs_fix_mac_speed(&dwmac->pcs, phy_dev, speed); + } + diff --git a/queue-4.19/series b/queue-4.19/series index 27a74d0b177..6e59893acc7 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -8,3 +8,4 @@ powerpc-64s-unmerge-ex_lr-and-ex_dar.patch revert-ia64-kprobes-fix-to-pass-correct-trampoline-address-to-the-handler.patch revert-ia64-kprobes-use-generic-kretprobe-trampoline-handler.patch ia64-kprobes-fix-to-pass-correct-trampoline-address-to-the-handler.patch +revert-net-ethernet-stmmac-fix-altr_tse_pcs-function-when-using-a-fixed-link.patch