From fbb68277a9c2c5fe38a4f6d29cb9537395f48c1c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 30 Nov 2023 13:36:37 +0000 Subject: [PATCH] 6.1-stable patches added patches: arm64-dts-imx8mn-var-som-add-20ms-delay-to-ethernet-regulator-enable.patch --- ...s-delay-to-ethernet-regulator-enable.patch | 59 +++++++++++++++++++ queue-6.1/series | 1 + 2 files changed, 60 insertions(+) create mode 100644 queue-6.1/arm64-dts-imx8mn-var-som-add-20ms-delay-to-ethernet-regulator-enable.patch diff --git a/queue-6.1/arm64-dts-imx8mn-var-som-add-20ms-delay-to-ethernet-regulator-enable.patch b/queue-6.1/arm64-dts-imx8mn-var-som-add-20ms-delay-to-ethernet-regulator-enable.patch new file mode 100644 index 00000000000..a6f1f8aaed6 --- /dev/null +++ b/queue-6.1/arm64-dts-imx8mn-var-som-add-20ms-delay-to-ethernet-regulator-enable.patch @@ -0,0 +1,59 @@ +From 26ca44bdbd13edbe6cbe0dc63327c3316ce01bae Mon Sep 17 00:00:00 2001 +From: Hugo Villeneuve +Date: Mon, 29 May 2023 15:33:12 -0400 +Subject: arm64: dts: imx8mn-var-som: add 20ms delay to ethernet regulator enable + +From: Hugo Villeneuve + +commit 26ca44bdbd13edbe6cbe0dc63327c3316ce01bae upstream. + +This commit is taken from Variscite linux kernel public git repository. +Original patch author: Nate Drude +See: https://github.com/varigit/linux-imx/blob/5.15-2.0.x-imx_var01/drivers/net/ethernet/freescale/fec_main.c#L3993-L4050 + +The ethernet phy reset was moved from the fec controller to the +mdio bus, see for example: 0e825b32c033e1998d0ebaf247f5dab3c340e3bf + +When the fec driver managed the reset, the regulator had time to +settle during the fec phy reset before calling of_mdiobus_register, +which probes the mii bus for the phy id to match the correct driver. + +Now that the mdio bus controls the reset, the fec driver no longer has +any delay between enabling the regulator and calling of_mdiobus_register. +If the regulator voltage has not settled, the phy id will not be read +correctly and the generic phy driver will be used. + +The following call tree explains in more detail: + +fec_probe + fec_reset_phy <- no longer introduces delay after migration to mdio reset + fec_enet_mii_init + of_mdiobus_register + of_mdiobus_register_phy + fwnode_mdiobus_register_phy + get_phy_device <- mii probe for phy id to match driver happens here + ... + fwnode_mdiobus_phy_device_register + phy_device_register + mdiobus_register_device + mdio_device_reset <- mdio reset assert / deassert delay happens here + +Add a 20ms enable delay to the regulator to fix the issue. + +Signed-off-by: Hugo Villeneuve +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi +@@ -27,6 +27,7 @@ + regulator-name = "eth_phy_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; ++ regulator-enable-ramp-delay = <20000>; + gpio = <&gpio2 9 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; diff --git a/queue-6.1/series b/queue-6.1/series index 870e068734e..956130a0411 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -52,3 +52,4 @@ ext4-fix-slab-use-after-free-in-ext4_es_insert_exten.patch ext4-make-sure-allocate-pending-entry-not-fail.patch nfsd-fix-start-of-nfs-reply-pointer-passed-to-nfsd_cache_update.patch nfsd-fix-checksum-mismatches-in-the-duplicate-reply-cache.patch +arm64-dts-imx8mn-var-som-add-20ms-delay-to-ethernet-regulator-enable.patch -- 2.47.3