]> git.ipfire.org Git - thirdparty/linux.git/commit
ixgbe: Fix unreachable retry logic in combined and byte I2C write functions
authorRand Deeb <rand.sec96@gmail.com>
Thu, 6 Mar 2025 10:12:00 +0000 (13:12 +0300)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 11 Apr 2025 18:58:58 +0000 (11:58 -0700)
commitcdcb3804eeda24d588348bbab6766cf14fddbeaa
tree0e95d1bb86aa199127c070e7198fd3d53864deab
parent015bac5daca978448f2671478c553ce1f300c21e
ixgbe: Fix unreachable retry logic in combined and byte I2C write functions

The current implementation of `ixgbe_write_i2c_combined_generic_int` and
`ixgbe_write_i2c_byte_generic_int` sets `max_retry` to `1`, which makes
the condition `retry < max_retry` always evaluate to `false`. This renders
the retry mechanism ineffective, as the debug message and retry logic are
never executed.

This patch increases `max_retry` to `3` in both functions, aligning them
with the retry logic in `ixgbe_read_i2c_combined_generic_int`. This
ensures that the retry mechanism functions as intended, improving
robustness in case of I2C write failures.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Rand Deeb <rand.sec96@gmail.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c