diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-03-08 20:36:59 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-10 06:55:00 +0300 |
commit | 4a5eaa2fde59d08d0ca14f985a61c6c745555bbb (patch) | |
tree | ee43d07014993457359c811a1b06f75ba215d494 /drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | |
parent | 1a21277190c70084800002bc42ecb7358c7f0775 (diff) | |
download | linux-4a5eaa2fde59d08d0ca14f985a61c6c745555bbb.tar.xz |
bnxt: revert hastily merged uAPI aberrations
This reverts:
commit 02acd399533e ("bnxt_en: parse result field when NVRAM package install fails")
commit 22f5dba5065d ("bnxt_en: add an nvm test for hw diagnose")
commit bafed3f231f7 ("bnxt_en: implement hw health reporter")
These patches are still under discussion / I don't think they
are right, and since the authors don't reply promptly let me
lessen my load of "things I need to resolve before next release"
and revert them.
Acked-by: Michael Chan <michael.chan@broadcom.com>
Link: https://lore.kernel.org/r/20220308173659.304915-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 153 |
1 files changed, 0 insertions, 153 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c index 77e55105d645..0c17f90d44a2 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -20,7 +20,6 @@ #include "bnxt_ulp.h" #include "bnxt_ptp.h" #include "bnxt_coredump.h" -#include "bnxt_nvm_defs.h" /* NVRAM content constant and structure defs */ static void __bnxt_fw_recover(struct bnxt *bp) { @@ -242,148 +241,6 @@ static const struct devlink_health_reporter_ops bnxt_dl_fw_reporter_ops = { .recover = bnxt_fw_recover, }; -static int bnxt_hw_recover(struct devlink_health_reporter *reporter, - void *priv_ctx, - struct netlink_ext_ack *extack) -{ - struct bnxt *bp = devlink_health_reporter_priv(reporter); - struct bnxt_hw_health *hw_health = &bp->hw_health; - - hw_health->synd = BNXT_HW_STATUS_HEALTHY; - return 0; -} - -static const char *hw_err_str(u8 synd) -{ - switch (synd) { - case BNXT_HW_STATUS_HEALTHY: - return "healthy"; - case BNXT_HW_STATUS_NVM_WRITE_ERR: - return "nvm write error"; - case BNXT_HW_STATUS_NVM_ERASE_ERR: - return "nvm erase error"; - case BNXT_HW_STATUS_NVM_UNKNOWN_ERR: - return "unrecognized nvm error"; - case BNXT_HW_STATUS_NVM_TEST_VPD_ENT_ERR: - return "nvm test vpd entry error"; - case BNXT_HW_STATUS_NVM_TEST_VPD_READ_ERR: - return "nvm test vpd read error"; - case BNXT_HW_STATUS_NVM_TEST_VPD_WRITE_ERR: - return "nvm test vpd write error"; - case BNXT_HW_STATUS_NVM_TEST_INCMPL_ERR: - return "nvm test incomplete error"; - default: - return "unknown hw error"; - } -} - -static void bnxt_nvm_test(struct bnxt *bp) -{ - struct bnxt_hw_health *h = &bp->hw_health; - u32 datalen; - u16 index; - u8 *buf; - - if (!h->nvm_test_result) { - if (!h->nvm_test_timestamp || - time_after(jiffies, h->nvm_test_timestamp + - msecs_to_jiffies(HW_RETEST_MIN_TIME))) - h->nvm_test_timestamp = jiffies; - else - return; - } - - if (bnxt_find_nvram_item(bp->dev, BNX_DIR_TYPE_VPD, - BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE, - &index, NULL, &datalen) || !datalen) { - h->nvm_test_result = BNXT_HW_STATUS_NVM_TEST_VPD_ENT_ERR; - h->nvm_test_vpd_ent_errors++; - return; - } - - buf = kzalloc(datalen, GFP_KERNEL); - if (!buf) { - h->nvm_test_result = BNXT_HW_STATUS_NVM_TEST_INCMPL_ERR; - h->nvm_test_incmpl_errors++; - return; - } - - if (bnxt_get_nvram_item(bp->dev, index, 0, datalen, buf)) { - h->nvm_test_result = BNXT_HW_STATUS_NVM_TEST_VPD_READ_ERR; - h->nvm_test_vpd_read_errors++; - goto err; - } - - if (bnxt_flash_nvram(bp->dev, BNX_DIR_TYPE_VPD, BNX_DIR_ORDINAL_FIRST, - BNX_DIR_EXT_NONE, 0, 0, buf, datalen)) { - h->nvm_test_result = BNXT_HW_STATUS_NVM_TEST_VPD_WRITE_ERR; - h->nvm_test_vpd_write_errors++; - } - -err: - kfree(buf); -} - -static int bnxt_hw_diagnose(struct devlink_health_reporter *reporter, - struct devlink_fmsg *fmsg, - struct netlink_ext_ack *extack) -{ - struct bnxt *bp = devlink_health_reporter_priv(reporter); - struct bnxt_hw_health *h = &bp->hw_health; - u8 synd = h->synd; - int rc; - - bnxt_nvm_test(bp); - if (h->nvm_test_result) { - synd = h->nvm_test_result; - devlink_health_report(h->hw_reporter, hw_err_str(synd), NULL); - } - - rc = devlink_fmsg_string_pair_put(fmsg, "Status", hw_err_str(synd)); - if (rc) - return rc; - rc = devlink_fmsg_u32_pair_put(fmsg, "nvm_write_errors", h->nvm_write_errors); - if (rc) - return rc; - rc = devlink_fmsg_u32_pair_put(fmsg, "nvm_erase_errors", h->nvm_erase_errors); - if (rc) - return rc; - rc = devlink_fmsg_u32_pair_put(fmsg, "nvm_test_vpd_ent_errors", - h->nvm_test_vpd_ent_errors); - if (rc) - return rc; - rc = devlink_fmsg_u32_pair_put(fmsg, "nvm_test_vpd_read_errors", - h->nvm_test_vpd_read_errors); - if (rc) - return rc; - rc = devlink_fmsg_u32_pair_put(fmsg, "nvm_test_vpd_write_errors", - h->nvm_test_vpd_write_errors); - if (rc) - return rc; - rc = devlink_fmsg_u32_pair_put(fmsg, "nvm_test_incomplete_errors", - h->nvm_test_incmpl_errors); - if (rc) - return rc; - - return 0; -} - -void bnxt_devlink_health_hw_report(struct bnxt *bp) -{ - struct bnxt_hw_health *hw_health = &bp->hw_health; - - netdev_warn(bp->dev, "%s reported at address 0x%x\n", hw_err_str(hw_health->synd), - hw_health->nvm_err_address); - - devlink_health_report(hw_health->hw_reporter, hw_err_str(hw_health->synd), NULL); -} - -static const struct devlink_health_reporter_ops bnxt_dl_hw_reporter_ops = { - .name = "hw", - .diagnose = bnxt_hw_diagnose, - .recover = bnxt_hw_recover, -}; - static struct devlink_health_reporter * __bnxt_dl_reporter_create(struct bnxt *bp, const struct devlink_health_reporter_ops *ops) @@ -403,10 +260,6 @@ __bnxt_dl_reporter_create(struct bnxt *bp, void bnxt_dl_fw_reporters_create(struct bnxt *bp) { struct bnxt_fw_health *fw_health = bp->fw_health; - struct bnxt_hw_health *hw_health = &bp->hw_health; - - if (!hw_health->hw_reporter) - hw_health->hw_reporter = __bnxt_dl_reporter_create(bp, &bnxt_dl_hw_reporter_ops); if (fw_health && !fw_health->fw_reporter) fw_health->fw_reporter = __bnxt_dl_reporter_create(bp, &bnxt_dl_fw_reporter_ops); @@ -415,12 +268,6 @@ void bnxt_dl_fw_reporters_create(struct bnxt *bp) void bnxt_dl_fw_reporters_destroy(struct bnxt *bp) { struct bnxt_fw_health *fw_health = bp->fw_health; - struct bnxt_hw_health *hw_health = &bp->hw_health; - - if (hw_health->hw_reporter) { - devlink_health_reporter_destroy(hw_health->hw_reporter); - hw_health->hw_reporter = NULL; - } if (fw_health && fw_health->fw_reporter) { devlink_health_reporter_destroy(fw_health->fw_reporter); |