netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH net-next v3 4/5] net: phy: marvell10g: change MACTYPE if underlying MAC does not support it
Date: Mon, 16 Nov 2020 16:56:34 +0100	[thread overview]
Message-ID: <20201116165634.5a5bb2e0@kernel.org> (raw)
In-Reply-To: <20201116150216.GK1551@shell.armlinux.org.uk>

On Mon, 16 Nov 2020 15:02:16 +0000
Russell King - ARM Linux admin <linux@armlinux.org.uk> wrote:

> On Mon, Nov 16, 2020 at 03:45:52PM +0100, Marek Behún wrote:
> > Hi Russell,
> > 
> > previously you replied on this patch:
> >   
> > > This'll do as a stop-gap until we have a better way to determine which
> > > MACTYPE mode we should be using.  
> > 
> > Can we consider this as Acked-by ?  
> 
> Not really.
> 
> The selection of MACTYPE isn't as simple as you make out in this patch.

Hi Russell,

I know that. The idea behind this patch is to add support for at least
something (for MACs supporting 1G/2.5G, but not 10G) in a simple way.
Full support can be added later, since it requires changes into other
subsystems (the experimental patches in your repo).

The question therefore IMO is whether this will introduce regression or
not.

> If we know that the MAC supports 2500BASE-X and/or SGMII, that means
> MACTYPES 0, 3, 4, 5 are possible to fit that, all likely will work if
> we restrict the PHY to either 2.5G only or 1G..10M only. However, it
> only becomes important if the faster speeds are supported at the MAC.

OK, but by applying this patch a regression could possibly occur only
if (and shouldn't anyway, see below):
- MAC supports 10G mode, but only XAUI/RXAUI, not XFI
- mactype is by default set to 1 (XAUI with rate matching) or 2 (RXAUI
  with rate matching) or 7 (USXGMII)
- before config_init, phydev->interface mode is 2500base-x or sgmii

The question is whether someone uses such a configuration and expects
the PHY driver to change phydev->interface.

Anyway a regression should not occur anyway (i.e. this patch should't
break something that did work previously), because even if XAUI/RXAUI
with rate matching or USXGMII was selected by default on the PHY, the
mv3310_update_interface does not support this modes currently
(only 10gbase-r, 2500base-x and sgmii).

So unless the MAC driver ignores the changed phydev->interface, this
patch should not break anything.

If it does cause a regression in spite of the points above, we can
condition the mactype change to occur only if the mactype before the
change was 6 (XFI with rate matching).
Or map the change like so:
  1 -> 3   XAUI with RM ->  XAUI/5gbase-r/2500base-x/SGMII
  2 -> 0  RXAUI with RM -> RXAUI/5gbase-r/2500base-x/SGMII
  6 -> 4    XFI with RM ->   XFI/5gbase-r/2500base-x/SGMII

I can put these thought into the commit message, if requested.

> I'm afraid I haven't put much thought into how to solve it, and as I'm
> totally demotivated at the moment, that's unlikely to change.

I am sorry to hear that, Russell :-(

Usually for me a lack of motivation is caused by bad mood (and also
vice-versa, so this can result in a self-feeding loop).

What I found that helps me with this is a good book to read.
If you are open to suggestions, the (IMO) best book I ever read is
Harry Potter and the Methods of Rationality (it's for free and online).

Marek

  reply	other threads:[~2020-11-16 15:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 11:15 [PATCH net-next v3 0/5] Support for RollBall 10G copper SFP modules Marek Behún
2020-11-16 11:15 ` [PATCH net-next v3 1/5] net: phy: mdio-i2c: support I2C MDIO protocol for RollBall " Marek Behún
2020-11-16 11:15 ` [PATCH net-next v3 2/5] net: phylink: allow attaching phy for SFP modules on 802.3z mode Marek Behún
2020-11-16 11:15 ` [PATCH net-next v3 3/5] net: sfp: create/destroy I2C mdiobus before PHY probe/after PHY release Marek Behún
2020-11-16 11:15 ` [PATCH net-next v3 4/5] net: phy: marvell10g: change MACTYPE if underlying MAC does not support it Marek Behún
2020-11-16 12:18   ` Marek Behún
2020-11-16 14:45   ` Marek Behún
2020-11-16 15:02     ` Russell King - ARM Linux admin
2020-11-16 15:56       ` Marek Behún [this message]
2020-11-16 11:15 ` [PATCH net-next v3 5/5] net: sfp: add support for multigig RollBall transceivers Marek Behún

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=20201116165634.5a5bb2e0@kernel.org \
    --to=kabel@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --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 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).