netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Robert Hancock <robert.hancock@calian.com>
Cc: hkallweit1@gmail.com, davem@davemloft.net, kuba@kernel.org,
	f.fainelli@gmail.com, linux@armlinux.org.uk,
	bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v4 2/3] net: phy: Add is_on_sfp_module flag and phy_on_sfp helper
Date: Wed, 17 Feb 2021 04:58:26 +0100	[thread overview]
Message-ID: <YCyUYqPt1X37bqpI@lunn.ch> (raw)
In-Reply-To: <20210216225454.2944373-3-robert.hancock@calian.com>

On Tue, Feb 16, 2021 at 04:54:53PM -0600, Robert Hancock wrote:
> Add a flag and helper function to indicate that a PHY device is part of
> an SFP module, which is set on attach. This can be used by PHY drivers
> to handle SFP-specific quirks or behavior.
> 
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> ---
>  drivers/net/phy/phy_device.c |  2 ++
>  include/linux/phy.h          | 11 +++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 05261698bf74..d6ac3ed38197 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1377,6 +1377,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
>  
>  		if (phydev->sfp_bus_attached)
>  			dev->sfp_bus = phydev->sfp_bus;
> +		else if (dev->sfp_bus)
> +			phydev->is_on_sfp_module = true;

I get lost here. It this correct?

We have setups with two PHY. The marvell10g PHY can play the role of
media converter. It converts the signal from the MAC into signals
which can be connected to an SFP cage.

And then inside the cage, we can have a copper module with a second
PHY. It is this second PHY which we need to indicate is_on_sfp_module
true.

We probably want to media convert PHYs LEDs to work, since those
possible are connected to the front panel. So this needs to be
specific to the SFP module PHY, and i'm not sure it is. Russell?

	Andrew

  reply	other threads:[~2021-02-17  3:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 22:54 [PATCH net-next v4 0/3] Broadcom PHY driver updates Robert Hancock
2021-02-16 22:54 ` [PATCH net-next v4 1/3] net: phy: broadcom: Set proper 1000BaseX/SGMII interface mode for BCM54616S Robert Hancock
2021-02-16 22:54 ` [PATCH net-next v4 2/3] net: phy: Add is_on_sfp_module flag and phy_on_sfp helper Robert Hancock
2021-02-17  3:58   ` Andrew Lunn [this message]
2021-02-17 10:34     ` Russell King - ARM Linux admin
2021-02-17 20:21       ` Florian Fainelli
2021-02-16 22:54 ` [PATCH net-next v4 3/3] net: phy: broadcom: Do not modify LED configuration for SFP module PHYs Robert Hancock
2021-02-16 23:30 ` [PATCH net-next v4 0/3] Broadcom PHY driver updates patchwork-bot+netdevbpf

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=YCyUYqPt1X37bqpI@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=robert.hancock@calian.com \
    /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).