Patch "net: micrel: Fix lan8841_config_intr after getting out of sleep mode" has been added to the 6.9-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: micrel: Fix lan8841_config_intr after getting out of sleep mode

to the 6.9-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-micrel-fix-lan8841_config_intr-after-getting-out.patch
and it can be found in the queue-6.9 subdirectory.

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



commit f6e6aaa617c2f8a51f5ade9b8d29381851563fc9
Author: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>
Date:   Fri May 24 10:53:50 2024 +0200

    net: micrel: Fix lan8841_config_intr after getting out of sleep mode
    
    [ Upstream commit 4fb679040d9f758eeb3b4d01bbde6405bf20e64e ]
    
    When the interrupt is enabled, the function lan8841_config_intr tries to
    clear any pending interrupts by reading the interrupt status, then
    checks the return value for errors and then continue to enable the
    interrupt. It has been seen that once the system gets out of sleep mode,
    the interrupt status has the value 0x400 meaning that the PHY detected
    that the link was in low power. That is correct value but the problem is
    that the check is wrong.  We try to check for errors but we return an
    error also in this case which is not an error. Therefore fix this by
    returning only when there is an error.
    
    Fixes: a8f1a19d27ef ("net: micrel: Add support for lan8841 PHY")
    Signed-off-by: Horatiu Vultur <horatiu.vultur@xxxxxxxxxxxxx>
    Reviewed-by: Suman Ghosh <sumang@xxxxxxxxxxx>
    Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
    Reviewed-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240524085350.359812-1-horatiu.vultur@xxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 18dee364e2b31..13370439a7cae 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -3516,7 +3516,7 @@ static int lan8841_config_intr(struct phy_device *phydev)
 
 	if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
 		err = phy_read(phydev, LAN8814_INTS);
-		if (err)
+		if (err < 0)
 			return err;
 
 		/* Enable / disable interrupts. It is OK to enable PTP interrupt
@@ -3532,6 +3532,14 @@ static int lan8841_config_intr(struct phy_device *phydev)
 			return err;
 
 		err = phy_read(phydev, LAN8814_INTS);
+		if (err < 0)
+			return err;
+
+		/* Getting a positive value doesn't mean that is an error, it
+		 * just indicates what was the status. Therefore make sure to
+		 * clear the value and say that there is no error.
+		 */
+		err = 0;
 	}
 
 	return err;




[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