netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/17] Allow slow to initialise GPON modules to work
@ 2019-11-10 14:05 Russell King - ARM Linux admin
  2019-11-10 14:06 ` [PATCH net-next 01/17] net: sfp: move sfp sub-state machines into separate functions Russell King
                   ` (18 more replies)
  0 siblings, 19 replies; 32+ messages in thread
From: Russell King - ARM Linux admin @ 2019-11-10 14:05 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Heiner Kallweit; +Cc: David S. Miller, netdev

Some GPON modules take longer than the SFF MSA specified time to
initialise and respond to transactions on the I2C bus for either
both 0x50 and 0x51, or 0x51 bus addresses.  Technically these modules
are non-compliant with the SFP Multi-Source Agreement, they have
been around for some time, so are difficult to just ignore.

Most of the patch series is restructuring the code to make it more
readable, and split various things into separate functions.

We split the three state machines into three separate functions, and
re-arrange them to start probing the module as soon as a module has
been detected (without waiting for the network device.)  We try to
read the module's EEPROM, retrying quickly for the first second, and
then once every five seconds for about a minute until we have read
the EEPROM.  So that the kernel isn't entirely silent, we print a
message indicating that we're waiting for the module to respond after
the first second, or when all retries have expired.

Once the module ID has been read, we kick off a delayed work queue
which attempts to register the hwmon, retrying for up to a minute if
the monitoring parameters are unreadable; this allows us to proceed
with module initialisation independently of the hwmon state.

With high-power modules, we wait for the netdev to be attached before
switching the module power mode, and retry this in a similar way to
before until we have successfully read and written the EEPROM at 0x51.

We also move the handling of the TX_DISABLE signal entirely to the main
state machine, and avoid probing any on-board PHY while TX_FAULT is
set.

 drivers/net/phy/sfp.c | 526 +++++++++++++++++++++++++++++++++++---------------
 1 file changed, 369 insertions(+), 157 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2019-11-12  0:18 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-10 14:05 [PATCH net-next 00/17] Allow slow to initialise GPON modules to work Russell King - ARM Linux admin
2019-11-10 14:06 ` [PATCH net-next 01/17] net: sfp: move sfp sub-state machines into separate functions Russell King
2019-11-10 17:56   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 02/17] net: sfp: move tx disable on device down to main state machine Russell King
2019-11-10 18:00   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 03/17] net: sfp: rename sfp_sm_ins_next() as sfp_sm_mod_next() Russell King
2019-11-10 18:01   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 04/17] net: sfp: handle module remove outside state machine Russell King
2019-11-10 18:07   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 05/17] net: sfp: rename T_PROBE_WAIT to T_SERIAL Russell King
2019-11-10 18:08   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 06/17] net: sfp: parse SFP power requirement earlier Russell King
2019-11-10 18:10   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 07/17] net: sfp: avoid power switch on address-change modules Russell King
2019-11-10 18:12   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 08/17] net: sfp: control TX_DISABLE and phy only from main state machine Russell King
2019-11-10 18:14   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 09/17] net: sfp: split the PHY probe from sfp_sm_mod_init() Russell King
2019-11-10 18:19   ` Andrew Lunn
2019-11-10 14:06 ` [PATCH net-next 10/17] net: sfp: eliminate mdelay() from PHY probe Russell King
2019-11-10 19:37   ` Andrew Lunn
2019-11-10 19:59     ` Russell King - ARM Linux admin
2019-11-10 14:07 ` [PATCH net-next 11/17] net: sfp: allow fault processing to transition to other states Russell King
2019-11-10 14:07 ` [PATCH net-next 12/17] net: sfp: ensure TX_FAULT has deasserted before probing the PHY Russell King
2019-11-10 14:07 ` [PATCH net-next 13/17] net: sfp: track upstream's attachment state in state machine Russell King
2019-11-10 14:07 ` [PATCH net-next 14/17] net: sfp: split power mode switching from probe Russell King
2019-11-10 14:07 ` [PATCH net-next 15/17] net: sfp: move module insert reporting out of probe Russell King
2019-11-10 14:07 ` [PATCH net-next 16/17] net: sfp: allow sfp to probe slow to initialise GPON modules Russell King
2019-11-10 14:07 ` [PATCH net-next 17/17] net: sfp: allow modules with slow diagnostics to probe Russell King
2019-11-10 17:52 ` [PATCH net-next 00/17] Allow slow to initialise GPON modules to work Andrew Lunn
2019-11-10 19:47   ` Russell King - ARM Linux admin
2019-11-12  0:18 ` David Miller

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