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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Jan 2021 21:50:09 +0100
From:   Niklas Söderlund 
        <niklas.soderlund@...natech.se>
To:     Geert Uytterhoeven <geert+renesas@...der.be>
Cc:     Sergei Shtylyov <sergei.shtylyov@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Simon Horman <horms+renesas@...ge.net.au>,
        netdev@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sh_eth: Fix power down vs. is_opened flag ordering

Hi Geert,

Thanks for your work.

On 2021-01-18 16:08:12 +0100, Geert Uytterhoeven wrote:
> sh_eth_close() does a synchronous power down of the device before
> marking it closed.  Revert the order, to make sure the device is never
> marked opened while suspended.
> 
> While at it, use pm_runtime_put() instead of pm_runtime_put_sync(), as
> there is no reason to do a synchronous power down.
> 
> Fixes: 7fa2955ff70ce453 ("sh_eth: Fix sleeping function called from invalid context")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>

> ---
>  drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 9b52d350e21a9f2b..590b088bc4c7f3e2 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> @@ -2606,10 +2606,10 @@ static int sh_eth_close(struct net_device *ndev)
>  	/* Free all the skbuffs in the Rx queue and the DMA buffer. */
>  	sh_eth_ring_free(ndev);
>  
> -	pm_runtime_put_sync(&mdp->pdev->dev);
> -
>  	mdp->is_opened = 0;
>  
> +	pm_runtime_put(&mdp->pdev->dev);
> +
>  	return 0;
>  }
>  
> -- 
> 2.25.1
> 

-- 
Regards,
Niklas Söderlund

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ