Skip to content

Commit

Permalink
pds_core: keep viftypes table across reset
Browse files Browse the repository at this point in the history
Keep the viftypes and the current enable/disable states
across a recovery action.

Signed-off-by: Shannon Nelson <[email protected]>
Reviewed-by: Brett Creeley <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
emusln authored and davem330 committed Sep 18, 2023
1 parent f7b5bd7 commit d557c09
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/net/ethernet/amd/pds_core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,13 @@ int pdsc_setup(struct pdsc *pdsc, bool init)
goto err_out_teardown;

/* Set up the VIFs */
err = pdsc_viftypes_init(pdsc);
if (err)
goto err_out_teardown;
if (init) {
err = pdsc_viftypes_init(pdsc);
if (err)
goto err_out_teardown;

if (init)
pdsc_debugfs_add_viftype(pdsc);
}

clear_bit(PDSC_S_FW_DEAD, &pdsc->state);
return 0;
Expand All @@ -469,8 +470,10 @@ void pdsc_teardown(struct pdsc *pdsc, bool removing)
pdsc_qcq_free(pdsc, &pdsc->notifyqcq);
pdsc_qcq_free(pdsc, &pdsc->adminqcq);

kfree(pdsc->viftype_status);
pdsc->viftype_status = NULL;
if (removing) {
kfree(pdsc->viftype_status);
pdsc->viftype_status = NULL;
}

if (pdsc->intr_info) {
for (i = 0; i < pdsc->nintrs; i++)
Expand Down

0 comments on commit d557c09

Please sign in to comment.