Skip to content

Commit

Permalink
pds_core: use pci_reset_function for health reset
Browse files Browse the repository at this point in the history
We get the benefit of all the PCI reset locking and recovery if
we use the existing pci_reset_function() that will call our
local reset handlers.

Reviewed-by: Brett Creeley <[email protected]>
Signed-off-by: Shannon Nelson <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
emusln authored and davem330 committed Feb 19, 2024
1 parent 2dac60e commit 2cbab3c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/amd/pds_core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,7 @@ static void pdsc_check_pci_health(struct pdsc *pdsc)
if (fw_status != PDS_RC_BAD_PCI)
return;

pdsc_reset_prepare(pdsc->pdev);
pdsc_reset_done(pdsc->pdev);
pci_reset_function(pdsc->pdev);
}

void pdsc_health_thread(struct work_struct *work)
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/ethernet/amd/pds_core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ int pdsc_devcmd_reset(struct pdsc *pdsc);
int pdsc_dev_init(struct pdsc *pdsc);
void pdsc_dev_uninit(struct pdsc *pdsc);

void pdsc_reset_prepare(struct pci_dev *pdev);
void pdsc_reset_done(struct pci_dev *pdev);

int pdsc_intr_alloc(struct pdsc *pdsc, char *name,
irq_handler_t handler, void *data);
void pdsc_intr_free(struct pdsc *pdsc, int index);
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/ethernet/amd/pds_core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static void pdsc_restart_health_thread(struct pdsc *pdsc)
mod_timer(&pdsc->wdtimer, jiffies + 1);
}

void pdsc_reset_prepare(struct pci_dev *pdev)
static void pdsc_reset_prepare(struct pci_dev *pdev)
{
struct pdsc *pdsc = pci_get_drvdata(pdev);

Expand All @@ -486,10 +486,11 @@ void pdsc_reset_prepare(struct pci_dev *pdev)

pdsc_unmap_bars(pdsc);
pci_release_regions(pdev);
pci_disable_device(pdev);
if (pci_is_enabled(pdev))
pci_disable_device(pdev);
}

void pdsc_reset_done(struct pci_dev *pdev)
static void pdsc_reset_done(struct pci_dev *pdev)
{
struct pdsc *pdsc = pci_get_drvdata(pdev);
struct device *dev = pdsc->dev;
Expand Down

0 comments on commit 2cbab3c

Please sign in to comment.