Skip to content

Commit fb4903b

Browse files
Jakub Staniszewskianguy11
authored andcommitted
ice: fix retry for AQ command 0x06EE
Executing ethtool -m can fail reporting a netlink I/O error while firmware link management holds the i2c bus used to communicate with the module. According to Intel(R) Ethernet Controller E810 Datasheet Rev 2.8 [1] Section 3.3.10.4 Read/Write SFF EEPROM (0x06EE) request should to be retried upon receiving EBUSY from firmware. Commit e9c9692 ("ice: Reimplement module reads used by ethtool") implemented it only for part of ice_get_module_eeprom(), leaving all other calls to ice_aq_sff_eeprom() vulnerable to returning early on getting EBUSY without retrying. Remove the retry loop from ice_get_module_eeprom() and add Admin Queue (AQ) command with opcode 0x06EE to the list of commands that should be retried on receiving EBUSY from firmware. Cc: [email protected] Fixes: e9c9692 ("ice: Reimplement module reads used by ethtool") Signed-off-by: Jakub Staniszewski <[email protected]> Co-developed-by: Dawid Osuchowski <[email protected]> Signed-off-by: Dawid Osuchowski <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Link: https://www.intel.com/content/www/us/en/content-details/613875/intel-ethernet-controller-e810-datasheet.html [1] Reviewed-by: Paul Menzel <[email protected]> Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 326256c commit fb4903b

2 files changed

Lines changed: 15 additions & 21 deletions

File tree

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,7 @@ static bool ice_should_retry_sq_send_cmd(u16 opcode)
18161816
case ice_aqc_opc_lldp_stop:
18171817
case ice_aqc_opc_lldp_start:
18181818
case ice_aqc_opc_lldp_filter_ctrl:
1819+
case ice_aqc_opc_sff_eeprom:
18191820
return true;
18201821
}
18211822

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4509,7 +4509,7 @@ ice_get_module_eeprom(struct net_device *netdev,
45094509
u8 addr = ICE_I2C_EEPROM_DEV_ADDR;
45104510
struct ice_hw *hw = &pf->hw;
45114511
bool is_sfp = false;
4512-
unsigned int i, j;
4512+
unsigned int i;
45134513
u16 offset = 0;
45144514
u8 page = 0;
45154515
int status;
@@ -4551,26 +4551,19 @@ ice_get_module_eeprom(struct net_device *netdev,
45514551
if (page == 0 || !(data[0x2] & 0x4)) {
45524552
u32 copy_len;
45534553

4554-
/* If i2c bus is busy due to slow page change or
4555-
* link management access, call can fail. This is normal.
4556-
* So we retry this a few times.
4557-
*/
4558-
for (j = 0; j < 4; j++) {
4559-
status = ice_aq_sff_eeprom(hw, 0, addr, offset, page,
4560-
!is_sfp, value,
4561-
SFF_READ_BLOCK_SIZE,
4562-
0, NULL);
4563-
netdev_dbg(netdev, "SFF %02X %02X %02X %X = %02X%02X%02X%02X.%02X%02X%02X%02X (%X)\n",
4564-
addr, offset, page, is_sfp,
4565-
value[0], value[1], value[2], value[3],
4566-
value[4], value[5], value[6], value[7],
4567-
status);
4568-
if (status) {
4569-
usleep_range(1500, 2500);
4570-
memset(value, 0, SFF_READ_BLOCK_SIZE);
4571-
continue;
4572-
}
4573-
break;
4554+
status = ice_aq_sff_eeprom(hw, 0, addr, offset, page,
4555+
!is_sfp, value,
4556+
SFF_READ_BLOCK_SIZE,
4557+
0, NULL);
4558+
netdev_dbg(netdev, "SFF %02X %02X %02X %X = %02X%02X%02X%02X.%02X%02X%02X%02X (%pe)\n",
4559+
addr, offset, page, is_sfp,
4560+
value[0], value[1], value[2], value[3],
4561+
value[4], value[5], value[6], value[7],
4562+
ERR_PTR(status));
4563+
if (status) {
4564+
netdev_err(netdev, "%s: error reading module EEPROM: status %pe\n",
4565+
__func__, ERR_PTR(status));
4566+
return status;
45744567
}
45754568

45764569
/* Make sure we have enough room for the new block */

0 commit comments

Comments
 (0)