devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: axiemac: add PM callbacks to support suspend/resume
@ 2022-11-01  1:11 Andy Chiu
  2022-11-03 16:06 ` Krzysztof Kozlowski
  2022-11-07  8:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Chiu @ 2022-11-01  1:11 UTC (permalink / raw)
  To: davem, kuba, michal.simek, radhey.shyam.pandey
  Cc: netdev, devicetree, linux-arm-kernel, krzysztof.kozlowski+dt,
	robh+dt, pabeni, edumazet, andy.chiu, greentime.hu

Support basic system-wide suspend and resume functions

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
---
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 441e1058104f..d082f2b10f4d 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -2217,12 +2217,48 @@ static void axienet_shutdown(struct platform_device *pdev)
 	rtnl_unlock();
 }
 
+static int axienet_suspend(struct device *dev)
+{
+	struct net_device *ndev = dev_get_drvdata(dev);
+
+	if (!netif_running(ndev))
+		return 0;
+
+	netif_device_detach(ndev);
+
+	rtnl_lock();
+	axienet_stop(ndev);
+	rtnl_unlock();
+
+	return 0;
+}
+
+static int axienet_resume(struct device *dev)
+{
+	struct net_device *ndev = dev_get_drvdata(dev);
+
+	if (!netif_running(ndev))
+		return 0;
+
+	rtnl_lock();
+	axienet_open(ndev);
+	rtnl_unlock();
+
+	netif_device_attach(ndev);
+
+	return 0;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(axienet_pm_ops,
+				axienet_suspend, axienet_resume);
+
 static struct platform_driver axienet_driver = {
 	.probe = axienet_probe,
 	.remove = axienet_remove,
 	.shutdown = axienet_shutdown,
 	.driver = {
 		 .name = "xilinx_axienet",
+		 .pm = &axienet_pm_ops,
 		 .of_match_table = axienet_of_match,
 	},
 };
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: axiemac: add PM callbacks to support suspend/resume
  2022-11-01  1:11 [PATCH net-next] net: axiemac: add PM callbacks to support suspend/resume Andy Chiu
@ 2022-11-03 16:06 ` Krzysztof Kozlowski
  2022-11-07  8:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-03 16:06 UTC (permalink / raw)
  To: Andy Chiu, davem, kuba, michal.simek, radhey.shyam.pandey
  Cc: netdev, devicetree, linux-arm-kernel, krzysztof.kozlowski+dt,
	robh+dt, pabeni, edumazet, greentime.hu

On 31/10/2022 21:11, Andy Chiu wrote:
> Support basic system-wide suspend and resume functions
> 
> Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
> ---
>  .../net/ethernet/xilinx/xilinx_axienet_main.c | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 

Why Ccing us?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: axiemac: add PM callbacks to support suspend/resume
  2022-11-01  1:11 [PATCH net-next] net: axiemac: add PM callbacks to support suspend/resume Andy Chiu
  2022-11-03 16:06 ` Krzysztof Kozlowski
@ 2022-11-07  8:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-07  8:50 UTC (permalink / raw)
  To: Andy Chiu
  Cc: davem, kuba, michal.simek, radhey.shyam.pandey, netdev,
	devicetree, linux-arm-kernel, krzysztof.kozlowski+dt, robh+dt,
	pabeni, edumazet, greentime.hu

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue,  1 Nov 2022 09:11:39 +0800 you wrote:
> Support basic system-wide suspend and resume functions
> 
> Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
> ---
>  .../net/ethernet/xilinx/xilinx_axienet_main.c | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)

Here is the summary with links:
  - [net-next] net: axiemac: add PM callbacks to support suspend/resume
    https://git.kernel.org/netdev/net-next/c/a3de357b087e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-07  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01  1:11 [PATCH net-next] net: axiemac: add PM callbacks to support suspend/resume Andy Chiu
2022-11-03 16:06 ` Krzysztof Kozlowski
2022-11-07  8:50 ` patchwork-bot+netdevbpf

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).