From: Greg Kroah-Hartman <gre...@linuxfoundation.org>

From: Wong Vee Khee <vee.khee.w...@intel.com>

commit 8eb37ab7cc045ec6305a6a1a9c32374695a1a977 upstream.

Issue seen when enumerating multiple Intel mGbE interfaces in EHL.

[    6.898141] intel-eth-pci 0000:00:1d.2: enabling device (0000 -> 0002)
[    6.900971] intel-eth-pci 0000:00:1d.2: Fail to register stmmac-clk
[    6.906434] intel-eth-pci 0000:00:1d.2: User ID: 0x51, Synopsys ID: 0x52

We fix it by making the clock name to be unique following the format
of stmmac-pci_name(pci_dev) so that we can differentiate the clock for
these Intel mGbE interfaces in EHL platform as follow:

  /sys/kernel/debug/clk/stmmac-0000:00:1d.1
  /sys/kernel/debug/clk/stmmac-0000:00:1d.2
  /sys/kernel/debug/clk/stmmac-0000:00:1e.4

Fixes: 58da0cfa6cf1 ("net: stmmac: create dwmac-intel.c to contain all Intel 
platform")
Signed-off-by: Wong Vee Khee <vee.khee.w...@intel.com>
Signed-off-by: Voon Weifeng <weifeng.v...@intel.com>
Co-developed-by: Ong Boon Leong <boon.leong....@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong....@intel.com>
Signed-off-by: David S. Miller <da...@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -233,6 +233,7 @@ static void common_default_data(struct p
 static int intel_mgbe_common_data(struct pci_dev *pdev,
                                  struct plat_stmmacenet_data *plat)
 {
+       char clk_name[20];
        int ret;
        int i;
 
@@ -300,8 +301,10 @@ static int intel_mgbe_common_data(struct
        plat->eee_usecs_rate = plat->clk_ptp_rate;
 
        /* Set system clock */
+       sprintf(clk_name, "%s-%s", "stmmac", pci_name(pdev));
+
        plat->stmmac_clk = clk_register_fixed_rate(&pdev->dev,
-                                                  "stmmac-clk", NULL, 0,
+                                                  clk_name, NULL, 0,
                                                   plat->clk_ptp_rate);
 
        if (IS_ERR(plat->stmmac_clk)) {


Reply via email to