Skip to content

Commit

Permalink
net/txgbe: remove semaphore between SW/FW
Browse files Browse the repository at this point in the history
[ upstream commit 61b7a04 ]

Since firmware does not use the semaphore between software and firmware.
Remove useless unilateral semaphore setting.

Fixes: 35c90ec ("net/txgbe: add EEPROM functions")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and kevintraynor committed Oct 11, 2022
1 parent d47522b commit 982225e
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions drivers/net/txgbe/base/txgbe_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,37 +111,6 @@ s32 txgbe_get_eeprom_semaphore(struct txgbe_hw *hw)
status = 0;
}

/* Now get the semaphore between SW/FW through the SWESMBI bit */
if (status == 0) {
for (i = 0; i < timeout; i++) {
/* Set the SW EEPROM semaphore bit to request access */
wr32m(hw, TXGBE_MNGSWSYNC,
TXGBE_MNGSWSYNC_REQ, TXGBE_MNGSWSYNC_REQ);

/*
* If we set the bit successfully then we got the
* semaphore.
*/
swsm = rd32(hw, TXGBE_MNGSWSYNC);
if (swsm & TXGBE_MNGSWSYNC_REQ)
break;

usec_delay(50);
}

/*
* Release semaphores and return error if SW EEPROM semaphore
* was not granted because we don't have access to the EEPROM
*/
if (i >= timeout) {
DEBUGOUT("SWESMBI Software EEPROM semaphore not granted.");
txgbe_release_eeprom_semaphore(hw);
status = TXGBE_ERR_EEPROM;
}
} else {
DEBUGOUT("Software semaphore SMBI between device drivers not granted.");
}

return status;
}

Expand All @@ -153,7 +122,6 @@ s32 txgbe_get_eeprom_semaphore(struct txgbe_hw *hw)
**/
void txgbe_release_eeprom_semaphore(struct txgbe_hw *hw)
{
wr32m(hw, TXGBE_MNGSWSYNC, TXGBE_MNGSWSYNC_REQ, 0);
wr32m(hw, TXGBE_SWSEM, TXGBE_SWSEM_PF, 0);
txgbe_flush(hw);
}
Expand Down

0 comments on commit 982225e

Please sign in to comment.