From patchwork Fri Mar 5 06:03:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 12117813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FE34C433E0 for ; Fri, 5 Mar 2021 06:03:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8281C64FF0 for ; Fri, 5 Mar 2021 06:03:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8281C64FF0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=vwsdfLvXvhFG79rY04vENFdOVR+wLnkj1Yr62D/vNok=; b=CMs2r+UwdYfSfvUCRrvJ1hJXlV jj8ZjPixxCkHmT8bv8sa/bM5e0VKLF99YrJgn3GkXLIjHzTRjIzvYdpi24GDzXw/Q6QDJh2BGDRiS n7qhsFDZLFEvoQNhigWfu7FKPEmEf+uK5/kwX/lIc2uxBFjTnT4Pqm692TaIhZ+BiK51z7lpP4ivJ y4e9LpYMRH2btYSgPNYMx7kKAbQU3/a78ZIVJALErkBhXDndxHu7N7VhMGY38SQrhoGXpC67Xh77K Z9836QWbBp9UO/l7+HvjoxHbwaTEDXJT5PBAPyixekAyyBH7mRGAXO4vb94FRpeL02OYfb7IxMNt7 I+QE/kZg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lI3Wv-00D5bW-0I; Fri, 05 Mar 2021 06:01:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lI3Wo-00D5ZI-79 for linux-arm-kernel@desiato.infradead.org; Fri, 05 Mar 2021 06:01:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=a0OZqFNblONnN1rx2kXdMo2o6n+Uq1MIu0Y2WFOV9YE=; b=ASr1M+0OpkHteoAchlLDI3SwMg QgMRWlURl024m4x2tBwU7AEUo71g/PA8c8ZvvfHQXHmlVER13ngZvEedbt2XaWw3+KkCd13LDy5IH N2Hb6FVX/ZxW9wEPTcXc1FnpJ9HUACbkmExMzG6963diVVw9dx2Jh+HD76TugKBnzAbKr3RS3V0ZH i9uQXM/F8DZ0/AjZxxUXqmzUc0uTZfSVjilgJRZztYU6vq5qDKIMLDXc2fSFLxOvgcZ/uoA9krcGN Mdvvec5Gv1NsZxPSNR869H0bJXJEu3vCFrNz7Mmg8ct6ga48ep4yXwVmS4BjPQ1lbhsq2qyn2mvX7 aRIIRJig==; Received: from mga12.intel.com ([192.55.52.136]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lI3WV-00AMf2-M7 for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 06:01:25 +0000 IronPort-SDR: ovKbjEkZQ4AG9ojxjRY1TneuJul16GxMOdWxC3eblgMSc6ArgbsneYwIDD4NxQWSX90Nc6KbaY Ebacnuc4h3Gg== X-IronPort-AV: E=McAfee;i="6000,8403,9913"; a="166839614" X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="166839614" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2021 21:59:58 -0800 IronPort-SDR: ANx896jTZnol9NShHHlG8T26dd6BJwkia3SoveHuqZ5XeuE2WkjoA9bR77wkVGT0e3FeydaAVN 9PN7Q75pceuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,224,1610438400"; d="scan'208";a="507877765" Received: from glass.png.intel.com ([10.158.65.59]) by fmsmga001.fm.intel.com with ESMTP; 04 Mar 2021 21:59:55 -0800 From: Ong Boon Leong To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski Cc: Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Voon Weifeng , Ong Boon Leong Subject: [PATCH net 1/1] stmmac: intel: Fixes clock registration error seen for multiple interfaces Date: Fri, 5 Mar 2021 14:03:42 +0800 Message-Id: <20210305060342.23503-1-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.17.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210305_060123_496825_9BBB1B88 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Wong Vee Khee 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 Signed-off-by: Voon Weifeng Co-developed-by: Ong Boon Leong Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index f2896872a86c..0b64f7710d17 100644 --- 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 plat_stmmacenet_data *plat) static int intel_mgbe_common_data(struct pci_dev *pdev, struct plat_stmmacenet_data *plat) { + char clk_name[20]; int ret; int i; @@ -301,8 +302,10 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, 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)) {