* [net PATCH 0/2] octeontx2: Fix PTP bugs
@ 2022-01-07 6:30 Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 1/2] octeontx2-af: Increment ptp refcount before use Subbaraya Sundeep
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Subbaraya Sundeep @ 2022-01-07 6:30 UTC (permalink / raw)
To: davem, kuba, netdev; +Cc: hkelam, gakula, sgoutham, rsaladi2, Subbaraya Sundeep
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.
Thanks,
Sundeep
Rakesh Babu Saladi (1):
octeontx2-nicvf: Free VF PTP resources.
Subbaraya Sundeep (1):
octeontx2-af: Increment ptp refcount before use
drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 2 ++
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [net PATCH 1/2] octeontx2-af: Increment ptp refcount before use
2022-01-07 6:30 [net PATCH 0/2] octeontx2: Fix PTP bugs Subbaraya Sundeep
@ 2022-01-07 6:30 ` Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 2/2] octeontx2-nicvf: Free VF PTP resources Subbaraya Sundeep
2022-01-07 14:10 ` [net PATCH 0/2] octeontx2: Fix PTP bugs patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Subbaraya Sundeep @ 2022-01-07 6:30 UTC (permalink / raw)
To: davem, kuba, netdev; +Cc: hkelam, gakula, sgoutham, rsaladi2, Subbaraya Sundeep
Before using the ptp pci device by AF driver increment
the reference count of it.
Fixes: a8b90c9d26d6 ("octeontx2-af: Add PTP device id for CN10K and 95O silcons")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/af/ptp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
index d6321de..e682b7b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/ptp.c
@@ -60,6 +60,8 @@ struct ptp *ptp_get(void)
/* Check driver is bound to PTP block */
if (!ptp)
ptp = ERR_PTR(-EPROBE_DEFER);
+ else
+ pci_dev_get(ptp->pdev);
return ptp;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [net PATCH 2/2] octeontx2-nicvf: Free VF PTP resources.
2022-01-07 6:30 [net PATCH 0/2] octeontx2: Fix PTP bugs Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 1/2] octeontx2-af: Increment ptp refcount before use Subbaraya Sundeep
@ 2022-01-07 6:30 ` Subbaraya Sundeep
2022-01-07 14:10 ` [net PATCH 0/2] octeontx2: Fix PTP bugs patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Subbaraya Sundeep @ 2022-01-07 6:30 UTC (permalink / raw)
To: davem, kuba, netdev; +Cc: hkelam, gakula, sgoutham, rsaladi2, Subbaraya Sundeep
From: Rakesh Babu Saladi <rsaladi2@marvell.com>
When a VF is removed respective PTP resources are not
being freed currently. This patch fixes it.
Fixes: 43510ef4ddad ("octeontx2-nicvf: Add PTP hardware clock support to NIX VF")
Signed-off-by: Rakesh Babu Saladi <rsaladi2@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
index 78944ad..d75f3a7 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
@@ -684,7 +684,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = register_netdev(netdev);
if (err) {
dev_err(dev, "Failed to register netdevice\n");
- goto err_detach_rsrc;
+ goto err_ptp_destroy;
}
err = otx2_wq_init(vf);
@@ -709,6 +709,8 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err_unreg_netdev:
unregister_netdev(netdev);
+err_ptp_destroy:
+ otx2_ptp_destroy(vf);
err_detach_rsrc:
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
qmem_free(vf->dev, vf->dync_lmt);
@@ -742,6 +744,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
if (vf->otx2_wq)
destroy_workqueue(vf->otx2_wq);
+ otx2_ptp_destroy(vf);
otx2vf_disable_mbox_intr(vf);
otx2_detach_resources(&vf->mbox);
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net PATCH 0/2] octeontx2: Fix PTP bugs
2022-01-07 6:30 [net PATCH 0/2] octeontx2: Fix PTP bugs Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 1/2] octeontx2-af: Increment ptp refcount before use Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 2/2] octeontx2-nicvf: Free VF PTP resources Subbaraya Sundeep
@ 2022-01-07 14:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-07 14:10 UTC (permalink / raw)
To: Subbaraya Sundeep; +Cc: davem, kuba, netdev, hkelam, gakula, sgoutham, rsaladi2
Hello:
This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Fri, 7 Jan 2022 12:00:28 +0530 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net,1/2] octeontx2-af: Increment ptp refcount before use
https://git.kernel.org/netdev/net/c/93440f4888cf
- [net,2/2] octeontx2-nicvf: Free VF PTP resources.
https://git.kernel.org/netdev/net/c/eabd0f88b0d2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-07 14:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 6:30 [net PATCH 0/2] octeontx2: Fix PTP bugs Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 1/2] octeontx2-af: Increment ptp refcount before use Subbaraya Sundeep
2022-01-07 6:30 ` [net PATCH 2/2] octeontx2-nicvf: Free VF PTP resources Subbaraya Sundeep
2022-01-07 14:10 ` [net PATCH 0/2] octeontx2: Fix PTP bugs patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.