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]
Date:   Mon, 8 May 2023 21:23:13 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     netdev@...r.kernel.org, Doug Berger <opendmb@...il.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>,
        Marek BehĂșn <kabel@...nel.org>,
        Peter Geis <pgwipeout@...il.com>,
        Frank <Frank.Sae@...or-comm.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next 2/3] net: phy: broadcom: Add support for
 Wake-on-LAN

On Mon, May 08, 2023 at 11:43:08AM -0700, Florian Fainelli wrote:
> Add support for WAKE_UCAST, WAKE_MCAST, WAKE_BCAST, WAKE_MAGIC and
> WAKE_MAGICSECURE. This is only supported with the BCM54210E and
> compatible Ethernet PHYs. Using the in-band interrupt or an out of band
> GPIO interrupts are supported.
> 
> Broadcom PHYs will generate a Wake-on-LAN level low interrupt on LED4 as
> soon as one of the supported patterns is being matched. That includes
> generating such an interrupt even if the PHY is operated during normal
> modes. If WAKE_UCAST is selected, this could lead to the LED4 interrupt
> firing up for every packet being received which is absolutely
> undesirable from a performance point of view.
> 
> Because the Wake-on-LAN configuration can be set long before the system
> is actually put to sleep, we cannot have an interrupt service routine to
> clear on read the interrupt status register and ensure that new packet
> matches will be detected.
> 
> It is desirable to enable the Wake-on-LAN interrupt as late as possible
> during the system suspend process such that we limit the number of
> interrupts to be handled by the system, but also conversely feed into
> the Linux's system suspend way of dealing with interrupts in and around
> the points of no return.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>

...

> @@ -437,14 +460,38 @@ static int bcm54xx_iddq_set(struct phy_device *phydev, bool enable)
>  	return ret;
>  }
>  
> -static int bcm54xx_suspend(struct phy_device *phydev)
> +static int bcm54xx_set_wakeup_irq(struct phy_device *phydev, bool state)
>  {
> +	struct bcm54xx_phy_priv *priv = phydev->priv;
>  	int ret;
>  
> +	if (!bcm54xx_phy_can_wakeup(phydev))
> +		return 0;
> +
> +	if (priv->wake_irq_enabled != state) {
> +		if (state)
> +			ret = enable_irq_wake(priv->wake_irq);
> +		else
> +			ret = disable_irq_wake(priv->wake_irq);
> +		priv->wake_irq_enabled = state;
> +	}

Hi Florian,

If priv->wake_irq_enabled == state the ret is uninitialised here.

> +
> +	return ret;
> +}

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ