All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kamil Horák, 2N" <kamilh@axis.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH v3 1/3] net: phy: bcm54811: New link mode for BroadR-Reach
Date: Fri, 24 May 2024 12:40:39 +0200	[thread overview]
Message-ID: <ed59ba76-ea86-4007-9b53-ebeb02951b34@axis.com> (raw)
In-Reply-To: <1188b119-1191-4afa-8381-d022d447086c@lunn.ch>


On 5/23/24 16:27, Andrew Lunn wrote:
>>> ethtool -s eth42 autoneg off linkmode 1BR10
>> This sounds perfect to me. The second (shorter) way is better because, at
>> least with BCM54811, given the link mode, the duplex and speed are also
>> determined. All BroadR-Reach link modes are full duplex, anyway.
> Great.
>
>>> You can probably add a new member to ethtool_link_ksettings to pass it
>>> to phylib. From there, it probably needs putting into a phy_device
>>> member, next to speed and duplex. The PHY driver can then use it to
>>> configure the hardware.
>> I did not dare to cut this deep so far, but as I see there is a demand,
>> let's go for it!
> It also seems quite a generic feature. e.g. to select between
> 1000BaseT_FULL and 1000BaseT1_FULL. So it should get reused for other
> use cases.
>
>>> 2) Invalid combinations of link modes when auto-neg is
>>> enabled. Probably the first question to answer is, is this specific to
>>> this PHY, or generic across all PHYs which support BR and IEEE
>>> modes. If it is generic, we can add tests in
>>> phy_ethtool_ksettings_set() to return EINVAL. If this is specific to
>>> this PHY, it gets messy. When phylib call phy_start_aneg() to
>>> configure the hardware, it does not expect it to return an error. We
>>> might need to add an additional op to phy_driver to allow the PHY
>>> driver to validate settings when phy_ethtool_ksettings_set() is
>>> called. This would help solve a similar problem with a new mediatek
>>> PHY which is broken with forced modes.
>> Regarding the specificity, it definitely touches the BCM54811 and even more
>> BCM54810, because the ...810 supports autoneg  in BroadR-Reach mode too.
> That was what i did not know. Does 802.3 allow auto-neg for these
> BroadR-Reach modes at the same time as 'normal' modes. And it seems
> like the ..810 supports is, and i assume it conforms to 802.3? So we
> cannot globally return an error in ethtool_ksetting_set() with a mix
> or modes, it needs to be the driver which decides.

As far I understand it, the chip is not capable of attempting IEEE and 
BroadR-Reach modes at the same time, not even the BCM54810, which is 
capable of autoneg in BRR. One has to choose IEEE or BRR first then 
start the auto-negotiation (or attempt the link with forced 
master-slave/speed setting for BRR). There are two separate "link is up" 
bits, one if the IEEE registers, second in the BRR one. Theoretically, 
it should be possible to have kind of auto-detection of hardware - for 
example start with IEEE, if there is no link after a timeout, try BRR as 
well. But as for the circuitry necessary to do that, there would have to 
be something like hardware plug-in, as I was told by our HW team. In 
other words, it is not probable to have a device capable of both 
(IEEE+BRR) modes at once. Thus, having the driver to choose from a set 
containing IEEE and BRR modes makes little sense.
Our use case is fixed master/slave and fixed speed (10/100), and BRR on 
1 pair only with BCM54811.  I can imagine autoneg master/slave and 
10/100 in the same physical media (one pair) but that would require 
BCM54810.

Back to the ethtool_ksetting_set(), both BCM54810 and 54811 sure support 
the IEEE modes and this would function even with a generic driver. With 
BRR and no autoneg, it seems that if there is one of 10, 100, 1000 
speeds and half or full duplex, it would be sufficient to have 
config_aneg method of the phy driver implemented correctly to do the 
thing (start IEEE (generic) or BRR auto-negotiation, which would include 
set up the PHY for selected link mode and wait for the link to appear). 
Not sure about how many other drivers regularly used fit this scheme, it 
seems that vast majority prefers auto-negotiation... However, it could 
be even made so that direct linkmode selection would work everywhere, 
leaving to the phy driver the choice of whether start autoneg with only 
one option or force that option directly when there is no aneg at all 
(BCM54811 in BRR mode).

>
>     Andrew
Kamil

  reply	other threads:[~2024-05-24 10:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 14:40 [PATCH v3 0/3] net: phy: bcm5481x: add support for BroadR-Reach mode Kamil Horák - 2N
2024-05-06 14:40 ` [PATCH v3 1/3] net: phy: bcm54811: New link mode for BroadR-Reach Kamil Horák - 2N
2024-05-06 19:14   ` Andrew Lunn
2024-05-22  7:57     ` Kamil Horák, 2N
     [not found]     ` <96a99806-624c-4fa4-aa08-0d5c306cff25@axis.com>
2024-05-22 14:05       ` Andrew Lunn
2024-05-23 10:23         ` Kamil Horák, 2N
2024-05-23 14:27           ` Andrew Lunn
2024-05-24 10:40             ` Kamil Horák, 2N [this message]
2024-05-25 17:12               ` Andrew Lunn
2024-05-27 11:37                 ` Kamil Horák, 2N
2024-05-27 13:20                   ` Andrew Lunn
2024-05-28 14:47                     ` Kamil Horák, 2N
2024-05-06 19:27   ` Florian Fainelli
2024-05-06 14:40 ` [PATCH v3 2/3] net: phy: bcm54811: Add LRE registers definitions Kamil Horák - 2N
2024-05-06 19:25   ` Florian Fainelli
2024-05-06 19:26   ` Andrew Lunn
2024-05-06 14:40 ` [PATCH v3 3/3] net: phy: bcm-phy-lib: Implement BroadR-Reach link modes Kamil Horák - 2N
2024-05-06 19:35   ` Andrew Lunn
2024-05-06 20:14   ` Christophe JAILLET
2024-05-08  7:39   ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed59ba76-ea86-4007-9b53-ebeb02951b34@axis.com \
    --to=kamilh@axis.com \
    --cc=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.