OSDN Git Service

net: macb: Add support for suspend/resume with full power down
authorHarini Katakam <harini.katakam@xilinx.com>
Fri, 1 Mar 2019 10:50:35 +0000 (16:20 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Mar 2019 21:51:37 +0000 (13:51 -0800)
commitde991c58b3761e4ddb8eeb204987155111332f59
treef925873ff7ee703d226b05bb88642a4ad8057fca
parentd54f89af6cc4d6dd6a0bec2e21e1bafa8bd27c8e
net: macb: Add support for suspend/resume with full power down

When macb device is suspended and system is powered down, the clocks
are removed and hence macb should be closed gracefully and restored
upon resume. This patch does the same by switching off the net device,
suspending phy and performing necessary cleanup of interrupts and BDs.
Upon resume, all these are reinitialized again.

Reset of macb device is done only when GEM is not a wake device.
Even when gem is a wake device, tx queues can be stopped and ptp device
can be closed (tsu clock will be disabled in pm_runtime_suspend) as
wake event detection has no dependency on this.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Harini Katakam <harini.katakam@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c