2020-06-07 13:05:13

by Martin Blumenstingl

[permalink] [raw]
Subject: [PATCH net v1] net: dsa: lantiq_gswip: fix and improve the unsupported interface error

While trying to use the lantiq_gswip driver on one of my boards I made
a mistake when specifying the phy-mode (because the out-of-tree driver
wants phy-mode "gmii" or "mii" for the internal PHYs). In this case the
following error is printed multiple times:
Unsupported interface: 3

While it gives at least a hint at what may be wrong it is not very user
friendly. Print the human readable phy-mode and also which port is
configured incorrectly (this hardware supports ports 0..6) to improve
the cases where someone made a mistake.

Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Signed-off-by: Martin Blumenstingl <[email protected]>
---
drivers/net/dsa/lantiq_gswip.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index cf6fa8fede33..521ebc072903 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -1452,7 +1452,8 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port,

unsupported:
bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
- dev_err(ds->dev, "Unsupported interface: %d\n", state->interface);
+ dev_err(ds->dev, "Unsupported interface '%s' for port %d\n",
+ phy_modes(state->interface), port);
return;
}

--
2.27.0


2020-06-07 13:10:27

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH net v1] net: dsa: lantiq_gswip: fix and improve the unsupported interface error

On 6/7/20 3:02 PM, Martin Blumenstingl wrote:
> While trying to use the lantiq_gswip driver on one of my boards I made
> a mistake when specifying the phy-mode (because the out-of-tree driver
> wants phy-mode "gmii" or "mii" for the internal PHYs). In this case the
> following error is printed multiple times:
> Unsupported interface: 3
>
> While it gives at least a hint at what may be wrong it is not very user
> friendly. Print the human readable phy-mode and also which port is
> configured incorrectly (this hardware supports ports 0..6) to improve
> the cases where someone made a mistake.
>
> Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
> Signed-off-by: Martin Blumenstingl <[email protected]>

Acked-by: Hauke Mehrtens <[email protected]>

> ---
> drivers/net/dsa/lantiq_gswip.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
> index cf6fa8fede33..521ebc072903 100644
> --- a/drivers/net/dsa/lantiq_gswip.c
> +++ b/drivers/net/dsa/lantiq_gswip.c
> @@ -1452,7 +1452,8 @@ static void gswip_phylink_validate(struct dsa_switch *ds, int port,
>
> unsupported:
> bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
> - dev_err(ds->dev, "Unsupported interface: %d\n", state->interface);
> + dev_err(ds->dev, "Unsupported interface '%s' for port %d\n",
> + phy_modes(state->interface), port);
> return;
> }
>
>

2020-06-08 00:14:32

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net v1] net: dsa: lantiq_gswip: fix and improve the unsupported interface error

From: Martin Blumenstingl <[email protected]>
Date: Sun, 7 Jun 2020 15:02:58 +0200

> While trying to use the lantiq_gswip driver on one of my boards I made
> a mistake when specifying the phy-mode (because the out-of-tree driver
> wants phy-mode "gmii" or "mii" for the internal PHYs). In this case the
> following error is printed multiple times:
> Unsupported interface: 3
>
> While it gives at least a hint at what may be wrong it is not very user
> friendly. Print the human readable phy-mode and also which port is
> configured incorrectly (this hardware supports ports 0..6) to improve
> the cases where someone made a mistake.
>
> Fixes: 14fceff4771e51 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
> Signed-off-by: Martin Blumenstingl <[email protected]>

Looks good, applied, thank you.