powering off phys on 'ip link set down'

6 messages, 2 authors, 2020-08-27 · open the first message on its own page

powering off phys on 'ip link set down'

From: Rasmus Villemoes <hidden>
Date: 2020-08-27 10:08:39

Hi,

We have a requirement that when an interface is taken down
administratively, the phy should be powered off. That also works when
the interface has link when the 'ip link set down ...' is run. But if
there's no cable plugged in, the phy stays powered on (as can be seen
both using phytool, and from the fact that a peer gets carrier once a
cable is later plugged in).

Is this expected behaviour? Driver/device dependent? Can we do anything
to force the phy off?

Thanks,
Rasmus

Re: powering off phys on 'ip link set down'

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: 2020-08-27 10:30:29

On 27.08.2020 12:08, Rasmus Villemoes wrote:
Hi,

We have a requirement that when an interface is taken down
administratively, the phy should be powered off. That also works when
the interface has link when the 'ip link set down ...' is run. But if
there's no cable plugged in, the phy stays powered on (as can be seen
both using phytool, and from the fact that a peer gets carrier once a
cable is later plugged in).

Is this expected behaviour? Driver/device dependent? Can we do anything
to force the phy off?
This may be MAC/PHY-driver dependent. Which driver(s) do we talk about?
Also it may depend on whether Runtime PM is active for a PCI network
device. In addition WoL should be disabled.
Thanks,
Rasmus
Heiner

Re: powering off phys on 'ip link set down'

From: Rasmus Villemoes <hidden>
Date: 2020-08-27 11:23:37

On 27/08/2020 12.29, Heiner Kallweit wrote:
On 27.08.2020 12:08, Rasmus Villemoes wrote:
quoted
Hi,

We have a requirement that when an interface is taken down
administratively, the phy should be powered off. That also works when
the interface has link when the 'ip link set down ...' is run. But if
there's no cable plugged in, the phy stays powered on (as can be seen
both using phytool, and from the fact that a peer gets carrier once a
cable is later plugged in).

Is this expected behaviour? Driver/device dependent? Can we do anything
to force the phy off?
This may be MAC/PHY-driver dependent. Which driver(s) do we talk about?
It's a Marvell 88e6250 switch (drivers/net/dsa/mv88e6xxx/).
Also it may depend on whether Runtime PM is active for a PCI network
device. In addition WoL should be disabled.
The datasheet does mention WoL, but it's either not hooked up in the
driver or at least default disabled, ethtool says

     Supports Wake-on: d
     Wake-on: d

Thanks,
Rasmus

Re: powering off phys on 'ip link set down'

From: Rasmus Villemoes <hidden>
Date: 2020-08-27 11:47:58

On 27/08/2020 13.14, Heiner Kallweit wrote:
On 27.08.2020 13:00, Rasmus Villemoes wrote:
quoted
On 27/08/2020 12.29, Heiner Kallweit wrote:
quoted
On 27.08.2020 12:08, Rasmus Villemoes wrote:
quoted
Hi,

We have a requirement that when an interface is taken down
administratively, the phy should be powered off. That also works when
the interface has link when the 'ip link set down ...' is run. But if
there's no cable plugged in, the phy stays powered on (as can be seen
both using phytool, and from the fact that a peer gets carrier once a
cable is later plugged in).

Is this expected behaviour? Driver/device dependent? Can we do anything
to force the phy off?
Maybe your question refers to something that was changed in 5.4 with
the following commit:
95fb8bb3181b ("net: phy: force phy suspend when calling phy_stop")
This is a 4.19-rt kernel, and yes, cherry-picking that commit does make
things work as expected (and required). Thanks a lot, Heiner!

Rasmus

Re: powering off phys on 'ip link set down'

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: 2020-08-27 15:20:53

On 27.08.2020 13:00, Rasmus Villemoes wrote:
On 27/08/2020 12.29, Heiner Kallweit wrote:
quoted
On 27.08.2020 12:08, Rasmus Villemoes wrote:
quoted
Hi,

We have a requirement that when an interface is taken down
administratively, the phy should be powered off. That also works when
the interface has link when the 'ip link set down ...' is run. But if
there's no cable plugged in, the phy stays powered on (as can be seen
both using phytool, and from the fact that a peer gets carrier once a
cable is later plugged in).

Is this expected behaviour? Driver/device dependent? Can we do anything
to force the phy off?
This may be MAC/PHY-driver dependent. Which driver(s) do we talk about?
It's a Marvell 88e6250 switch (drivers/net/dsa/mv88e6xxx/).
quoted
Also it may depend on whether Runtime PM is active for a PCI network
device. In addition WoL should be disabled.
The datasheet does mention WoL, but it's either not hooked up in the
driver or at least default disabled, ethtool says

     Supports Wake-on: d
     Wake-on: d
By the way, which kernel version are you using?
Thanks,
Rasmus

Re: powering off phys on 'ip link set down'

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: 2020-08-27 15:20:58

On 27.08.2020 13:00, Rasmus Villemoes wrote:
On 27/08/2020 12.29, Heiner Kallweit wrote:
quoted
On 27.08.2020 12:08, Rasmus Villemoes wrote:
quoted
Hi,

We have a requirement that when an interface is taken down
administratively, the phy should be powered off. That also works when
the interface has link when the 'ip link set down ...' is run. But if
there's no cable plugged in, the phy stays powered on (as can be seen
both using phytool, and from the fact that a peer gets carrier once a
cable is later plugged in).

Is this expected behaviour? Driver/device dependent? Can we do anything
to force the phy off?
This may be MAC/PHY-driver dependent. Which driver(s) do we talk about?
It's a Marvell 88e6250 switch (drivers/net/dsa/mv88e6xxx/).
quoted
Also it may depend on whether Runtime PM is active for a PCI network
device. In addition WoL should be disabled.
The datasheet does mention WoL, but it's either not hooked up in the
driver or at least default disabled, ethtool says

     Supports Wake-on: d
     Wake-on: d

Thanks,
Rasmus
Maybe your question refers to something that was changed in 5.4 with
the following commit:
95fb8bb3181b ("net: phy: force phy suspend when calling phy_stop")
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help