All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] net: dsa: Fix type was not set for devlink port
@ 2021-03-29 15:30 Maxim Kochetkov
  2021-03-29 16:25 ` Vladimir Oltean
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maxim Kochetkov @ 2021-03-29 15:30 UTC (permalink / raw)
  Cc: andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba, netdev,
	Maxim Kochetkov

If PHY is not available on DSA port (described at devicetree but absent or
failed to detect) then kernel prints warning after 3700 secs:

[ 3707.948771] ------------[ cut here ]------------
[ 3707.948784] Type was not set for devlink port.
[ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8

We should unregister the devlink port as a user port and
re-register it as an unused port before executing "continue" in case of
dsa_port_setup error.

Fixes: 86f8b1c01a0a ("net: dsa: Do not make user port errors fatal")
Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 net/dsa/dsa2.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index d142eb2b288b..3c3e56a1f34d 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -795,8 +795,14 @@ static int dsa_tree_setup_switches(struct dsa_switch_tree *dst)
 
 	list_for_each_entry(dp, &dst->ports, list) {
 		err = dsa_port_setup(dp);
-		if (err)
+		if (err) {
+			dsa_port_devlink_teardown(dp);
+			dp->type = DSA_PORT_TYPE_UNUSED;
+			err = dsa_port_devlink_setup(dp);
+			if (err)
+				goto teardown;
 			continue;
+		}
 	}
 
 	return 0;
-- 
2.30.2


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

* Re: [PATCH 1/1] net: dsa: Fix type was not set for devlink port
  2021-03-29 15:30 [PATCH 1/1] net: dsa: Fix type was not set for devlink port Maxim Kochetkov
@ 2021-03-29 16:25 ` Vladimir Oltean
  2021-03-29 16:50 ` Andrew Lunn
  2021-03-29 21:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Vladimir Oltean @ 2021-03-29 16:25 UTC (permalink / raw)
  To: Maxim Kochetkov; +Cc: andrew, vivien.didelot, f.fainelli, davem, kuba, netdev

On Mon, Mar 29, 2021 at 06:30:16PM +0300, Maxim Kochetkov wrote:
> If PHY is not available on DSA port (described at devicetree but absent or
> failed to detect) then kernel prints warning after 3700 secs:
> 
> [ 3707.948771] ------------[ cut here ]------------
> [ 3707.948784] Type was not set for devlink port.
> [ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8
> 
> We should unregister the devlink port as a user port and
> re-register it as an unused port before executing "continue" in case of
> dsa_port_setup error.
> 
> Fixes: 86f8b1c01a0a ("net: dsa: Do not make user port errors fatal")
> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

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

* Re: [PATCH 1/1] net: dsa: Fix type was not set for devlink port
  2021-03-29 15:30 [PATCH 1/1] net: dsa: Fix type was not set for devlink port Maxim Kochetkov
  2021-03-29 16:25 ` Vladimir Oltean
@ 2021-03-29 16:50 ` Andrew Lunn
  2021-03-29 16:56   ` Florian Fainelli
  2021-03-29 21:00 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2021-03-29 16:50 UTC (permalink / raw)
  To: Maxim Kochetkov, Florian Fainelli
  Cc: vivien.didelot, f.fainelli, olteanv, davem, kuba, netdev

On Mon, Mar 29, 2021 at 06:30:16PM +0300, Maxim Kochetkov wrote:
> If PHY is not available on DSA port (described at devicetree but absent or
> failed to detect) then kernel prints warning after 3700 secs:
> 
> [ 3707.948771] ------------[ cut here ]------------
> [ 3707.948784] Type was not set for devlink port.
> [ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8
> 
> We should unregister the devlink port as a user port and
> re-register it as an unused port before executing "continue" in case of
> dsa_port_setup error.
> 
> Fixes: 86f8b1c01a0a ("net: dsa: Do not make user port errors fatal")

This commit says:

    Prior to 1d27732f411d ("net: dsa: setup and teardown ports"), we would
    not treat failures to set-up an user port as fatal, but after this
    commit we would, which is a regression for some systems where interfaces
    may be declared in the Device Tree, but the underlying hardware may not
    be present (pluggable daughter cards for instance).

Florian

Are these daughter cards hot pluggable? So we expect them to appear
and the port is then usable? Or is a reboot required?

    Andrew

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

* Re: [PATCH 1/1] net: dsa: Fix type was not set for devlink port
  2021-03-29 16:50 ` Andrew Lunn
@ 2021-03-29 16:56   ` Florian Fainelli
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2021-03-29 16:56 UTC (permalink / raw)
  To: Andrew Lunn, Maxim Kochetkov; +Cc: vivien.didelot, olteanv, davem, kuba, netdev

On 3/29/21 9:50 AM, Andrew Lunn wrote:
> On Mon, Mar 29, 2021 at 06:30:16PM +0300, Maxim Kochetkov wrote:
>> If PHY is not available on DSA port (described at devicetree but absent or
>> failed to detect) then kernel prints warning after 3700 secs:
>>
>> [ 3707.948771] ------------[ cut here ]------------
>> [ 3707.948784] Type was not set for devlink port.
>> [ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8
>>
>> We should unregister the devlink port as a user port and
>> re-register it as an unused port before executing "continue" in case of
>> dsa_port_setup error.
>>
>> Fixes: 86f8b1c01a0a ("net: dsa: Do not make user port errors fatal")
> 
> This commit says:
> 
>     Prior to 1d27732f411d ("net: dsa: setup and teardown ports"), we would
>     not treat failures to set-up an user port as fatal, but after this
>     commit we would, which is a regression for some systems where interfaces
>     may be declared in the Device Tree, but the underlying hardware may not
>     be present (pluggable daughter cards for instance).
> 
> Florian
> 
> Are these daughter cards hot pluggable? So we expect them to appear
> and the port is then usable? Or is a reboot required?

The systems need to be powered off cards replaced and then powered back
on so no true hot-pluggable scheme but cold-pluggable definitively.
-- 
Florian

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

* Re: [PATCH 1/1] net: dsa: Fix type was not set for devlink port
  2021-03-29 15:30 [PATCH 1/1] net: dsa: Fix type was not set for devlink port Maxim Kochetkov
  2021-03-29 16:25 ` Vladimir Oltean
  2021-03-29 16:50 ` Andrew Lunn
@ 2021-03-29 21:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-29 21:00 UTC (permalink / raw)
  To: Maxim Kochetkov
  Cc: andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba, netdev

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Mon, 29 Mar 2021 18:30:16 +0300 you wrote:
> If PHY is not available on DSA port (described at devicetree but absent or
> failed to detect) then kernel prints warning after 3700 secs:
> 
> [ 3707.948771] ------------[ cut here ]------------
> [ 3707.948784] Type was not set for devlink port.
> [ 3707.948894] WARNING: CPU: 1 PID: 17 at net/core/devlink.c:8097 0xc083f9d8
> 
> [...]

Here is the summary with links:
  - [1/1] net: dsa: Fix type was not set for devlink port
    https://git.kernel.org/netdev/net/c/fb6ec87f7229

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] 5+ messages in thread

end of thread, other threads:[~2021-03-29 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 15:30 [PATCH 1/1] net: dsa: Fix type was not set for devlink port Maxim Kochetkov
2021-03-29 16:25 ` Vladimir Oltean
2021-03-29 16:50 ` Andrew Lunn
2021-03-29 16:56   ` Florian Fainelli
2021-03-29 21:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.