Skip to content

Commit b69c5b5

Browse files
committed
Merge branch 'octeontx2-ptp-bugs'
Subbaraya Sundeep says: ==================== octeontx2: Fix PTP bugs This patchset addresses two problems found when using ptp. Patch 1 - Increases the refcount of ptp device before use which was missing and it lead to refcount increment after use bug when module is loaded and unloaded couple of times. Patch 2 - PTP resources allocated by VF are not being freed during VF teardown. This patch fixes that. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents fff6352 + eabd0f8 commit b69c5b5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/af/ptp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ struct ptp *ptp_get(void)
6060
/* Check driver is bound to PTP block */
6161
if (!ptp)
6262
ptp = ERR_PTR(-EPROBE_DEFER);
63+
else
64+
pci_dev_get(ptp->pdev);
6365

6466
return ptp;
6567
}

drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
684684
err = register_netdev(netdev);
685685
if (err) {
686686
dev_err(dev, "Failed to register netdevice\n");
687-
goto err_detach_rsrc;
687+
goto err_ptp_destroy;
688688
}
689689

690690
err = otx2_wq_init(vf);
@@ -709,6 +709,8 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
709709

710710
err_unreg_netdev:
711711
unregister_netdev(netdev);
712+
err_ptp_destroy:
713+
otx2_ptp_destroy(vf);
712714
err_detach_rsrc:
713715
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
714716
qmem_free(vf->dev, vf->dync_lmt);
@@ -742,6 +744,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
742744
unregister_netdev(netdev);
743745
if (vf->otx2_wq)
744746
destroy_workqueue(vf->otx2_wq);
747+
otx2_ptp_destroy(vf);
745748
otx2vf_disable_mbox_intr(vf);
746749
otx2_detach_resources(&vf->mbox);
747750
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))

0 commit comments

Comments
 (0)