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: <b0e3fcc43bc7284598341c27840bc7947adf01b0.1594384335.git.nicolas.ferre@microchip.com>
Date:   Fri, 10 Jul 2020 14:46:42 +0200
From:   <nicolas.ferre@...rochip.com>
To:     <linux@...linux.org.uk>, <linux-arm-kernel@...ts.infradead.org>,
        <netdev@...r.kernel.org>,
        Claudiu Beznea <claudiu.beznea@...rochip.com>,
        <harini.katakam@...inx.com>, <f.fainelli@...il.com>
CC:     <linux-kernel@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        <antoine.tenart@...tlin.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Sergio Prado <sergio.prado@...abworks.com>
Subject: [PATCH v5 2/5] net: macb: mark device wake capable when "magic-packet" property present

From: Nicolas Ferre <nicolas.ferre@...rochip.com>

Change the way the "magic-packet" DT property is handled in the
macb_probe() function, matching DT binding documentation.
Now we mark the device as "wakeup capable" instead of calling the
device_init_wakeup() function that would enable the wakeup source.

For Ethernet WoL, enabling the wakeup_source is done by
using ethtool and associated macb_set_wol() function that
already calls device_set_wakeup_enable() for this purpose.

That would reduce power consumption by cutting more clocks if
"magic-packet" property is set but WoL is not configured by ethtool.

Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet")
Cc: Claudiu Beznea <claudiu.beznea@...rochip.com>
Cc: Harini Katakam <harini.katakam@...inx.com>
Cc: Sergio Prado <sergio.prado@...abworks.com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@...rochip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 55e680f35022..4cafe343c0a2 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4422,7 +4422,7 @@ static int macb_probe(struct platform_device *pdev)
 	bp->wol = 0;
 	if (of_get_property(np, "magic-packet", NULL))
 		bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
-	device_init_wakeup(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
+	device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
 
 	spin_lock_init(&bp->lock);
 
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ