This is a note to let you know that I've just added the patch titled net: phy: marvell: add sleep time after enabling the loopback bit to the 5.15-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-phy-marvell-add-sleep-time-after-enabling-the-loopback-bit.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 18c532e44939caa17f1fa380f7ac50dbc0718dbb Mon Sep 17 00:00:00 2001 From: Aminuddin Jamaluddin <aminuddin.jamaluddin@xxxxxxxxx> Date: Mon, 14 Nov 2022 14:53:02 +0800 Subject: net: phy: marvell: add sleep time after enabling the loopback bit From: Aminuddin Jamaluddin <aminuddin.jamaluddin@xxxxxxxxx> commit 18c532e44939caa17f1fa380f7ac50dbc0718dbb upstream. Sleep time is added to ensure the phy to be ready after loopback bit was set. This to prevent the phy loopback test from failing. Fixes: 020a45aff119 ("net: phy: marvell: add Marvell specific PHY loopback") Cc: <stable@xxxxxxxxxxxxxxx> # 5.15.x Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@xxxxxxxxx> Signed-off-by: Aminuddin Jamaluddin <aminuddin.jamaluddin@xxxxxxxxx> Link: https://lore.kernel.org/r/20221114065302.10625-1-aminuddin.jamaluddin@xxxxxxxxx Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/phy/marvell.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1976,14 +1976,16 @@ static int m88e1510_loopback(struct phy_ if (err < 0) return err; - /* FIXME: Based on trial and error test, it seem 1G need to have - * delay between soft reset and loopback enablement. - */ - if (phydev->speed == SPEED_1000) - msleep(1000); + err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, + BMCR_LOOPBACK); - return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, - BMCR_LOOPBACK); + if (!err) { + /* It takes some time for PHY device to switch + * into/out-of loopback mode. + */ + msleep(1000); + } + return err; } else { err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0); if (err < 0) Patches currently in stable-queue which might be from aminuddin.jamaluddin@xxxxxxxxx are queue-5.15/net-phy-marvell-add-sleep-time-after-enabling-the-loopback-bit.patch