Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3652697ioo; Mon, 30 May 2022 06:54:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxir1Hn7iKbepa8hv9QhAgM7slaqKG8qfNhAvw65nb7Rzleo+lnMiS73HMmCaqMFyJusEp2 X-Received: by 2002:a05:6402:3586:b0:42b:347:4702 with SMTP id y6-20020a056402358600b0042b03474702mr56466750edc.2.1653918882791; Mon, 30 May 2022 06:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653918882; cv=none; d=google.com; s=arc-20160816; b=dFKqyjBZ1GHKfzBe1TKfNVtGMAc1pbO6BA26VCXVsyGhmv5F7Csmin7PHZLWK329Vr s7t7sTugkCaEf3cyqF4E4DdViuxdo67Qr1dxz/KZFW+eQ2xrzaY21aw9FFmFk/aEuZdJ z2t2pCKALEaNx2whjBRxbc+0uxi3PHMtyVjMo0tbQrPRxfoJIhmOScTFntX2yTu8YqtB c10A2vS/dLaGzhuy4C6lA5hOkOWXpVd1siWfgtoF9LrsoX8fIiCnn56OHDekcC9JuU8F xlTutcy6Ljj4GO7+ScrPHk19mye/zuuLEV7/M2LczwP3sFAY3zl9GJBeKCN+O6ymL8Jo FNHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oYO13XbBYLyDLrEfDsgv1ohh53H8w+Fz/FYNKcSq9yI=; b=uxRA7i5SrF2awYqt13fytIO7LpljbeAPCJ6Sk7LwJNKq6acYMj6oWgqmPIjBOpZhBo DKmaXFr0g6cCPb/drHVLUXWSe4tYpl8V/6DQvIh9EN790sEg6vTT6O4a+vn04LvA6Vo5 j0glrXpbkpkzguS5gVeeCtxtbI1OJA7e5tarjl7+yntGClb11jKvWYcbHU4NhqoVqRSD DgNMj3mLwhf5ula62k5pnKO+iMQ4NDD/GC1oQckAfJZR6BwsTkBdyuHVfeZbUWdkoIP5 JuayhzwuLEBaZuOhz4GEx4ibfz1qjSs2s7uBb7yGvsfGHOwReV2Sz6GC6Y7TxDxLRG5s tzhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=GjjA1ziO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a0564020e0700b0042dd3b815d5si2201291edh.391.2022.05.30.06.54.17; Mon, 30 May 2022 06:54:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=GjjA1ziO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236241AbiE3M5Q (ORCPT + 99 others); Mon, 30 May 2022 08:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236224AbiE3M5O (ORCPT ); Mon, 30 May 2022 08:57:14 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01A0EDE97; Mon, 30 May 2022 05:57:12 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24UB4KFc012162; Mon, 30 May 2022 05:57:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=oYO13XbBYLyDLrEfDsgv1ohh53H8w+Fz/FYNKcSq9yI=; b=GjjA1ziOnzt4ur10Gfq2c15BMHazksFMSOLtWRFAU8Uqloc+LQNWaKQCE9z2ESbYQTeF skVtDEXsYfetN0FTT1TwzS8FWPBCph+ttf3YQV6Q+3KGVLtpcHTK2gTM1FiUZlk71r7x zh8H8RA6bnzLLv6q4/oHk4ks6HcKtnd+j8YDW+oSIUObECXE0RpD4RPT8BpxFF2F7qNs jEqixAONjgW64ssNcH+uTd5YBKuH8QsIk5OKQj3OKYVGMxLyFPllaQmEVEhQpJj82qf8 gtauRmH6Eh014coZqGher0UdSMandON5UP7D3omDUFjFim/t5I8wuYI9niIVCV07IP1s kg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3gbk8n5fc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 05:57:03 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 30 May 2022 05:57:01 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 30 May 2022 05:57:01 -0700 Received: from localhost.localdomain (unknown [10.110.150.250]) by maili.marvell.com (Postfix) with ESMTP id B3C863F7048; Mon, 30 May 2022 05:57:00 -0700 (PDT) From: Piyush Malgujar To: , CC: , , , , Piyush Malgujar , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni Subject: [PATCH v2 1/3] net: mdio: mdio-thunder: stop toggling SMI clock on idle Date: Mon, 30 May 2022 05:53:26 -0700 Message-ID: <20220530125329.30717-2-pmalgujar@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220530125329.30717-1-pmalgujar@marvell.com> References: <20220530125329.30717-1-pmalgujar@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: gq0OF6O3plAHcXdXigZaoxn07hpx5dE7 X-Proofpoint-GUID: gq0OF6O3plAHcXdXigZaoxn07hpx5dE7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-30_04,2022-05-30_01,2022-02-23_01 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SMI clock should be running only for the time when there are transactions on the bus. Signed-off-by: Damian Eppel Signed-off-by: Piyush Malgujar --- drivers/net/mdio/mdio-thunder.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mdio/mdio-thunder.c b/drivers/net/mdio/mdio-thunder.c index 822d2cdd2f3599025f3e79d4243337c18114c951..715c835ace785da345ac037177b0f291678e4c47 100644 --- a/drivers/net/mdio/mdio-thunder.c +++ b/drivers/net/mdio/mdio-thunder.c @@ -58,6 +58,7 @@ static int thunder_mdiobus_pci_probe(struct pci_dev *pdev, struct resource r; struct mii_bus *mii_bus; struct cavium_mdiobus *bus; + union cvmx_smix_clk smi_clk; union cvmx_smix_en smi_en; /* If it is not an OF node we cannot handle it yet, so @@ -87,6 +88,10 @@ static int thunder_mdiobus_pci_probe(struct pci_dev *pdev, bus->register_base = nexus->bar0 + r.start - pci_resource_start(pdev, 0); + smi_clk.u64 = oct_mdio_readq(bus->register_base + SMI_CLK); + smi_clk.s.clk_idle = 1; + oct_mdio_writeq(smi_clk.u64, bus->register_base + SMI_CLK); + smi_en.u64 = 0; smi_en.s.en = 1; oct_mdio_writeq(smi_en.u64, bus->register_base + SMI_EN); -- 2.17.1