]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
r8152: Set macpassthru in reset_resume callback
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Mon, 7 Oct 2019 10:45:00 +0000 (12:45 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 16 Oct 2019 16:13:47 +0000 (18:13 +0200)
BugLink: https://bugs.launchpad.net/bugs/1847063
r8152 may fail to establish network connection after resume from system
suspend.

If the USB port connects to r8152 lost its power during system suspend,
the MAC address was written before is lost. The reason is that The MAC
address doesn't get written again in its reset_resume callback.

So let's set MAC address again in reset_resume callback. Also remove
unnecessary lock as no other locking attempt will happen during
reset_resume.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a54cdeeb04fc719e4c7f19d6e28dba7ea86cee5b)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: You-Sheng Yang <vicamo.yang@canonical.com>
Acked-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/usb/r8152.c

index 566555cb12dc237cf2d5082e046e0196f0a108c1..65213ecad39e6b023e5d30b287013beb2253df79 100644 (file)
@@ -4503,10 +4503,9 @@ static int rtl8152_reset_resume(struct usb_interface *intf)
        struct r8152 *tp = usb_get_intfdata(intf);
 
        clear_bit(SELECTIVE_SUSPEND, &tp->flags);
-       mutex_lock(&tp->control);
        tp->rtl_ops.init(tp);
        queue_delayed_work(system_long_wq, &tp->hw_phy_work, 0);
-       mutex_unlock(&tp->control);
+       set_ethernet_addr(tp);
        return rtl8152_resume(intf);
 }