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: <CALeDE9OjSAV0Mas7NPJfFQ5SW6ZJV8HgyvZyVnE_LZK2tkPOmQ@mail.gmail.com>
Date:   Thu, 10 Mar 2022 17:30:31 +0000
From:   Peter Robinson <pbrobinson@...il.com>
To:     Jeremy Linton <jeremy.linton@....com>
Cc:     netdev@...r.kernel.org, opendmb@...il.com, f.fainelli@...il.com,
        davem@...emloft.net, kuba@...nel.org,
        bcm-kernel-feedback-list@...adcom.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: bcmgenet: Don't claim WOL when its not available

On Thu, Mar 10, 2022 at 4:55 AM Jeremy Linton <jeremy.linton@....com> wrote:
>
> Some of the bcmgenet platforms don't correctly support WOL, yet
> ethtool returns:
>
> "Supports Wake-on: gsf"
>
> which is false.
>
> Ideally if there isn't a wol_irq, or there is something else that
> keeps the device from being able to wakeup it should display:
>
> "Supports Wake-on: d"
>
> This patch checks whether the device can wakup, before using the
> hard-coded supported flags. This corrects the ethtool reporting, as
> well as the WOL configuration because ethtool verifies that the mode
> is supported before attempting it.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@....com>
Tested-by: Peter Robinson <pbrobinson@...il.com>

This fixes the reporting of the WOL capabilities on the Raspberry Pi 4.

> ---
>  drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> index e31a5a397f11..f55d9d9c01a8 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
> @@ -40,6 +40,13 @@
>  void bcmgenet_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
>  {
>         struct bcmgenet_priv *priv = netdev_priv(dev);
> +       struct device *kdev = &priv->pdev->dev;
> +
> +       if (!device_can_wakeup(kdev)) {
> +               wol->supported = 0;
> +               wol->wolopts = 0;
> +               return;
> +       }
>
>         wol->supported = WAKE_MAGIC | WAKE_MAGICSECURE | WAKE_FILTER;
>         wol->wolopts = priv->wolopts;
> --
> 2.35.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ