generic: 6.18: backport SFP I2C presence detection without MOD_DEF0 GPIO
Backport upstream net-next commit
8ac44d24c3a1. An SFP cage whose MOD_DEF0
signal is not wired to a readable GPIO currently uses sff_gpio_get_state(),
which always reports the module present: an empty cage gets stuck in
MOD_ERROR, hot-insertion is never detected and empty cages spam -EIO at
boot. Derive presence from a throttled single-byte I2C read of the module
EEPROM instead, so hot-plug works and the boot spam stops. A soldered-down
"sff,sff" module stays always-present.
This helps RTL93xx SFP boards that route no cage presence signal to a GPIO.
Remaining sfp.c patches refreshed.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=8ac44d24c3a1
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/23836
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>