linux_dsm_epyc7002/drivers/net/phy
Pali Rohár 2064bba25a net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips
[ Upstream commit 426c6cbc409cbda9ab1a9dbf15d3c2ef947eb8c1 ]

The workaround for VSOL V2801F brand based GPON SFP modules added in commit
0d035bed2a4a ("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0
workaround") works only for IDs added explicitly to the list. Since there
are rebranded modules where OEM vendors put different strings into the
vendor name field, we cannot base workaround on IDs only.

Moreover the issue which the above mentioned commit tried to work around is
generic not only to VSOL based modules, but rather to all GPON modules
based on Realtek RTL8672 and RTL9601C chips.

These include at least the following GPON modules:
* V-SOL V2801F
* C-Data FD511GX-RM0
* OPTON GP801R
* BAUDCOM BD-1234-SFM
* CPGOS03-0490 v2.0
* Ubiquiti U-Fiber Instant
* EXOT EGS1

These Realtek chips have broken EEPROM emulator which for N-byte read
operation returns just the first byte of EEPROM data, followed by N-1
zeros.

Introduce a new function, sfp_id_needs_byte_io(), which detects SFP modules
with broken EEPROM emulator based on N-1 zeros and switch to 1 byte EEPROM
reading operation.

Function sfp_i2c_read() now always uses single byte reading when it is
required and when function sfp_hwmon_probe() detects single byte access,
it disables registration of hwmon device, because in this case we cannot
reliably and atomically read 2 bytes as is required by the standard for
retrieving values from diagnostic area.

(These Realtek chips are broken in a way that violates SFP standards for
diagnostic interface. Kernel in this case simply cannot do anything less
of skipping registration of the hwmon interface.)

This patch fixes reading of EEPROM content from SFP modules based on
Realtek RTL8672 and RTL9601C chips. Diagnostic interface of EEPROM stays
broken and cannot be fixed.

Fixes: 0d035bed2a4a ("net: sfp: VSOL V2801F / CarlitoxxPro CPGOS03-0490 v2.0 workaround")
Co-developed-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-07 12:34:17 +01:00
..
mscc net: phy: mscc: adding LCPLL reset to VSC8514 2021-03-04 11:37:35 +01:00
adin.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
amd.c
aquantia_hwmon.c
aquantia_main.c
aquantia.h
at803x.c net: phy: at803x: constify static regulator_ops 2020-08-26 16:21:17 -07:00
ax88796b.c
bcm7xxx.c net: phy: bcm7xxx: Add an entry for BCM72113 2020-09-21 17:16:17 -07:00
bcm63xx.c
bcm87xx.c net: mdiobus: add clause 45 mdiobus accessors 2020-05-26 15:31:45 -07:00
bcm54140.c net: phy: bcm54140: add cable diagnostics support 2020-05-13 12:52:39 -07:00
bcm84881.c
bcm-cygnus.c
bcm-phy-lib.c net: phy: broadcom: don't export RDB/legacy access methods 2020-06-01 12:02:57 -07:00
bcm-phy-lib.h net: phy: broadcom: add cable test support 2020-05-13 12:52:38 -07:00
broadcom.c net: phy: broadcom: fix checkpatch complains about tabs 2020-05-16 13:38:33 -07:00
cicada.c
cortina.c net: mdiobus: add clause 45 mdiobus accessors 2020-05-26 15:31:45 -07:00
davicom.c
dp83tc811.c
dp83640_reg.h
dp83640.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-04 21:28:59 -07:00
dp83822.c net: phy: dp83822: Update the fiber advertisement for speed 2020-09-19 16:54:35 -07:00
dp83848.c
dp83867.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-04 21:28:59 -07:00
dp83869.c net: phy: dp83869: fix unsigned comparisons against less than zero values 2020-10-03 17:08:32 -07:00
et1011c.c
fixed_phy.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
icplus.c
intel-xway.c
Kconfig mdio: fix mdio-thunder.c dependency & build error 2020-09-27 13:21:28 -07:00
linkmode.c
lxt.c
Makefile net: phy: Sort Kconfig and Makefile 2020-08-27 06:55:51 -07:00
marvell10g.c net: phy: marvell10g: fix null pointer dereference 2020-08-11 15:42:23 -07:00
marvell.c net: phy: marvell: Use phy_read_paged() instead of open coding it 2020-10-05 06:12:10 -07:00
mdio_bus.c net: mdiobus: Remove WARN_ON_ONCE(in_interrupt()) 2020-09-29 14:02:54 -07:00
mdio_device.c net: mdio device: use flexible sleeping in reset function 2020-08-03 15:01:02 -07:00
mdio_devres.c of: mdio: provide devm_of_mdiobus_register() 2020-06-30 15:57:34 -07:00
mdio-boardinfo.c net: phy: Fixup parameters in kerneldoc 2020-07-07 12:47:10 -07:00
mdio-boardinfo.h
meson-gxl.c
micrel.c net: phy: mchp: Add support for LAN8814 QUAD PHY 2020-09-11 17:41:55 -07:00
microchip_t1.c
microchip.c
mii_timestamper.c
national.c
nxp-tja11xx.c net: ethtool: Add generic parts of cable test TDR 2020-05-26 23:21:48 -07:00
phy_device.c net: phy: consider that suspend2ram may cut off PHY power 2021-03-04 11:37:31 +01:00
phy_led_triggers.c
phy-c45.c net: phy: split devices_in_package 2020-06-19 20:17:15 -07:00
phy-core.c net: phy: Document core PHY structures 2020-09-23 18:02:49 -07:00
phy.c net: phy: Document core PHY structures 2020-09-23 18:02:49 -07:00
phylink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-09-04 21:28:59 -07:00
qsemi.c
realtek.c net: phy: realtek: support paged operations on RTL8201CP 2020-11-10 16:11:39 -08:00
rockchip.c
sfp-bus.c net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant 2021-03-07 12:34:10 +01:00
sfp.c net: sfp: add workaround for Realtek RTL8672 and RTL9601C chips 2021-03-07 12:34:17 +01:00
sfp.h
smsc.c net: phy: smsc: fix clk error handling 2021-01-23 16:04:03 +01:00
spi_ks8995.c net: Use kobj_to_dev() API 2020-09-28 15:14:42 -07:00
ste10Xp.c
swphy.c
swphy.h
teranetics.c
uPD60620.c
vitesse.c
xilinx_gmii2rgmii.c