Skip to content

Commit

Permalink
net/txgbe: fix debug logs
Browse files Browse the repository at this point in the history
[ upstream commit 75c85e3 ]

Remove 'DEBUGFUNC' due to too many invalid debug log prints, unify the
DEBUG level macros.

Fixes: 7dc1170 ("net/txgbe: support probe and remove")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and bluca committed Feb 28, 2022
1 parent a274e89 commit 2c03252
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 273 deletions.
2 changes: 1 addition & 1 deletion drivers/net/txgbe/base/meson.build
Expand Up @@ -21,6 +21,6 @@ foreach flag: error_cflags
endforeach

base_lib = static_library('txgbe_base', sources,
dependencies: static_rte_eal,
dependencies: [static_rte_eal, static_rte_net],
c_args: c_args)
base_objs = base_lib.extract_all_objects()
41 changes: 11 additions & 30 deletions drivers/net/txgbe/base/txgbe_eeprom.c
Expand Up @@ -20,8 +20,6 @@ s32 txgbe_init_eeprom_params(struct txgbe_hw *hw)
u16 eeprom_size;
int err = 0;

DEBUGFUNC("txgbe_init_eeprom_params");

if (eeprom->type != txgbe_eeprom_unknown)
return 0;

Expand Down Expand Up @@ -53,12 +51,12 @@ s32 txgbe_init_eeprom_params(struct txgbe_hw *hw)

err = eeprom->read32(hw, TXGBE_SW_REGION_PTR << 1, &eeprom->sw_addr);
if (err) {
DEBUGOUT("EEPROM read failed.\n");
DEBUGOUT("EEPROM read failed.");
return err;
}

DEBUGOUT("eeprom params: type = %d, size = %d, address bits: "
"%d %d\n", eeprom->type, eeprom->word_size,
DEBUGOUT("eeprom params: type = %d, size = %d, address bits: %d %d",
eeprom->type, eeprom->word_size,
eeprom->address_bits, eeprom->sw_addr);

return 0;
Expand All @@ -77,9 +75,6 @@ s32 txgbe_get_eeprom_semaphore(struct txgbe_hw *hw)
u32 i;
u32 swsm;

DEBUGFUNC("txgbe_get_eeprom_semaphore");


/* Get SMBI software semaphore between device drivers first */
for (i = 0; i < timeout; i++) {
/*
Expand All @@ -95,8 +90,7 @@ s32 txgbe_get_eeprom_semaphore(struct txgbe_hw *hw)
}

if (i == timeout) {
DEBUGOUT("Driver can't access the eeprom - SMBI Semaphore "
"not granted.\n");
DEBUGOUT("Driver can't access the eeprom - SMBI Semaphore not granted.");
/*
* this release is particularly important because our attempts
* above to get the semaphore may have succeeded, and if there
Expand Down Expand Up @@ -139,13 +133,12 @@ s32 txgbe_get_eeprom_semaphore(struct txgbe_hw *hw)
* was not granted because we don't have access to the EEPROM
*/
if (i >= timeout) {
DEBUGOUT("SWESMBI Software EEPROM semaphore not granted.\n");
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.\n");
DEBUGOUT("Software semaphore SMBI between device drivers not granted.");
}

return status;
Expand All @@ -159,8 +152,6 @@ s32 txgbe_get_eeprom_semaphore(struct txgbe_hw *hw)
**/
void txgbe_release_eeprom_semaphore(struct txgbe_hw *hw)
{
DEBUGFUNC("txgbe_release_eeprom_semaphore");

wr32m(hw, TXGBE_MNGSWSYNC, TXGBE_MNGSWSYNC_REQ, 0);
wr32m(hw, TXGBE_SWSEM, TXGBE_SWSEM_PF, 0);
txgbe_flush(hw);
Expand Down Expand Up @@ -289,8 +280,6 @@ s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset,
u32 addr = (offset << 1);
int err;

DEBUGFUNC("\n");

err = hw->mac.acquire_swfw_sync(hw, mask);
if (err)
return err;
Expand Down Expand Up @@ -347,8 +336,6 @@ s32 txgbe_ee_writew_sw(struct txgbe_hw *hw, u32 offset,
u32 addr = hw->rom.sw_addr + (offset << 1);
int err;

DEBUGFUNC("\n");

err = hw->mac.acquire_swfw_sync(hw, mask);
if (err)
return err;
Expand Down Expand Up @@ -398,11 +385,9 @@ s32 txgbe_calc_eeprom_checksum(struct txgbe_hw *hw)
int err;
u16 buffer[BUFF_SIZE];

DEBUGFUNC("txgbe_calc_eeprom_checksum");

err = hw->rom.readw_sw(hw, TXGBE_EEPROM_CHECKSUM, &read_checksum);
if (err) {
DEBUGOUT("EEPROM read failed\n");
DEBUGOUT("EEPROM read failed");
return err;
}

Expand Down Expand Up @@ -436,15 +421,13 @@ s32 txgbe_validate_eeprom_checksum(struct txgbe_hw *hw,
u16 read_checksum = 0;
int err;

DEBUGFUNC("txgbe_validate_eeprom_checksum");

/* Read the first word from the EEPROM. If this times out or fails, do
* not continue or we could be in for a very long wait while every
* EEPROM read fails
*/
err = hw->rom.read16(hw, 0, &checksum);
if (err) {
DEBUGOUT("EEPROM read failed\n");
DEBUGOUT("EEPROM read failed");
return err;
}

Expand All @@ -456,7 +439,7 @@ s32 txgbe_validate_eeprom_checksum(struct txgbe_hw *hw,

err = hw->rom.readw_sw(hw, TXGBE_EEPROM_CHECKSUM, &read_checksum);
if (err) {
DEBUGOUT("EEPROM read failed\n");
DEBUGOUT("EEPROM read failed");
return err;
}

Expand All @@ -465,7 +448,7 @@ s32 txgbe_validate_eeprom_checksum(struct txgbe_hw *hw,
*/
if (read_checksum != checksum) {
err = TXGBE_ERR_EEPROM_CHECKSUM;
DEBUGOUT("EEPROM checksum error\n");
DEBUGOUT("EEPROM checksum error");
}

/* If the user cares, return the calculated checksum */
Expand All @@ -484,15 +467,13 @@ s32 txgbe_update_eeprom_checksum(struct txgbe_hw *hw)
s32 status;
u16 checksum;

DEBUGFUNC("txgbe_update_eeprom_checksum");

/* Read the first word from the EEPROM. If this times out or fails, do
* not continue or we could be in for a very long wait while every
* EEPROM read fails
*/
status = hw->rom.read16(hw, 0, &checksum);
if (status) {
DEBUGOUT("EEPROM read failed\n");
DEBUGOUT("EEPROM read failed");
return status;
}

Expand Down

0 comments on commit 2c03252

Please sign in to comment.