diff mbox series

[net] ethtool: Fix get module eeprom fallback

Message ID 20220616160856.3623273-1-ivecera@redhat.com (mailing list archive)
State Accepted
Commit a3bb7b63813f674fb62bac321cdd897cc62de094
Delegated to: Netdev Maintainers
Headers show
Series [net] ethtool: Fix get module eeprom fallback | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 6 this patch: 6
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ivan Vecera June 16, 2022, 4:08 p.m. UTC
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(-)

Comments

Ido Schimmel June 17, 2022, 1:16 p.m. UTC | #1
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>
patchwork-bot+netdevbpf@kernel.org June 18, 2022, 3:30 a.m. UTC | #2
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!
diff mbox series

Patch

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;