diff mbox series

[iwl-next] ice: Extend auxbus device naming

Message ID 20240418110318.67202-1-sergey.temerkhanov@intel.com
State Changes Requested
Headers show
Series [iwl-next] ice: Extend auxbus device naming | expand

Commit Message

Sergey Temerkhanov April 18, 2024, 11:03 a.m. UTC
Include segment/domain number in the device name to distinguish
between PCI devices located on different root complexes in
multi-segment configurations

Signed-off-by: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ptp.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Paul Menzel April 18, 2024, 3:07 p.m. UTC | #1
Dear Sergey,


Thank you for your patch.

Am 18.04.24 um 13:03 schrieb Sergey Temerkhanov:
> Include segment/domain number in the device name to distinguish
> between PCI devices located on different root complexes in
> multi-segment configurations

Can you please paste the old and new name in the commit message?

> Signed-off-by: Sergey Temerkhanov <sergey.temerkhanov@intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> ---
>   drivers/net/ethernet/intel/ice/ice_ptp.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)

[…]


Kind regards,

Paul
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index 0f17fc1181d2..54fe1931d598 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -2893,6 +2893,7 @@  ice_ptp_auxbus_create_id_table(struct ice_pf *pf, const char *name)
 static int ice_ptp_register_auxbus_driver(struct ice_pf *pf)
 {
 	struct auxiliary_driver *aux_driver;
+	struct pci_dev *pdev = pf->pdev;
 	struct ice_ptp *ptp;
 	struct device *dev;
 	char *name;
@@ -2903,8 +2904,9 @@  static int ice_ptp_register_auxbus_driver(struct ice_pf *pf)
 	aux_driver = &ptp->ports_owner.aux_driver;
 	INIT_LIST_HEAD(&ptp->ports_owner.ports);
 	mutex_init(&ptp->ports_owner.lock);
-	name = devm_kasprintf(dev, GFP_KERNEL, "ptp_aux_dev_%u_%u_clk%u",
-			      pf->pdev->bus->number, PCI_SLOT(pf->pdev->devfn),
+	name = devm_kasprintf(dev, GFP_KERNEL, "ptp_aux_dev_%u_%u_%u_clk%u",
+			      pci_domain_nr(pdev->bus), pdev->bus->number,
+			      PCI_SLOT(pdev->devfn),
 			      ice_get_ptp_src_clock_index(&pf->hw));
 	if (!name)
 		return -ENOMEM;
@@ -3106,6 +3108,7 @@  static void ice_ptp_release_auxbus_device(struct device *dev)
 static int ice_ptp_create_auxbus_device(struct ice_pf *pf)
 {
 	struct auxiliary_device *aux_dev;
+	struct pci_dev *pdev = pf->pdev;
 	struct ice_ptp *ptp;
 	struct device *dev;
 	char *name;
@@ -3118,8 +3121,9 @@  static int ice_ptp_create_auxbus_device(struct ice_pf *pf)
 
 	aux_dev = &ptp->port.aux_dev;
 
-	name = devm_kasprintf(dev, GFP_KERNEL, "ptp_aux_dev_%u_%u_clk%u",
-			      pf->pdev->bus->number, PCI_SLOT(pf->pdev->devfn),
+	name = devm_kasprintf(dev, GFP_KERNEL, "ptp_aux_dev_%u_%u_%u_clk%u",
+			      pci_domain_nr(pdev->bus), pdev->bus->number,
+			      PCI_SLOT(pdev->devfn),
 			      ice_get_ptp_src_clock_index(&pf->hw));
 	if (!name)
 		return -ENOMEM;