Skip to content

Commit bec6d85

Browse files
cjubrankuba-moo
authored andcommitted
net/mlx5: Add support for enabling PTM PCI capability
Since the kernel doesn't support enabling Precision Time Measurement for an endpoint device, enable the PTM PCI capability in the driver. Signed-off-by: Carolina Jubran <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Tested-by: Vadim Fedorenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7e45c1e commit bec6d85

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+6
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,11 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev,
923923
}
924924

925925
mlx5_pci_vsc_init(dev);
926+
927+
err = pci_enable_ptm(pdev, NULL);
928+
if (err)
929+
mlx5_core_info(dev, "PTM is not supported by PCIe\n");
930+
926931
return 0;
927932

928933
err_clr_master:
@@ -939,6 +944,7 @@ static void mlx5_pci_close(struct mlx5_core_dev *dev)
939944
* before removing the pci bars
940945
*/
941946
mlx5_drain_health_wq(dev);
947+
pci_disable_ptm(dev->pdev);
942948
iounmap(dev->iseg);
943949
release_bar(dev->pdev);
944950
mlx5_pci_disable_device(dev);

0 commit comments

Comments
 (0)