Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp399732rdf; Tue, 21 Nov 2023 06:00:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGszpR1r0kHIIcTRAuFF3ZF4Ekk/9iIqNkffTppQdL1pJGZy2Zicd/GpJrPfhkfbWQH9auu X-Received: by 2002:a17:90a:1a10:b0:27f:f1fa:b448 with SMTP id 16-20020a17090a1a1000b0027ff1fab448mr10246162pjk.11.1700575216965; Tue, 21 Nov 2023 06:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700575216; cv=none; d=google.com; s=arc-20160816; b=jb8abCeZWnvAIwwBANTrGCQkCyIAXdAWdifMlWgM1S4/5PdhpeACnzvVho6Z58291P UFK51UJ/sx7LLjanejj3gRxrCNckJa213IKjaCN5gLTmBLkxw2IIkI/d3YQjYNzed4OU 91v/MKv/GdT+w7A3C8hS+bj8p6Nc073Ar7LJTu9fnoxQjiQy/3rXVqAZeYgrKAoS+zuu XRS0jRKNq40ZSxLy5bVCdLYFA6e0wFBbHBlF/M0bq9JKawBTa/PKZS38mgAsM17D7tn5 4LIyDKjedoy5TvrKmJ2V7G1zxZryl8aaP6cyczz7+KSLHWqMjC9mrE0VXUC5LkBjLAqj a6YQ== 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=zOeweRIPTzisv61dwOGKybnTDN8hrPF1gwr4IaPej8U=; fh=nGBoZt4+kP3+rfkGrTC/iVeVVkp7LZlm3MgVwF0znI0=; b=mmlle5RMxBmj/7TmXbQ381NicVW1jmLsizwhr9jviwTaa5ROQi+dH+BDqTE7UIh2AY mv9C8X9FwMmWFZLBIkGUUoxoJMAFZjitlGVGkQgNNC5ayWGOmGirgrFGHHPmTI2hLDmR VGlUCLYydOaTxGrO6oYMch81Or6LCszU5MwiureyRt/jFUPjPSLOgLVFPXp61/WadxVI wOgo21fiHwEbX2lFFxd5ODpiGv4O1y2M5wFmz4EajA/dQ0xCQTXgcE4QTfvt5qvg5LSM qqVPGz8xSlr7AsSJHFLQ+Qlwp8LEe3N2JJUVkwbVuJJOG8vS5HPLR2gOX/eKngYIPxdc 9/nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=AELpa+2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id nw10-20020a17090b254a00b0027d30e575ccsi11333160pjb.115.2023.11.21.06.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 06:00:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=AELpa+2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E92AA80ADEC7; Mon, 20 Nov 2023 00:47:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbjKTIqs (ORCPT + 99 others); Mon, 20 Nov 2023 03:46:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232466AbjKTIqi (ORCPT ); Mon, 20 Nov 2023 03:46:38 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2EABD70 for ; Mon, 20 Nov 2023 00:46:33 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3316d3d11e1so1374733f8f.0 for ; Mon, 20 Nov 2023 00:46:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1700469992; x=1701074792; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zOeweRIPTzisv61dwOGKybnTDN8hrPF1gwr4IaPej8U=; b=AELpa+2CXCkaWfwEbbZ8yxg91im79/l4D8Gwtc2ZpsFdgHqJsRuUgDw6UhLW5iUOaw 0FiEdlYw4OISlH1GyTUZDr29CvwOIgdNDK0oPgR86lR0W/jLE7v9hHi6iLgYyLWovcuN 8nur0uYIW1Bf8YnNDsbaRiwB+QzOKdU3PPW0g2zlGNNzThYS9G50PTb54wQqWJqVmp35 DK7fjMSqVZYV8AucUi0StDRhUmkXmIespw3zSaSJiIQ4tZeXBzA04osOpfQSZbzKSLyb AgzfNjoIwXTBvehl4Hw9Ac5lQJbtfpQz5vVVuhNcs6g7HIe3K7xK2Q2rF8/7mnnLfpo6 uxYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700469992; x=1701074792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zOeweRIPTzisv61dwOGKybnTDN8hrPF1gwr4IaPej8U=; b=pKffiwesQz05MNeX1zHg6inMJDmG8JXQus/3BGmG2w/sxJAIllSL5+tMziVlJ1BwYj 5r+LD256f7mE2eu0NzmWc/wCKB4Jxz5lyTG+Tq5X0WNzyMSbrE2tyIpgbSvBZYuJAL40 CQ6XphHQ77y5ix/804CmVkLo4WSpq7pmCGoK+p0AF8NbEX+i4eAG44+Ig3RMMWeqaz1Q inA88DcWJQbe3Zm9uiwYo8g7gDD0DHeftih07cZeqFPD9upTVLZ+9O2kDgqACV5o3Qdg Vu0J8SJs3U5brcGOzvCoLp/SGhHGRZdGCK5ZExui72R0xez9HxEg+g66JFTwiKb1io7P Ep9w== X-Gm-Message-State: AOJu0YyOvMdm52pQAvq4z1ugHOxEl++MHNcIpowHsdmf3x0cwRizz98l 8OeB0UQax48UdiFDvQOhdUwtsA== X-Received: by 2002:a05:6000:2ce:b0:331:2f9e:e8a8 with SMTP id o14-20020a05600002ce00b003312f9ee8a8mr6641722wry.8.1700469992303; Mon, 20 Nov 2023 00:46:32 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.183]) by smtp.gmail.com with ESMTPSA id b8-20020a5d45c8000000b003142e438e8csm10435267wrs.26.2023.11.20.00.46.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 00:46:31 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, p.zabel@pengutronix.de, yoshihiro.shimoda.uh@renesas.com, geert+renesas@glider.be, wsa+renesas@sang-engineering.com, biju.das.jz@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com, sergei.shtylyov@cogentembedded.com, mitsuhiro.kimura.kc@renesas.com, masaru.nagai.vx@renesas.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Claudiu Beznea Subject: [PATCH 07/13] net: ravb: Rely on PM domain to enable gptp_clk Date: Mon, 20 Nov 2023 10:46:00 +0200 Message-Id: <20231120084606.4083194-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231120084606.4083194-1-claudiu.beznea.uj@bp.renesas.com> References: <20231120084606.4083194-1-claudiu.beznea.uj@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 00:47:19 -0800 (PST) From: Claudiu Beznea ravb_rzv2m_hw_info::gptp_ref_clk is enabled only for RZ/V2M. RZ/V2M is an ARM64 based device which selects power domains by default and CONFIG_PM. The RZ/V2M Ethernet DT node has proper power-domain binding available in device tree from the commit that added the Ethernet node. (4872ca1f92b0 ("arm64: dts: renesas: r9a09g011: Add ethernet nodes")). Power domain support was available in rzg2l-cpg.c driver when the Ethernet DT node has been enabled in RZ/V2M device tree. (ef3c613ccd68 ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC")). Thus remove the explicit clock enable for gptp_clk (and treat it as the other clocks are treated) as it is not needed and removing it doesn't break the ABI according to the above explanations. By removing the enable/disable operation from the driver we can add runtime PM support (which operates on clocks) w/o the need to handle the gptp_clk in Ethernet driver functions like ravb_runtime_nop(). PM domain does all that is needed. Signed-off-by: Claudiu Beznea --- drivers/net/ethernet/renesas/ravb_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 0fc9810c5e78..836fdb4b3bfd 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2762,7 +2762,6 @@ static int ravb_probe(struct platform_device *pdev) error = PTR_ERR(priv->gptp_clk); goto out_disable_refclk; } - clk_prepare_enable(priv->gptp_clk); } ndev->max_mtu = info->rx_max_buf_size - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); @@ -2786,7 +2785,7 @@ static int ravb_probe(struct platform_device *pdev) /* Set GTI value */ error = ravb_set_gti(ndev); if (error) - goto out_disable_gptp_clk; + goto out_disable_refclk; /* Request GTI loading */ ravb_modify(ndev, GCCR, GCCR_LTI, GCCR_LTI); @@ -2806,7 +2805,7 @@ static int ravb_probe(struct platform_device *pdev) "Cannot allocate desc base address table (size %d bytes)\n", priv->desc_bat_size); error = -ENOMEM; - goto out_disable_gptp_clk; + goto out_disable_refclk; } for (q = RAVB_BE; q < DBAT_ENTRY_NUM; q++) priv->desc_bat[q].die_dt = DT_EOS; @@ -2869,8 +2868,6 @@ static int ravb_probe(struct platform_device *pdev) /* Stop PTP Clock driver */ if (info->ccc_gac) ravb_ptp_stop(ndev); -out_disable_gptp_clk: - clk_disable_unprepare(priv->gptp_clk); out_disable_refclk: clk_disable_unprepare(priv->refclk); out_release: @@ -2893,7 +2890,6 @@ static void ravb_remove(struct platform_device *pdev) if (info->ccc_gac) ravb_ptp_stop(ndev); - clk_disable_unprepare(priv->gptp_clk); clk_disable_unprepare(priv->refclk); /* Set reset mode */ -- 2.39.2