From: <nicolas.ferre@microchip.com>
To: <linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
"Claudiu Beznea" <claudiu.beznea@microchip.com>,
<harini.katakam@xilinx.com>
Cc: <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
<rafalo@cadence.com>, <sergio.prado@e-labworks.com>,
<antoine.tenart@bootlin.com>, <f.fainelli@gmail.com>,
<linux@armlinux.org.uk>, <andrew@lunn.ch>,
<michal.simek@xilinx.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>
Subject: [RFC PATCH 2/3] net: macb: mark device wake capable when "magic-packet" property present
Date: Fri, 3 Apr 2020 15:14:43 +0200 [thread overview]
Message-ID: <21cbef3db93cb61c6b8f7093164005d0f452db02.1585917191.git.nicolas.ferre@microchip.com> (raw)
In-Reply-To: <cover.1585917191.git.nicolas.ferre@microchip.com>
From: Nicolas Ferre <nicolas.ferre@microchip.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@microchip.com>
Cc: Harini Katakam <harini.katakam@xilinx.com>
Cc: Rafal Ozieblo <rafalo@cadence.com>
Cc: Sergio Prado <sergio.prado@e-labworks.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.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 d1b4d6b6d7c8..629660d9f17e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4384,7 +4384,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.20.1
next prev parent reply other threads:[~2020-04-03 13:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 13:14 [RFC PATCH 0/3] net: macb: Wake-on-Lan magic packet fixes nicolas.ferre
2020-04-03 13:14 ` [RFC PATCH 1/3] net: macb: fix wakeup test in runtime suspend/resume routines nicolas.ferre
2020-04-03 13:14 ` nicolas.ferre [this message]
2020-04-03 13:14 ` [RFC PATCH 3/3] net: macb: fix macb_get/set_wol() when moving to phylink nicolas.ferre
2020-04-03 13:36 ` [RFC PATCH 0/3] net: macb: Wake-on-Lan magic packet fixes Harini Katakam
2020-04-06 14:25 ` Nicolas Ferre
2020-04-06 14:52 ` Harini Katakam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21cbef3db93cb61c6b8f7093164005d0f452db02.1585917191.git.nicolas.ferre@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=harini.katakam@xilinx.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=rafalo@cadence.com \
--cc=sergio.prado@e-labworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).