Skip to contentSkip to conversation

net: phy: add shutdown hook to struct phy_driver

RFC Jisheng Zhang 4 participants 11 messages Sep 30, 2020 – Oct 6, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

Thanks in advance,
Jisheng

#1 lore raw
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

Andrew

#2 lore raw
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Signature · 1 line
Florian
#3 lore raw
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

Andrew

#4 lore raw
Quoted 36 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Quoted 7 lines

Hi Florian

I could be missing something here, but:

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit every driver that defines both .suspend and .set_wol but there are not that many.

Adding an additional callback to the PHY driver does not really scale and it would require us to be extra careful and also plumb the MDIO bus shutdown.

Signature · 1 line
Florian
#5 lore raw
Quoted 42 lines · On Wed, 30 Sep 2020 13:23:29 -0700 Florian Fainelli wrote:
Quoted 40 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

Quoted 7 lines
Quoted 3 lines

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit

Hi all,

The PHY's suspend callback usually calls genphy_suspend() which will set BMCR_PDOWN bit, this may break WoL. I think this is one the reason why we ignore the phydrv->suspend() when WoL is enabled. If we goes to this directly, it looks like we need to change each phy's suspend implementation, I.E if WoL is enabled, ignore genphy_suspend() and do possible isolation; If WoL is disabled, keep the code path as is.

So compared with the shutdown hook, which direction is better?

Thanks in advance,
Jisheng

Quoted 8 lines

every driver that defines both .suspend and .set_wol but there are not that many.

Adding an additional callback to the PHY driver does not really scale and it would require us to be extra careful and also plumb the MDIO bus shutdown.
--
Florian

#6 lore raw
Quoted 55 lines · Jisheng Zhang
Quoted 42 lines · On Wed, 30 Sep 2020 13:23:29 -0700 Florian Fainelli wrote:
Quoted 40 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

Quoted 7 lines
Quoted 3 lines

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit

Hi all,

Quoted 8 lines

The PHY's suspend callback usually calls genphy_suspend() which will set BMCR_PDOWN bit, this may break WoL. I think this is one the reason why we ignore the phydrv->suspend() when WoL is enabled. If we goes to this directly, it looks like we need to change each phy's suspend implementation, I.E if WoL is enabled, ignore genphy_suspend() and do possible isolation; If WoL is disabled, keep the code path as is.

So compared with the shutdown hook, which direction is better?

I believe you will have an easier time to add an argument to the PHY driver suspend's function to indicate the WoL status, or to move down the check for WoL being enabled/supported compared to adding support for shutdown into the MDIO bus layer, and then PHY drivers.

Signature · 1 line
Florian
#7 lore raw
Quoted 65 lines · Florian Fainelli
Quoted 62 lines · Jisheng Zhang
Quoted 42 lines · On Wed, 30 Sep 2020 13:23:29 -0700 Florian Fainelli wrote:
Quoted 40 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 9 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable.  But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

Quoted 7 lines
Quoted 3 lines

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit

Hi all,

The PHY's suspend callback usually calls genphy_suspend() which will set BMCR_PDOWN bit, this may break WoL. I think this is one the reason why we ignore the phydrv->suspend() when WoL is enabled. If we goes to this directly, it looks like we need to change each phy's suspend implementation, I.E if WoL is enabled, ignore genphy_suspend() and do possible isolation; If WoL is disabled, keep the code path as is.

Quoted 3 lines
Quoted 1 line

So compared with the shutdown hook, which direction is better?

I believe you will have an easier time to add an argument to the PHY driver suspend's function to indicate the WoL status, or to move down the check for WoL being enabled/supported compared to adding support for shutdown into the MDIO bus layer, and then PHY drivers.

Maybe the shutdown callback of mdio_bus_type could be implemented. It could iterate over all PHY's on the bus, check for WoL (similar to mdio_bus_phy_may_suspend) and do whatever is needed.
Seems to me to be the most generic way.

#8 lore raw
Quoted 66 lines · Heiner Kallweit
Quoted 65 lines · Florian Fainelli
Quoted 62 lines · Jisheng Zhang
Quoted 42 lines · On Wed, 30 Sep 2020 13:23:29 -0700 Florian Fainelli wrote:
Quoted 40 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable.  But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

Quoted 7 lines
Quoted 3 lines

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit

Hi all,

The PHY's suspend callback usually calls genphy_suspend() which will set BMCR_PDOWN bit, this may break WoL. I think this is one the reason why we ignore the phydrv->suspend() when WoL is enabled. If we goes to this directly, it looks like we need to change each phy's suspend implementation, I.E if WoL is enabled, ignore genphy_suspend() and do possible isolation; If WoL is disabled, keep the code path as is.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

So compared with the shutdown hook, which direction is better?

I believe you will have an easier time to add an argument to the PHY driver suspend's function to indicate the WoL status, or to move down the check for WoL being enabled/supported compared to adding support for shutdown into the MDIO bus layer, and then PHY drivers.

Maybe the shutdown callback of mdio_bus_type could be implemented. It could iterate over all PHY's on the bus, check for WoL (similar to mdio_bus_phy_may_suspend) and do whatever is needed.
Seems to me to be the most generic way.

OK and we optionally call into a PHY device's shutdown function if defined so it can perform PHY specific work? That would work for me.

Signature · 1 line
Florian
#9 lore raw
Quoted 71 lines · Florian Fainelli
Quoted 68 lines · Heiner Kallweit
Quoted 67 lines · Florian Fainelli
Quoted 63 lines · Jisheng Zhang
Quoted 42 lines · On Wed, 30 Sep 2020 13:23:29 -0700 Florian Fainelli wrote:
Quoted 40 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 9 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable.  But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

Quoted 7 lines
Quoted 3 lines

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit

Hi all,

The PHY's suspend callback usually calls genphy_suspend() which will set BMCR_PDOWN bit, this may break WoL. I think this is one the reason why we ignore the phydrv->suspend() when WoL is enabled. If we goes to this directly, it looks like we need to change each phy's suspend implementation, I.E if WoL is enabled, ignore genphy_suspend() and do possible isolation; If WoL is disabled, keep the code path as is.

So compared with the shutdown hook, which direction is better?

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I believe you will have an easier time to add an argument to the PHY driver suspend's function to indicate the WoL status, or to move down the check for WoL being enabled/supported compared to adding support for shutdown into the MDIO bus layer, and then PHY drivers.

Maybe the shutdown callback of mdio_bus_type could be implemented. It could iterate over all PHY's on the bus, check for WoL (similar to mdio_bus_phy_may_suspend) and do whatever is needed.
Seems to me to be the most generic way.

OK and we optionally call into a PHY device's shutdown function if defined so it can perform PHY specific work? That would work for me.

If suspend and shutdown procedure are the same for the PHY, then we may not need a shutdown hook in phy_driver. This seems to be the case here. I just wonder what the actual use case is, because typically MAC drivers call phy_stop (that calls phy_suspend) in their shutdown hook.

#10 lore raw
Quoted 80 lines · On Tue, 6 Oct 2020 07:45:10 +0200 Heiner Kallweit <[email protected]> wrote:
Quoted 78 lines · Florian Fainelli
Quoted 74 lines · Heiner Kallweit
Quoted 65 lines · Florian Fainelli
Quoted 62 lines · Jisheng Zhang
Quoted 42 lines · On Wed, 30 Sep 2020 13:23:29 -0700 Florian Fainelli wrote:
Quoted 40 lines · Andrew Lunn
Quoted 26 lines · Florian Fainelli
Quoted 23 lines · Andrew Lunn
Quoted 10 lines · Jisheng Zhang

Hi,

A GE phy supports pad isolation which can save power in WOL mode. But once the isolation is enabled, the MAC can't send/receive pkts to/from the phy because the phy is "isolated". To make the PHY work normally, I need to move the enabling isolation to suspend hook, so far so good. But the isolation isn't enabled in system shutdown case, to support this, I want to add shutdown hook to net phy_driver, then also enable the isolation in the shutdown hook. Is there any elegant solution?

Quoted 2 lines

Or we can break the assumption: ethernet can still send/receive pkts after enabling WoL, no?

That is not an easy assumption to break. The MAC might be doing WOL, so it needs to be able to receive packets.

What you might be able to assume is, if this PHY device has had WOL enabled, it can assume the MAC does not need to send/receive after suspend. The problem is, phy_suspend() will not call into the driver is WOL is enabled, so you have no idea when you can isolate the MAC from the PHY.

Quoted 8 lines
Quoted 3 lines

So adding a shutdown in mdio_driver_register() seems reasonable. But you need to watch out for ordering. Is the MDIO bus driver still running?

If your Ethernet MAC controller implements a shutdown callback and that callback takes care of unregistering the network device which should also ensure that phy_disconnect() gets called, then your PHY's suspend function will be called.

Hi Florian

I could be missing something here, but:

Quoted 7 lines
Quoted 3 lines

phy_suspend does not call into the PHY driver if WOL is enabled. So Jisheng needs a way to tell the PHY it should isolate itself from the MAC, and suspend is not that.

I missed that part, that's right if WoL is enabled at the PHY level then the suspend callback is not called, how about we change that and we always call the PHY's suspend callback? This would require that we audit

Hi all,

The PHY's suspend callback usually calls genphy_suspend() which will set BMCR_PDOWN bit, this may break WoL. I think this is one the reason why we ignore the phydrv->suspend() when WoL is enabled. If we goes to this directly, it looks like we need to change each phy's suspend implementation, I.E if WoL is enabled, ignore genphy_suspend() and do possible isolation; If WoL is disabled, keep the code path as is.

Quoted 3 lines
Quoted 1 line

So compared with the shutdown hook, which direction is better?

I believe you will have an easier time to add an argument to the PHY driver suspend's function to indicate the WoL status, or to move down the check for WoL being enabled/supported compared to adding support for shutdown into the MDIO bus layer, and then PHY drivers.

Maybe the shutdown callback of mdio_bus_type could be implemented. It could iterate over all PHY's on the bus, check for WoL (similar to mdio_bus_phy_may_suspend) and do whatever is needed.
Seems to me to be the most generic way.

Quoted 6 lines
Quoted 1 line

OK and we optionally call into a PHY device's shutdown function if defined so it can perform PHY specific work? That would work for me.

If suspend and shutdown procedure are the same for the PHY, then we may not need a shutdown hook in phy_driver. This seems to be the case here. I just wonder what the actual use case is, because typically MAC drivers call phy_stop (that calls phy_suspend) in their shutdown hook.

Thank you all, I will follow this direction and send out an RFC for review.

Thanks a lot,
Jisheng