Skip to content

Commit

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

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

Fixes: f501a19 ("net/ngbe: initialize and validate EEPROM")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and kevintraynor committed Oct 11, 2022
1 parent 9f6bab8 commit 60df277
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions drivers/net/ngbe/base/ngbe_eeprom.c
Expand Up @@ -105,37 +105,6 @@ s32 ngbe_get_eeprom_semaphore(struct ngbe_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, NGBE_MNGSWSYNC,
NGBE_MNGSWSYNC_REQ, NGBE_MNGSWSYNC_REQ);

/*
* If we set the bit successfully then we got the
* semaphore.
*/
swsm = rd32(hw, NGBE_MNGSWSYNC);
if (swsm & NGBE_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.");
ngbe_release_eeprom_semaphore(hw);
status = NGBE_ERR_EEPROM;
}
} else {
DEBUGOUT("Software semaphore SMBI between device drivers not granted.");
}

return status;
}

Expand All @@ -147,7 +116,6 @@ s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw)
**/
void ngbe_release_eeprom_semaphore(struct ngbe_hw *hw)
{
wr32m(hw, NGBE_MNGSWSYNC, NGBE_MNGSWSYNC_REQ, 0);
wr32m(hw, NGBE_SWSEM, NGBE_SWSEM_PF, 0);
ngbe_flush(hw);
}
Expand Down

0 comments on commit 60df277

Please sign in to comment.