Skip to contentSkip to conversation

ethtool: Fix get module eeprom fallback

PATCH Applied Ivan Vecera 3 participants 3 messages Jun 16, 2022 – Jun 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethtool: Fix get module eeprom fallback

Function fallback_set_params() checks if the module type returned by a driver is ETH_MODULE_SFF_8079 and in this case it assumes that buffer returns a concatenated content of page A0h and A2h. The check is wrong because the correct type is ETH_MODULE_SFF_8472.

Fixes 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command")
Cc Ido Schimmel <[email protected]>
---
 net/ethtool/eeprom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ethtool/eeprom.c +1 -1
index 7e6b37a54add..1c94bb8ea03f 100644
@@ -36,7 +36,7 @@ static int fallback_set_params(struct eeprom_req_info *request,
 	if (request->page)
 		offset = request->page * ETH_MODULE_EEPROM_PAGE_LEN + offset;
 
-	if (modinfo->type == ETH_MODULE_SFF_8079 &&
+	if (modinfo->type == ETH_MODULE_SFF_8472 &&
 	    request->i2c_address == 0x51)
 		offset += ETH_MODULE_EEPROM_PAGE_LEN * 2;
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ivan Vecera

Function fallback_set_params() checks if the module type returned by a driver is ETH_MODULE_SFF_8079 and in this case it assumes that buffer returns a concatenated content of page A0h and A2h. The check is wrong because the correct type is ETH_MODULE_SFF_8472.

Fixes 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command")
Cc Ido Schimmel <[email protected]>

All the drivers that report ETH_MODULE_SFF_8079 also report a length of ETH_MODULE_SFF_8079_LEN, which means they are only accessing I2C address 0x50.

#2 lore raw
In reply to Ivan Vecera
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 16 Jun 2022 18:08:55 +0200 you wrote:

Function fallback_set_params() checks if the module type returned by a driver is ETH_MODULE_SFF_8079 and in this case it assumes that buffer returns a concatenated content of page A0h and A2h. The check is wrong because the correct type is ETH_MODULE_SFF_8472.

Fixes 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command")
Cc Ido Schimmel <[email protected]>

[...]

Here is the summary with links:
- [net] ethtool: Fix get module eeprom fallback

    https://git.kernel.org/netdev/net/c/a3bb7b63813f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html