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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 9 Sep 2020 10:43:49 +0200
From:   Marco Felsch <m.felsch@...gutronix.de>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     davem@...emloft.net, kuba@...nel.org, robh+dt@...nel.org,
        andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
        zhengdejin5@...il.com, richard.leitner@...data.com,
        netdev@...r.kernel.org, kernel@...gutronix.de,
        devicetree@...r.kernel.org
Subject: Re: [PATCH v2 1/5] net: phy: smsc: skip ENERGYON interrupt if
 disabled

On 20-09-08 18:58, Florian Fainelli wrote:
> 
> 
> On 9/8/2020 4:25 AM, Marco Felsch wrote:
> > Don't enable the interrupt if the platform disable the energy detection
> > by "smsc,disable-energy-detect".
> > 
> > Signed-off-by: Marco Felsch <m.felsch@...gutronix.de>
> > Reviewed-by: Andrew Lunn <andrew@...n.ch>
> > ---
> > v2:
> > - Add Andrew's tag
> > 
> >   drivers/net/phy/smsc.c | 15 +++++++++++----
> >   1 file changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
> > index 74568ae16125..fa539a867de6 100644
> > --- a/drivers/net/phy/smsc.c
> > +++ b/drivers/net/phy/smsc.c
> > @@ -37,10 +37,17 @@ struct smsc_phy_priv {
> >   static int smsc_phy_config_intr(struct phy_device *phydev)
> >   {
> > -	int rc = phy_write (phydev, MII_LAN83C185_IM,
> > -			((PHY_INTERRUPT_ENABLED == phydev->interrupts)
> > -			? MII_LAN83C185_ISF_INT_PHYLIB_EVENTS
> > -			: 0));
> > +	struct smsc_phy_priv *priv = phydev->priv;
> > +	u16 intmask = 0;
> > +	int rc;
> > +
> > +	if (phydev->interrupts) {
> 
> Not that it changes the code functionally, but it would be nice to preserve
> the phydev->interrupts == PHY_INTERRUPT_ENABLED.

Okay, I will apply this and add your reviewed-by tag.

Thanks,
  Marco

> 
> > +		intmask = MII_LAN83C185_ISF_INT4 | MII_LAN83C185_ISF_INT6;
> > +		if (priv->energy_enable)
> > +			intmask |= MII_LAN83C185_ISF_INT7;
> > +	}
> 
> Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
> -- 
> Florian
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists