Patch "net: lan78xx: fix runtime PM count underflow on link stop" has been added to the 6.6-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: lan78xx: fix runtime PM count underflow on link stop

to the 6.6-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-lan78xx-fix-runtime-pm-count-underflow-on-link-s.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 4e91f50ff1aff5c2af6602e30edd07d04f463e08
Author: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Date:   Wed Feb 28 13:45:17 2024 +0100

    net: lan78xx: fix runtime PM count underflow on link stop
    
    [ Upstream commit 1eecc7ab82c42133b748e1895275942a054a7f67 ]
    
    Current driver has some asymmetry in the runtime PM calls. On lan78xx_open()
    it will call usb_autopm_get() and unconditionally usb_autopm_put(). And
    on lan78xx_stop() it will call only usb_autopm_put(). So far, it was
    working only because this driver do not activate autosuspend by default,
    so it was visible only by warning "Runtime PM usage count underflow!".
    
    Since, with current driver, we can't use runtime PM with active link,
    execute lan78xx_open()->usb_autopm_put() only in error case. Otherwise,
    keep ref counting high as long as interface is open.
    
    Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
    Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
    Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 8b1e1e1c8d5be..921ae046f8604 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3137,7 +3137,8 @@ static int lan78xx_open(struct net_device *net)
 done:
 	mutex_unlock(&dev->dev_mutex);
 
-	usb_autopm_put_interface(dev->intf);
+	if (ret < 0)
+		usb_autopm_put_interface(dev->intf);
 
 	return ret;
 }




[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