linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: micrel: make *-skew-ps check more lenient
@ 2021-10-12 10:34 Matthias Schiffer
  2021-10-13  8:25 ` Philippe Schenker
  2021-10-15  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Matthias Schiffer @ 2021-10-12 10:34 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King
  Cc: David S. Miller, Jakub Kicinski, netdev, linux-kernel, Matthias Schiffer

It seems reasonable to fine-tune only some of the skew values when using
one of the rgmii-*id PHY modes, and even when all skew values are
specified, using the correct ID PHY mode makes sense for documentation
purposes. Such a configuration also appears in the binding docs in
Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, so the driver
should not warn about it.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
---
 drivers/net/phy/micrel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index c330a5a9f665..03e58ebf68af 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -863,9 +863,9 @@ static int ksz9031_config_init(struct phy_device *phydev)
 				MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
 				tx_data_skews, 4, &update);
 
-		if (update && phydev->interface != PHY_INTERFACE_MODE_RGMII)
+		if (update && !phy_interface_is_rgmii(phydev))
 			phydev_warn(phydev,
-				    "*-skew-ps values should be used only with phy-mode = \"rgmii\"\n");
+				    "*-skew-ps values should be used only with RGMII PHY modes\n");
 
 		/* Silicon Errata Sheet (DS80000691D or DS80000692D):
 		 * When the device links in the 1000BASE-T slave mode only,
-- 
2.17.1


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

* Re: [PATCH] net: phy: micrel: make *-skew-ps check more lenient
  2021-10-12 10:34 [PATCH] net: phy: micrel: make *-skew-ps check more lenient Matthias Schiffer
@ 2021-10-13  8:25 ` Philippe Schenker
  2021-10-13  8:46   ` Matthias Schiffer
  2021-10-15  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 6+ messages in thread
From: Philippe Schenker @ 2021-10-13  8:25 UTC (permalink / raw)
  To: matthias.schiffer, linux, hkallweit1, andrew
  Cc: linux-kernel, davem, kuba, netdev

On Tue, 2021-10-12 at 12:34 +0200, Matthias Schiffer wrote:
> It seems reasonable to fine-tune only some of the skew values when
> using
> one of the rgmii-*id PHY modes, and even when all skew values are
> specified, using the correct ID PHY mode makes sense for documentation
> purposes. Such a configuration also appears in the binding docs in
> Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, so the
> driver
> should not warn about it.

I don't think your commit message is right. The rgmii-*id PHY modes are
no longer just for documentation purposes on KSZ9031 PHY. They are used
to set the skew-registers according to .

The warning is there, that in case you override the skew registers of
one of the modes rgmii-id, rgmii-txid, rgmii-rxid with *-skew-ps
settings in DT.

Therefore I also think the warning is valuable and should be kept. We
may want to reword it though.

Philippe

> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> ---
>  drivers/net/phy/micrel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index c330a5a9f665..03e58ebf68af 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -863,9 +863,9 @@ static int ksz9031_config_init(struct phy_device
> *phydev)
>                                 MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
>                                 tx_data_skews, 4, &update);
>  
> -               if (update && phydev->interface !=
> PHY_INTERFACE_MODE_RGMII)
> +               if (update && !phy_interface_is_rgmii(phydev))
>                         phydev_warn(phydev,
> -                                   "*-skew-ps values should be used
> only with phy-mode = \"rgmii\"\n");
> +                                   "*-skew-ps values should be used
> only with RGMII PHY modes\n");
>  
>                 /* Silicon Errata Sheet (DS80000691D or DS80000692D):
>                  * When the device links in the 1000BASE-T slave mode
> only,


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

* Re: [PATCH] net: phy: micrel: make *-skew-ps check more lenient
  2021-10-13  8:25 ` Philippe Schenker
@ 2021-10-13  8:46   ` Matthias Schiffer
  2021-10-13 10:18     ` Philippe Schenker
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Schiffer @ 2021-10-13  8:46 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: linux-kernel, davem, kuba, netdev, linux, hkallweit1, andrew

On Wed, 2021-10-13 at 08:25 +0000, Philippe Schenker wrote:
> On Tue, 2021-10-12 at 12:34 +0200, Matthias Schiffer wrote:
> > It seems reasonable to fine-tune only some of the skew values when
> > using
> > one of the rgmii-*id PHY modes, and even when all skew values are
> > specified, using the correct ID PHY mode makes sense for documentation
> > purposes. Such a configuration also appears in the binding docs in
> > Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, so the
> > driver
> > should not warn about it.
> 
> I don't think your commit message is right. The rgmii-*id PHY modes are
> no longer just for documentation purposes on KSZ9031 PHY. They are used
> to set the skew-registers according to .

Yes, this was implemented in [1]. The commit message explicitly states
that fine-tuning is still possible using *-skew-ps.

> 
> The warning is there, that in case you override the skew registers of
> one of the modes rgmii-id, rgmii-txid, rgmii-rxid with *-skew-ps
> settings in DT.

The "rgmii" mode should not be handled differently from "rgmii-*id" in
my opinion. Otherwise for a device that is basically "rgmii-id", but
requires slight fine-tuning, you have to set the mode to the incorrect
value "rgmii" in the DTS to avoid this warning.


> 
> Therefore I also think the warning is valuable and should be kept. We
> may want to reword it though.
> 
> Philippe

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/phy/micrel.c?id=bcf3440c6dd78bfe5836ec0990fe36d7b4bb7d20


> 
> > 
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > ---
> >  drivers/net/phy/micrel.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> > index c330a5a9f665..03e58ebf68af 100644
> > --- a/drivers/net/phy/micrel.c
> > +++ b/drivers/net/phy/micrel.c
> > @@ -863,9 +863,9 @@ static int ksz9031_config_init(struct phy_device
> > *phydev)
> >                                 MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
> >                                 tx_data_skews, 4, &update);
> >  
> > -               if (update && phydev->interface !=
> > PHY_INTERFACE_MODE_RGMII)
> > +               if (update && !phy_interface_is_rgmii(phydev))
> >                         phydev_warn(phydev,
> > -                                   "*-skew-ps values should be used
> > only with phy-mode = \"rgmii\"\n");
> > +                                   "*-skew-ps values should be used
> > only with RGMII PHY modes\n");
> >  
> >                 /* Silicon Errata Sheet (DS80000691D or DS80000692D):
> >                  * When the device links in the 1000BASE-T slave mode
> > only,
> 
> 


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

* Re: [PATCH] net: phy: micrel: make *-skew-ps check more lenient
  2021-10-13  8:46   ` Matthias Schiffer
@ 2021-10-13 10:18     ` Philippe Schenker
  2021-10-13 11:01       ` Matthias Schiffer
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Schenker @ 2021-10-13 10:18 UTC (permalink / raw)
  To: matthias.schiffer
  Cc: linux, andrew, netdev, linux-kernel, davem, hkallweit1, kuba

On Wed, 2021-10-13 at 10:46 +0200, Matthias Schiffer wrote:
> On Wed, 2021-10-13 at 08:25 +0000, Philippe Schenker wrote:
> > On Tue, 2021-10-12 at 12:34 +0200, Matthias Schiffer wrote:
> > > It seems reasonable to fine-tune only some of the skew values when
> > > using
> > > one of the rgmii-*id PHY modes, and even when all skew values are
> > > specified, using the correct ID PHY mode makes sense for
> > > documentation
> > > purposes. Such a configuration also appears in the binding docs in
> > > Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, so the
> > > driver
> > > should not warn about it.
> > 
> > I don't think your commit message is right. The rgmii-*id PHY modes
> > are
> > no longer just for documentation purposes on KSZ9031 PHY. They are
> > used
> > to set the skew-registers according to .
> 
> Yes, this was implemented in [1]. The commit message explicitly states
> that fine-tuning is still possible using *-skew-ps.
> 
> > 
> > The warning is there, that in case you override the skew registers
> > of
> > one of the modes rgmii-id, rgmii-txid, rgmii-rxid with *-skew-ps
> > settings in DT.
> 
> The "rgmii" mode should not be handled differently from "rgmii-*id" in
> my opinion. Otherwise for a device that is basically "rgmii-id", but
> requires slight fine-tuning, you have to set the mode to the incorrect
> value "rgmii" in the DTS to avoid this warning.

Now I have understood your argument. But then I suggest to delete the
warning entirely as it completely changes its meaning with that patch.

Philippe

> 
> 
> > 
> > Therefore I also think the warning is valuable and should be kept.
> > We
> > may want to reword it though.
> > 
> > Philippe
> 
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/phy/micrel.c?id=bcf3440c6dd78bfe5836ec0990fe36d7b4bb7d20
> 
> 
> > 
> > > 
> > > Signed-off-by: Matthias Schiffer
> > > <matthias.schiffer@ew.tq-group.com>
> > > ---
> > >  drivers/net/phy/micrel.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> > > index c330a5a9f665..03e58ebf68af 100644
> > > --- a/drivers/net/phy/micrel.c
> > > +++ b/drivers/net/phy/micrel.c
> > > @@ -863,9 +863,9 @@ static int ksz9031_config_init(struct
> > > phy_device
> > > *phydev)
> > >                                 MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
> > >                                 tx_data_skews, 4, &update);
> > >  
> > > -               if (update && phydev->interface !=
> > > PHY_INTERFACE_MODE_RGMII)
> > > +               if (update && !phy_interface_is_rgmii(phydev))
> > >                         phydev_warn(phydev,
> > > -                                   "*-skew-ps values should be
> > > used
> > > only with phy-mode = \"rgmii\"\n");
> > > +                                   "*-skew-ps values should be
> > > used
> > > only with RGMII PHY modes\n");
> > >  
> > >                 /* Silicon Errata Sheet (DS80000691D or
> > > DS80000692D):
> > >                  * When the device links in the 1000BASE-T slave
> > > mode
> > > only,
> > 
> > 
> 


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

* Re: [PATCH] net: phy: micrel: make *-skew-ps check more lenient
  2021-10-13 10:18     ` Philippe Schenker
@ 2021-10-13 11:01       ` Matthias Schiffer
  0 siblings, 0 replies; 6+ messages in thread
From: Matthias Schiffer @ 2021-10-13 11:01 UTC (permalink / raw)
  To: Philippe Schenker
  Cc: linux, andrew, netdev, linux-kernel, davem, hkallweit1, kuba

On Wed, 2021-10-13 at 10:18 +0000, Philippe Schenker wrote:
> On Wed, 2021-10-13 at 10:46 +0200, Matthias Schiffer wrote:
> > On Wed, 2021-10-13 at 08:25 +0000, Philippe Schenker wrote:
> > > On Tue, 2021-10-12 at 12:34 +0200, Matthias Schiffer wrote:
> > > > It seems reasonable to fine-tune only some of the skew values when
> > > > using
> > > > one of the rgmii-*id PHY modes, and even when all skew values are
> > > > specified, using the correct ID PHY mode makes sense for
> > > > documentation
> > > > purposes. Such a configuration also appears in the binding docs in
> > > > Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, so the
> > > > driver
> > > > should not warn about it.
> > > 
> > > I don't think your commit message is right. The rgmii-*id PHY modes
> > > are
> > > no longer just for documentation purposes on KSZ9031 PHY. They are
> > > used
> > > to set the skew-registers according to .
> > 
> > Yes, this was implemented in [1]. The commit message explicitly states
> > that fine-tuning is still possible using *-skew-ps.
> > 
> > > 
> > > The warning is there, that in case you override the skew registers
> > > of
> > > one of the modes rgmii-id, rgmii-txid, rgmii-rxid with *-skew-ps
> > > settings in DT.
> > 
> > The "rgmii" mode should not be handled differently from "rgmii-*id" in
> > my opinion. Otherwise for a device that is basically "rgmii-id", but
> > requires slight fine-tuning, you have to set the mode to the incorrect
> > value "rgmii" in the DTS to avoid this warning.
> 
> Now I have understood your argument. But then I suggest to delete the
> warning entirely as it completely changes its meaning with that patch.
> 
> Philippe

The KSZ9031 also supports MII and GMII though. I think it makes sense
to keep the warning for these cases (which is why I reworded the
warning the way I did).


> 
> > 
> > 
> > > 
> > > Therefore I also think the warning is valuable and should be kept.
> > > We
> > > may want to reword it though.
> > > 
> > > Philippe
> > 
> > [1]
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/phy/micrel.c?id=bcf3440c6dd78bfe5836ec0990fe36d7b4bb7d20
> > 
> > 
> > > 
> > > > 
> > > > Signed-off-by: Matthias Schiffer
> > > > <matthias.schiffer@ew.tq-group.com>
> > > > ---
> > > >  drivers/net/phy/micrel.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> > > > index c330a5a9f665..03e58ebf68af 100644
> > > > --- a/drivers/net/phy/micrel.c
> > > > +++ b/drivers/net/phy/micrel.c
> > > > @@ -863,9 +863,9 @@ static int ksz9031_config_init(struct
> > > > phy_device
> > > > *phydev)
> > > >                                 MII_KSZ9031RN_TX_DATA_PAD_SKEW, 4,
> > > >                                 tx_data_skews, 4, &update);
> > > >  
> > > > -               if (update && phydev->interface !=
> > > > PHY_INTERFACE_MODE_RGMII)
> > > > +               if (update && !phy_interface_is_rgmii(phydev))
> > > >                         phydev_warn(phydev,
> > > > -                                   "*-skew-ps values should be
> > > > used
> > > > only with phy-mode = \"rgmii\"\n");
> > > > +                                   "*-skew-ps values should be
> > > > used
> > > > only with RGMII PHY modes\n");
> > > >  
> > > >                 /* Silicon Errata Sheet (DS80000691D or
> > > > DS80000692D):
> > > >                  * When the device links in the 1000BASE-T slave
> > > > mode
> > > > only,
> > > 
> > > 
> 
> 


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

* Re: [PATCH] net: phy: micrel: make *-skew-ps check more lenient
  2021-10-12 10:34 [PATCH] net: phy: micrel: make *-skew-ps check more lenient Matthias Schiffer
  2021-10-13  8:25 ` Philippe Schenker
@ 2021-10-15  2:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-15  2:20 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: andrew, hkallweit1, linux, davem, kuba, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 12 Oct 2021 12:34:02 +0200 you wrote:
> It seems reasonable to fine-tune only some of the skew values when using
> one of the rgmii-*id PHY modes, and even when all skew values are
> specified, using the correct ID PHY mode makes sense for documentation
> purposes. Such a configuration also appears in the binding docs in
> Documentation/devicetree/bindings/net/micrel-ksz90x1.txt, so the driver
> should not warn about it.
> 
> [...]

Here is the summary with links:
  - net: phy: micrel: make *-skew-ps check more lenient
    https://git.kernel.org/netdev/net-next/c/67ca5159dbe2

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

end of thread, other threads:[~2021-10-15  2:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 10:34 [PATCH] net: phy: micrel: make *-skew-ps check more lenient Matthias Schiffer
2021-10-13  8:25 ` Philippe Schenker
2021-10-13  8:46   ` Matthias Schiffer
2021-10-13 10:18     ` Philippe Schenker
2021-10-13 11:01       ` Matthias Schiffer
2021-10-15  2:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).