* [PATCH net] ethtool: Fix get module eeprom fallback
@ 2022-06-16 16:08 Ivan Vecera
2022-06-17 13:16 ` Ido Schimmel
2022-06-18 3:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Ivan Vecera @ 2022-06-16 16:08 UTC (permalink / raw)
To: netdev
Cc: Michal Kubecek, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladyslav Tarasiuk, Andrew Lunn,
open list
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 <idosch@nvidia.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
net/ethtool/eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ethtool/eeprom.c b/net/ethtool/eeprom.c
index 7e6b37a54add..1c94bb8ea03f 100644
--- a/net/ethtool/eeprom.c
+++ b/net/ethtool/eeprom.c
@@ -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;
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] ethtool: Fix get module eeprom fallback
2022-06-16 16:08 [PATCH net] ethtool: Fix get module eeprom fallback Ivan Vecera
@ 2022-06-17 13:16 ` Ido Schimmel
2022-06-18 3:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2022-06-17 13:16 UTC (permalink / raw)
To: Ivan Vecera
Cc: netdev, Michal Kubecek, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vladyslav Tarasiuk, Andrew Lunn,
open list
On Thu, Jun 16, 2022 at 06:08:55PM +0200, Ivan Vecera 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 <idosch@nvidia.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
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.
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] ethtool: Fix get module eeprom fallback
2022-06-16 16:08 [PATCH net] ethtool: Fix get module eeprom fallback Ivan Vecera
2022-06-17 13:16 ` Ido Schimmel
@ 2022-06-18 3:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-18 3:30 UTC (permalink / raw)
To: Ivan Vecera
Cc: netdev, mkubecek, idosch, davem, edumazet, kuba, pabeni,
vladyslavt, andrew, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:
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 <idosch@nvidia.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>
> [...]
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-18 3:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-16 16:08 [PATCH net] ethtool: Fix get module eeprom fallback Ivan Vecera
2022-06-17 13:16 ` Ido Schimmel
2022-06-18 3:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox