diff mbox

[PATCH/RFC,01/02] ravb: Do not announce 100Mbps HDX as supported

Message ID 153200106718.13504.7319401547888522726.sendpatchset@little-apple (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Magnus Damm July 19, 2018, 11:51 a.m. UTC
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(-)

Comments

Sergei Shtylyov July 19, 2018, 2:32 p.m. UTC | #1
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
Magnus Damm July 19, 2018, 5:25 p.m. UTC | #2
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
Geert Uytterhoeven July 19, 2018, 5:42 p.m. UTC | #3
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
Sergei Shtylyov July 19, 2018, 5:56 p.m. UTC | #4
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
Geert Uytterhoeven July 19, 2018, 8:09 p.m. UTC | #5
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
Magnus Damm July 20, 2018, 3:08 a.m. UTC | #6
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
Magnus Damm July 20, 2018, 3:11 a.m. UTC | #7
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
Sergei Shtylyov July 20, 2018, 11 a.m. UTC | #8
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
Sergei Shtylyov July 20, 2018, 11:22 a.m. UTC | #9
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
diff mbox

Patch

--- 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);