lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191005114634.wvv4yfdte7qchzxs@verge.net.au>
Date:   Sat, 5 Oct 2019 13:46:34 +0200
From:   Simon Horman <horms@...ge.net.au>
To:     Kai-Heng Feng <kai.heng.feng@...onical.com>
Cc:     davem@...emloft.net, hayeswang@...ltek.com,
        mario.limonciello@...l.com, linux-usb@...r.kernel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] r8152: Set macpassthru in reset_resume callback

On Fri, Oct 04, 2019 at 08:51:04PM +0800, Kai-Heng Feng wrote:
> 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.

This is two separate seemingly unrelated, other than locality in the code,
changes. One is a fix, the other seems to be a cleanup. Perhaps they would
be better addressed in separate patches.

> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
> ---
>  drivers/net/usb/r8152.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 08726090570e..cee9fef925cd 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -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);
>  }
>  
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ