All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC 00/02] ravb: Duplex handling update
@ 2018-07-19 11:50 Magnus Damm
  2018-07-19 11:51 ` [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported Magnus Damm
  2018-07-19 11:51 ` [PATCH/RFC 02/02] ravb: Clean up duplex handling Magnus Damm
  0 siblings, 2 replies; 15+ messages in thread
From: Magnus Damm @ 2018-07-19 11:50 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

ravb: Duplex handling update

[PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
[PATCH/RFC 02/02] ravb: Clean up duplex handling

This series contains prototype-level code to update the Ethernet-AVB
driver to improve duplex handling.

Based on the latest data sheet for R-Car Gen3 [1] and R-Car Gen2 [2]
the following information is part of the EthernetAVB-IF overview page:

Transfer speed: Supports transfer at 100 and 1000 Mbps
Mode: Full-duplex mode

It seems that the driver implementation is not matching the information
provided in the friendly data sheet, and on top of this during run-time
when changing PHY configuration of the link partner the Ethernet-AVB PHY
seems to want to announce unsupported modes.

[1] R-Car Series, 3rd Generation Rev.1.00 (Apr 2018)
[2] R-Car Series, 2nd Generation Rev.2.00 (Feb 2016)

Not suitable for upstream merge yet - needs more discussion.

Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Written on top of renesas-drivers-2018-07-17-v4.18-rc5

 drivers/net/ethernet/renesas/ravb.h      |    1 -
 drivers/net/ethernet/renesas/ravb_main.c |   30 +++---------------------------
 2 files changed, 3 insertions(+), 28 deletions(-)

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

* [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 11:50 [PATCH/RFC 00/02] ravb: Duplex handling update Magnus Damm
@ 2018-07-19 11:51 ` Magnus Damm
  2018-07-19 14:32   ` Sergei Shtylyov
  2018-07-19 11:51 ` [PATCH/RFC 02/02] ravb: Clean up duplex handling Magnus Damm
  1 sibling, 1 reply; 15+ messages in thread
From: Magnus Damm @ 2018-07-19 11:51 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

From: Magnus Damm <damm+renesas@opensource.se>

According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
and R-Car Gen2 SoCs do not support half duplex operation. So update
the driver to mark 100Mbit HDX as unsupported.

Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Written on top of renesas-drivers-2018-07-17-v4.18-rc5

 drivers/net/ethernet/renesas/ravb_main.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- 0001/drivers/net/ethernet/renesas/ravb_main.c
+++ work/drivers/net/ethernet/renesas/ravb_main.c	2018-07-19 19:18:38.210607110 +0900
@@ -1066,8 +1066,8 @@ static int ravb_phy_init(struct net_devi
 		netdev_info(ndev, "limited PHY to 100Mbit/s\n");
 	}
 
-	/* 10BASE is not supported */
-	phydev->supported &= ~PHY_10BT_FEATURES;
+	/* Nether 10BASE nor half duplex is supported */
+	phydev->supported &= ~(PHY_10BT_FEATURES | SUPPORTED_100baseT_Half);
 
 	phy_attached_info(phydev);
 

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

* [PATCH/RFC 02/02] ravb: Clean up duplex handling
  2018-07-19 11:50 [PATCH/RFC 00/02] ravb: Duplex handling update Magnus Damm
  2018-07-19 11:51 ` [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported Magnus Damm
@ 2018-07-19 11:51 ` Magnus Damm
  2018-07-19 15:44   ` Sergei Shtylyov
  1 sibling, 1 reply; 15+ messages in thread
From: Magnus Damm @ 2018-07-19 11:51 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm

From: Magnus Damm <damm+renesas@opensource.se>

Since only full-duplex operation is supported by the
hardware, remove duplex handling code and keep the
register setting of ECMR.DM fixed at 1.

This updates the driver implementation to follow the
data sheet text "This bit should always be set to 1."

Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Written on top of renesas-drivers-2018-07-17-v4.18-rc5

 drivers/net/ethernet/renesas/ravb.h      |    1 -
 drivers/net/ethernet/renesas/ravb_main.c |   26 +-------------------------
 2 files changed, 1 insertion(+), 26 deletions(-)

--- 0001/drivers/net/ethernet/renesas/ravb.h
+++ work/drivers/net/ethernet/renesas/ravb.h	2018-07-19 19:43:11.830607110 +0900
@@ -1027,7 +1027,6 @@ struct ravb_private {
 	phy_interface_t phy_interface;
 	int msg_enable;
 	int speed;
-	int duplex;
 	int emac_irq;
 	enum ravb_chip_id chip_id;
 	int rx_irqs[NUM_RX_QUEUE];
--- 0003/drivers/net/ethernet/renesas/ravb_main.c
+++ work/drivers/net/ethernet/renesas/ravb_main.c	2018-07-19 19:44:14.370607110 +0900
@@ -85,13 +85,6 @@ static int ravb_config(struct net_device
 	return error;
 }
 
-static void ravb_set_duplex(struct net_device *ndev)
-{
-	struct ravb_private *priv = netdev_priv(ndev);
-
-	ravb_modify(ndev, ECMR, ECMR_DM, priv->duplex ? ECMR_DM : 0);
-}
-
 static void ravb_set_rate(struct net_device *ndev)
 {
 	struct ravb_private *priv = netdev_priv(ndev);
@@ -401,13 +394,11 @@ error:
 /* E-MAC init function */
 static void ravb_emac_init(struct net_device *ndev)
 {
-	struct ravb_private *priv = netdev_priv(ndev);
-
 	/* Receive frame limit set register */
 	ravb_write(ndev, ndev->mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN, RFLR);
 
 	/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */
-	ravb_write(ndev, ECMR_ZPF | (priv->duplex ? ECMR_DM : 0) |
+	ravb_write(ndev, ECMR_ZPF | ECMR_DM |
 		   (ndev->features & NETIF_F_RXCSUM ? ECMR_RCSC : 0) |
 		   ECMR_TE | ECMR_RE, ECMR);
 
@@ -982,12 +973,6 @@ static void ravb_adjust_link(struct net_
 	bool new_state = false;
 
 	if (phydev->link) {
-		if (phydev->duplex != priv->duplex) {
-			new_state = true;
-			priv->duplex = phydev->duplex;
-			ravb_set_duplex(ndev);
-		}
-
 		if (phydev->speed != priv->speed) {
 			new_state = true;
 			priv->speed = phydev->speed;
@@ -1004,7 +989,6 @@ static void ravb_adjust_link(struct net_
 		new_state = true;
 		priv->link = 0;
 		priv->speed = 0;
-		priv->duplex = -1;
 		if (priv->no_avb_link)
 			ravb_rcv_snd_disable(ndev);
 	}
@@ -1029,7 +1013,6 @@ static int ravb_phy_init(struct net_devi
 
 	priv->link = 0;
 	priv->speed = 0;
-	priv->duplex = -1;
 
 	/* Try connecting to PHY */
 	pn = of_parse_phandle(np, "phy-handle", 0);
@@ -1131,13 +1114,6 @@ static int ravb_set_link_ksettings(struc
 	if (error)
 		goto error_exit;
 
-	if (cmd->base.duplex == DUPLEX_FULL)
-		priv->duplex = 1;
-	else
-		priv->duplex = 0;
-
-	ravb_set_duplex(ndev);
-
 error_exit:
 	mdelay(1);
 

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 11:51 ` [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported Magnus Damm
@ 2018-07-19 14:32   ` Sergei Shtylyov
  2018-07-19 17:25     ` Magnus Damm
  0 siblings, 1 reply; 15+ messages in thread
From: Sergei Shtylyov @ 2018-07-19 14:32 UTC (permalink / raw)
  To: Magnus Damm, linux-renesas-soc

Hello!

On 07/19/2018 02:51 PM, Magnus Damm wrote:

> From: Magnus Damm <damm+renesas@opensource.se>
> 
> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
> and R-Car Gen2 SoCs do not support half duplex operation. So update
> the driver to mark 100Mbit HDX as unsupported.

   What about 1000Mbit HDX?

> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> ---
> 
>  Written on top of renesas-drivers-2018-07-17-v4.18-rc5
> 
>  drivers/net/ethernet/renesas/ravb_main.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- 0001/drivers/net/ethernet/renesas/ravb_main.c
> +++ work/drivers/net/ethernet/renesas/ravb_main.c	2018-07-19 19:18:38.210607110 +0900
> @@ -1066,8 +1066,8 @@ static int ravb_phy_init(struct net_devi
>  		netdev_info(ndev, "limited PHY to 100Mbit/s\n");
>  	}
>  
> -	/* 10BASE is not supported */
> -	phydev->supported &= ~PHY_10BT_FEATURES;
> +	/* Nether 10BASE nor half duplex is supported */

   Neither. s/is/are/?

> +	phydev->supported &= ~(PHY_10BT_FEATURES | SUPPORTED_100baseT_Half);

   I think you missed SUPPORTED_1000baseT_Half.

[garbage skipped]

MBR, Sergei

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

* Re: [PATCH/RFC 02/02] ravb: Clean up duplex handling
  2018-07-19 11:51 ` [PATCH/RFC 02/02] ravb: Clean up duplex handling Magnus Damm
@ 2018-07-19 15:44   ` Sergei Shtylyov
  2018-07-19 17:30     ` Magnus Damm
  0 siblings, 1 reply; 15+ messages in thread
From: Sergei Shtylyov @ 2018-07-19 15:44 UTC (permalink / raw)
  To: Magnus Damm, linux-renesas-soc

On 07/19/2018 02:51 PM, Magnus Damm wrote:

> From: Magnus Damm <damm+renesas@opensource.se>
> 
> Since only full-duplex operation is supported by the
> hardware, remove duplex handling code and keep the
> register setting of ECMR.DM fixed at 1.
> 
> This updates the driver implementation to follow the
> data sheet text "This bit should always be set to 1."
> 
> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

   Sounds like a fix, please provide a Fixes: tag (I think we're fixing
the initial driver commit here). 

Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> ---
> 
>  Written on top of renesas-drivers-2018-07-17-v4.18-rc5

   Next time please base atop of DaveM's net.git repo.

[...]
> --- 0003/drivers/net/ethernet/renesas/ravb_main.c
> +++ work/drivers/net/ethernet/renesas/ravb_main.c	2018-07-19 19:44:14.370607110 +0900
[...]
> @@ -1131,13 +1114,6 @@ static int ravb_set_link_ksettings(struc
>  	if (error)
>  		goto error_exit;
>  
> -	if (cmd->base.duplex == DUPLEX_FULL)
> -		priv->duplex = 1;
> -	else
> -		priv->duplex = 0;
> -
> -	ravb_set_duplex(ndev);
> -

   This fragment no longer exists in net.git...

[...]

MBR, Sergei

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 14:32   ` Sergei Shtylyov
@ 2018-07-19 17:25     ` Magnus Damm
  2018-07-19 17:42       ` Geert Uytterhoeven
  2018-07-20 11:00       ` Sergei Shtylyov
  0 siblings, 2 replies; 15+ messages in thread
From: Magnus Damm @ 2018-07-19 17:25 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Linux-Renesas

Hi Sergei,

Thanks for your reply!

On Thu, Jul 19, 2018 at 11:32 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> Hello!
>
> On 07/19/2018 02:51 PM, Magnus Damm wrote:
>
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
>> and R-Car Gen2 SoCs do not support half duplex operation. So update
>> the driver to mark 100Mbit HDX as unsupported.
>
>    What about 1000Mbit HDX?

For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
while 1 Gbps is HDX-only.

https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair

>> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>> ---
>>
>>  Written on top of renesas-drivers-2018-07-17-v4.18-rc5
>>
>>  drivers/net/ethernet/renesas/ravb_main.c |    4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> --- 0001/drivers/net/ethernet/renesas/ravb_main.c
>> +++ work/drivers/net/ethernet/renesas/ravb_main.c     2018-07-19 19:18:38.210607110 +0900
>> @@ -1066,8 +1066,8 @@ static int ravb_phy_init(struct net_devi
>>               netdev_info(ndev, "limited PHY to 100Mbit/s\n");
>>       }
>>
>> -     /* 10BASE is not supported */
>> -     phydev->supported &= ~PHY_10BT_FEATURES;
>> +     /* Nether 10BASE nor half duplex is supported */
>
>    Neither. s/is/are/?
>
>> +     phydev->supported &= ~(PHY_10BT_FEATURES | SUPPORTED_100baseT_Half);
>
>    I think you missed SUPPORTED_1000baseT_Half.

Perhaps so, but in reality all our boards use a PHY with Twisted Pair
cables so SUPPORTED_1000baseT_Half doesn't exist in reality. That
aside, I suspect the PHY layer is designed to support more than just
Ethernet-over-TP so that's the reason for that particular constant and
all the other stuff in phy.h.

> [garbage skipped]

You mean the rest of the driver? =)

Cheers,

/ magnus

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

* Re: [PATCH/RFC 02/02] ravb: Clean up duplex handling
  2018-07-19 15:44   ` Sergei Shtylyov
@ 2018-07-19 17:30     ` Magnus Damm
  2018-07-20 11:06       ` Sergei Shtylyov
  0 siblings, 1 reply; 15+ messages in thread
From: Magnus Damm @ 2018-07-19 17:30 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Linux-Renesas

Hi Sergei,

On Fri, Jul 20, 2018 at 12:44 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 07/19/2018 02:51 PM, Magnus Damm wrote:
>
>> From: Magnus Damm <damm+renesas@opensource.se>
>>
>> Since only full-duplex operation is supported by the
>> hardware, remove duplex handling code and keep the
>> register setting of ECMR.DM fixed at 1.
>>
>> This updates the driver implementation to follow the
>> data sheet text "This bit should always be set to 1."
>>
>> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>
>    Sounds like a fix, please provide a Fixes: tag (I think we're fixing
> the initial driver commit here).

Yeah it is a fix if you consider not following the data sheet a bug.

The same applies to the first patch but it fixes the issue that we
don't setup the PHY correctly.

> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Thanks!

>> ---
>>
>>  Written on top of renesas-drivers-2018-07-17-v4.18-rc5
>
>    Next time please base atop of DaveM's net.git repo.

Yep, will wait a while to see if there is any more feedback before
sending an updated version of the series.

> [...]
>> --- 0003/drivers/net/ethernet/renesas/ravb_main.c
>> +++ work/drivers/net/ethernet/renesas/ravb_main.c     2018-07-19 19:44:14.370607110 +0900
> [...]
>> @@ -1131,13 +1114,6 @@ static int ravb_set_link_ksettings(struc
>>       if (error)
>>               goto error_exit;
>>
>> -     if (cmd->base.duplex == DUPLEX_FULL)
>> -             priv->duplex = 1;
>> -     else
>> -             priv->duplex = 0;
>> -
>> -     ravb_set_duplex(ndev);
>> -
>
>    This fragment no longer exists in net.git...

Yeah will take care of that when I rebase.

Thanks,

/ magnus

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 17:25     ` Magnus Damm
@ 2018-07-19 17:42       ` Geert Uytterhoeven
  2018-07-19 17:56         ` Sergei Shtylyov
  2018-07-20  3:11         ` Magnus Damm
  2018-07-20 11:00       ` Sergei Shtylyov
  1 sibling, 2 replies; 15+ messages in thread
From: Geert Uytterhoeven @ 2018-07-19 17:42 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Sergei Shtylyov, Linux-Renesas

Hi Magnus,

On Thu, Jul 19, 2018 at 7:25 PM Magnus Damm <magnus.damm@gmail.com> wrote:
> On Thu, Jul 19, 2018 at 11:32 PM, Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
> > On 07/19/2018 02:51 PM, Magnus Damm wrote:
> >> From: Magnus Damm <damm+renesas@opensource.se>
> >>
> >> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
> >> and R-Car Gen2 SoCs do not support half duplex operation. So update
> >> the driver to mark 100Mbit HDX as unsupported.
> >
> >    What about 1000Mbit HDX?
>
> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
> while 1 Gbps is HDX-only.

 1 Gbps is _F_DX-only?

> https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 17:42       ` Geert Uytterhoeven
@ 2018-07-19 17:56         ` Sergei Shtylyov
  2018-07-19 20:09           ` Geert Uytterhoeven
  2018-07-20  3:11         ` Magnus Damm
  1 sibling, 1 reply; 15+ messages in thread
From: Sergei Shtylyov @ 2018-07-19 17:56 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm; +Cc: Linux-Renesas

On 07/19/2018 08:42 PM, Geert Uytterhoeven wrote:

>>>> From: Magnus Damm <damm+renesas@opensource.se>
>>>>
>>>> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
>>>> and R-Car Gen2 SoCs do not support half duplex operation. So update
>>>> the driver to mark 100Mbit HDX as unsupported.
>>>
>>>    What about 1000Mbit HDX?
>>
>> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
>> while 1 Gbps is HDX-only.
> 
>  1 Gbps is _F_DX-only?

   No, only higher speeds are FDX only.

>> https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair
> 
> Gr{oetje,eeting}s,
> 
>                         Geert

MBR, Sergei

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 17:56         ` Sergei Shtylyov
@ 2018-07-19 20:09           ` Geert Uytterhoeven
  2018-07-20  3:08             ` Magnus Damm
  0 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2018-07-19 20:09 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Magnus Damm, Linux-Renesas

Hi Sergei,

On Thu, Jul 19, 2018 at 7:56 PM Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 07/19/2018 08:42 PM, Geert Uytterhoeven wrote:
> >>>> From: Magnus Damm <damm+renesas@opensource.se>
> >>>> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
> >>>> and R-Car Gen2 SoCs do not support half duplex operation. So update
> >>>> the driver to mark 100Mbit HDX as unsupported.
> >>>
> >>>    What about 1000Mbit HDX?
> >>
> >> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
> >> while 1 Gbps is HDX-only.
> >
> >  1 Gbps is _F_DX-only?
>
>    No, only higher speeds are FDX only.
>
> >> https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair

That wiki page says "However, half-duplex operation for gigabit speed isn't
supported by any existing hardware.".
Running ethtool on a few systems shows that some of them don't support it, while
others do.

I don't have any higher speed Ethernet cards yet (do you? ;-)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 20:09           ` Geert Uytterhoeven
@ 2018-07-20  3:08             ` Magnus Damm
  2018-07-20 11:22               ` Sergei Shtylyov
  0 siblings, 1 reply; 15+ messages in thread
From: Magnus Damm @ 2018-07-20  3:08 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Sergei Shtylyov, Linux-Renesas

Hi Geert,

On Fri, Jul 20, 2018 at 5:09 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Thu, Jul 19, 2018 at 7:56 PM Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> wrote:
>> On 07/19/2018 08:42 PM, Geert Uytterhoeven wrote:
>> >>>> From: Magnus Damm <damm+renesas@opensource.se>
>> >>>> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
>> >>>> and R-Car Gen2 SoCs do not support half duplex operation. So update
>> >>>> the driver to mark 100Mbit HDX as unsupported.
>> >>>
>> >>>    What about 1000Mbit HDX?
>> >>
>> >> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
>> >> while 1 Gbps is HDX-only.
>> >
>> >  1 Gbps is _F_DX-only?
>>
>>    No, only higher speeds are FDX only.
>>
>> >> https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair
>
> That wiki page says "However, half-duplex operation for gigabit speed isn't
> supported by any existing hardware.".

Exactly. Also the PHY data sheet might have some additional
information about bitmaps for advertised and supported modes.

> Running ethtool on a few systems shows that some of them don't support it, while
> others do.

Amen. Nice to see that at least someone else is using ethtool to test
link configuration. =/

Thanks,

/ magnus

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 17:42       ` Geert Uytterhoeven
  2018-07-19 17:56         ` Sergei Shtylyov
@ 2018-07-20  3:11         ` Magnus Damm
  1 sibling, 0 replies; 15+ messages in thread
From: Magnus Damm @ 2018-07-20  3:11 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Sergei Shtylyov, Linux-Renesas

Hi Geert,

On Fri, Jul 20, 2018 at 2:42 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> Hi Magnus,
>
> On Thu, Jul 19, 2018 at 7:25 PM Magnus Damm <magnus.damm@gmail.com> wrote:
>> On Thu, Jul 19, 2018 at 11:32 PM, Sergei Shtylyov
>> <sergei.shtylyov@cogentembedded.com> wrote:
>> > On 07/19/2018 02:51 PM, Magnus Damm wrote:
>> >> From: Magnus Damm <damm+renesas@opensource.se>
>> >>
>> >> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
>> >> and R-Car Gen2 SoCs do not support half duplex operation. So update
>> >> the driver to mark 100Mbit HDX as unsupported.
>> >
>> >    What about 1000Mbit HDX?
>>
>> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
>> while 1 Gbps is HDX-only.
>
>  1 Gbps is _F_DX-only?

Correct, typo from my side! It should be 1 Gbps FDX-only.

Cheers,

/ magnus

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-19 17:25     ` Magnus Damm
  2018-07-19 17:42       ` Geert Uytterhoeven
@ 2018-07-20 11:00       ` Sergei Shtylyov
  1 sibling, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2018-07-20 11:00 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Linux-Renesas

On 07/19/2018 08:25 PM, Magnus Damm wrote:

>>> From: Magnus Damm <damm+renesas@opensource.se>
>>>
>>> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
>>> and R-Car Gen2 SoCs do not support half duplex operation. So update
>>> the driver to mark 100Mbit HDX as unsupported.
>>
>>    What about 1000Mbit HDX?
> 
> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
> while 1 Gbps is HDX-only.

   Are we limited to TP?

> https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair
> 
>>> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>>> ---
>>>
>>>  Written on top of renesas-drivers-2018-07-17-v4.18-rc5
>>>
>>>  drivers/net/ethernet/renesas/ravb_main.c |    4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> --- 0001/drivers/net/ethernet/renesas/ravb_main.c
>>> +++ work/drivers/net/ethernet/renesas/ravb_main.c     2018-07-19 19:18:38.210607110 +0900
>>> @@ -1066,8 +1066,8 @@ static int ravb_phy_init(struct net_devi
>>>               netdev_info(ndev, "limited PHY to 100Mbit/s\n");
>>>       }
>>>
>>> -     /* 10BASE is not supported */
>>> -     phydev->supported &= ~PHY_10BT_FEATURES;
>>> +     /* Nether 10BASE nor half duplex is supported */
>>
>>    Neither. s/is/are/?
>>
>>> +     phydev->supported &= ~(PHY_10BT_FEATURES | SUPPORTED_100baseT_Half);
>>
>>    I think you missed SUPPORTED_1000baseT_Half.
> 
> Perhaps so, but in reality all our boards use a PHY with Twisted Pair

   I don't think we should limit ourselves to the development boards...

> cables so SUPPORTED_1000baseT_Half doesn't exist in reality. That
> aside, I suspect the PHY layer is designed to support more than just
> Ethernet-over-TP so that's the reason for that particular constant and
> all the other stuff in phy.h.

   Yes, probably. I'd like the code to be formally correct, so you need
also to mask off 1000Gbit HDX.

>> [garbage skipped]
> 
> You mean the rest of the driver? =)

   Naw. Some other mail got attached at the end of this patch -- probably,
it's just me... :-)
 
> Cheers,
> 
> / magnus

MBR, Sergei

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

* Re: [PATCH/RFC 02/02] ravb: Clean up duplex handling
  2018-07-19 17:30     ` Magnus Damm
@ 2018-07-20 11:06       ` Sergei Shtylyov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2018-07-20 11:06 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Linux-Renesas

On 07/19/2018 08:30 PM, Magnus Damm wrote:

>>> From: Magnus Damm <damm+renesas@opensource.se>
>>>
>>> Since only full-duplex operation is supported by the
>>> hardware, remove duplex handling code and keep the
>>> register setting of ECMR.DM fixed at 1.
>>>
>>> This updates the driver implementation to follow the
>>> data sheet text "This bit should always be set to 1."
>>>
>>> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>>
>>    Sounds like a fix, please provide a Fixes: tag (I think we're fixing
>> the initial driver commit here).
> 
> Yeah it is a fix if you consider not following the data sheet a bug.

   Trying to support a non-working feature seems to be a bug...

> The same applies to the first patch but it fixes the issue that we
> don't setup the PHY correctly.

   Yes.

>> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> Thanks!

   My duty as the official reviewer. :-)

[...]

MBR, Sergei

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

* Re: [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported
  2018-07-20  3:08             ` Magnus Damm
@ 2018-07-20 11:22               ` Sergei Shtylyov
  0 siblings, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2018-07-20 11:22 UTC (permalink / raw)
  To: Magnus Damm, Geert Uytterhoeven; +Cc: Linux-Renesas

On 07/20/2018 06:08 AM, Magnus Damm wrote:

>>>>>>> From: Magnus Damm <damm+renesas@opensource.se>
>>>>>>> According to the data sheet the Ethernet-AVB hardware in R-Car Gen3
>>>>>>> and R-Car Gen2 SoCs do not support half duplex operation. So update
>>>>>>> the driver to mark 100Mbit HDX as unsupported.
>>>>>>
>>>>>>    What about 1000Mbit HDX?
>>>>>
>>>>> For Twister Pair I believe 10 and 100 Mbps come in HDX and FDX flavors
>>>>> while 1 Gbps is HDX-only.
>>>>
>>>>  1 Gbps is _F_DX-only?
>>>
>>>    No, only higher speeds are FDX only.
>>>
>>>>> https://en.wikipedia.org/wiki/Ethernet_over_twisted_pair
>>
>> That wiki page says "However, half-duplex operation for gigabit speed isn't
>> supported by any existing hardware.".
> 
> Exactly. Also the PHY data sheet might have some additional
> information about bitmaps for advertised and supported modes.

   Indeed. KSZ9031MNX PHY seems to support 1000Mbit Half-duplex, judging on its
datasheet...

[...]

> Thanks,
> 
> / magnus

MBR, Sergei

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

end of thread, other threads:[~2018-07-20 12:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19 11:50 [PATCH/RFC 00/02] ravb: Duplex handling update Magnus Damm
2018-07-19 11:51 ` [PATCH/RFC 01/02] ravb: Do not announce 100Mbps HDX as supported Magnus Damm
2018-07-19 14:32   ` Sergei Shtylyov
2018-07-19 17:25     ` Magnus Damm
2018-07-19 17:42       ` Geert Uytterhoeven
2018-07-19 17:56         ` Sergei Shtylyov
2018-07-19 20:09           ` Geert Uytterhoeven
2018-07-20  3:08             ` Magnus Damm
2018-07-20 11:22               ` Sergei Shtylyov
2018-07-20  3:11         ` Magnus Damm
2018-07-20 11:00       ` Sergei Shtylyov
2018-07-19 11:51 ` [PATCH/RFC 02/02] ravb: Clean up duplex handling Magnus Damm
2018-07-19 15:44   ` Sergei Shtylyov
2018-07-19 17:30     ` Magnus Damm
2018-07-20 11:06       ` Sergei Shtylyov

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.