lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: stmmac: linkup phy after enabled mac when system resume
On Wed, Oct 19, 2022 at 08:36:43PM +0800, Clark Wang wrote:
> + mutex_unlock(&priv->lock);
> + if (device_may_wakeup(priv->device) && priv->plat->pmt) {
> + phylink_resume(priv->phylink);
> + } else {
> + phylink_resume(priv->phylink);
> + if (device_may_wakeup(priv->device))
> + phylink_speed_up(priv->phylink);
> + }
> + mutex_lock(&priv->lock);

First, is there a reason this isn't coded as:

mutex_unlock(&priv->lock);
phylink_resume(priv->phylink);

if (!priv->plat->pmt && device_may_wakeup(priv->device))
phylink_speed_up(priv->phylink);

mutex_lock(&priv->lock);

And secondly, is it really safe to drop this lock? What specifically
is the lock protecting? I see this isn't documented in the driver...

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

\
 
 \ /
  Last update: 2022-10-19 15:08    [W:0.036 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site