Skip to content

Commit

Permalink
r8152: Set macpassthru in reset_resume callback
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
khfeng authored and davem330 committed Oct 5, 2019
1 parent 6b51737 commit a54cdee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -4799,10 +4799,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);
}

Expand Down

0 comments on commit a54cdee

Please sign in to comment.