From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
netdev@vger.kernel.org, "Paolo Abeni" <pabeni@redhat.com>,
"Daniel Golle" <daniel@makrotopia.org>,
"Marek Behún" <kabel@kernel.org>
Subject: [PATCH net-next 0/7] net: sfp: add support for control of rate selection
Date: Wed, 17 May 2023 11:37:01 +0100 [thread overview]
Message-ID: <ZGSuTY8GqjM+sqta@shell.armlinux.org.uk> (raw)
Hi,
This series introduces control of the rate selection SFP pins (or
their soft state in the I2C diagnostics EEPROM). Several SNIA documents
(referenced in the commits) describe the various different modes for
these, and we implement them all for maximum compatibility, but as
we know, SFP modules tend to do their own thing, so that may not be
sufficient.
In order to implement this, we need to change the locking arrangement
in the SFP layer - we need to make st_mutex (state mutex) able to be
taken from within the rtnl lock and sm_mutex (state machine mutex).
Essentially, st_mutex protects the hard (gpio) and soft state signals.
So, patches 2 through 5 rejig the locking so that st_mutex is only
ever taken when we want to fiddle with the signal state variables,
read or write the GPIOs, or read or write the soft state.
Patch 1 adds a helper that makes the locking rejig a little easier
as it combines the update of sfp->state with setting the updated
control state to the module.
Patch 6 adds code to phylink to give the signalling rate for various
PHY interface modes that are relevant to SFPs - this is the baud rate
of the encoded signal, not the data rate, which is what matters for
SFPs. This rate is passed through the SFP bus layer into the SFP
socket driver, which initially has a stub sfp_set_signal_rate().
Patch 7 adds the code to the SFP socket driver to parse the rate
selection data in the EEPROM, configure which RS signals need to be
driven, and the signalling rate threshold. We fill in
sfp_set_signal_rate() to set the rate select pins as appropriate.
Thanks to Simon for reviewing.
drivers/net/phy/phylink.c | 24 ++++
drivers/net/phy/sfp-bus.c | 20 +++
drivers/net/phy/sfp.c | 310 ++++++++++++++++++++++++++++++++++++++--------
drivers/net/phy/sfp.h | 1 +
include/linux/sfp.h | 14 +++
5 files changed, 317 insertions(+), 52 deletions(-)
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next reply other threads:[~2023-05-17 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-17 10:37 Russell King (Oracle) [this message]
2023-05-17 10:37 ` [PATCH net-next 1/7] net: sfp: add helper to modify signal states Russell King (Oracle)
2023-05-17 10:37 ` [PATCH net-next 2/7] net: sfp: move rtnl lock to cover reading state Russell King (Oracle)
2023-05-17 10:37 ` [PATCH net-next 3/7] net: sfp: swap order of rtnl and st_mutex locks Russell King (Oracle)
2023-05-17 10:38 ` [PATCH net-next 4/7] net: sfp: move sm_mutex into sfp_check_state() Russell King (Oracle)
2023-05-17 10:38 ` [PATCH net-next 5/7] net: sfp: change st_mutex locking Russell King (Oracle)
2023-05-17 10:38 ` [PATCH net-next 6/7] net: sfp: add support for setting signalling rate Russell King (Oracle)
2023-05-17 10:38 ` [PATCH net-next 7/7] net: sfp: add support for rate selection Russell King (Oracle)
2023-05-17 15:52 ` Andrew Lunn
2023-05-19 3:00 ` [PATCH net-next 0/7] net: sfp: add support for control of " 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=ZGSuTY8GqjM+sqta@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).