Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3383492pxb; Mon, 17 Jan 2022 19:12:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFcVXvLHMnfBpYoga/6Iqfs0/s92cKmECKnFPSSWJSx04XpSHwhEpleXp65BPpCavNPA4+ X-Received: by 2002:aa7:92d1:0:b0:4bb:9d7:6951 with SMTP id k17-20020aa792d1000000b004bb09d76951mr23886736pfa.40.1642475554663; Mon, 17 Jan 2022 19:12:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475554; cv=none; d=google.com; s=arc-20160816; b=KdRX4y8AvCNTvGtk56+wJKZJBHP/f6zy9IxLBlJHV43BFBd/Pvvj9eu4IOWS6Fv3RR 9yLRknxKnIVHnVJvgNFgILcc+TyffKNeq0XtO24NQb33ik/tlLjCj8OraHbyU6EGhupO g5lJYMGFQRTkmL394emXK9SXe7lH8jm5DVaQ9Oe7KJHlgytDCXwveGO17D1x/2c0rtNp YFDkJu+hID3aR3VFWG0Af5YCa9cU3Dw5HlKpOtAdIbIK+t21e449nnQQDAMFwNye2cHn I4gklDKktFHr6Ev27SH6HDcM4j082eT5iqU46jBRA8Nv7EW6CACFiEleBHpjdVmo+X2p UmpQ== 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:date:cc:to:from:subject:message-id; bh=Rvo0qtVLcdEGDnZZ65rQUFDouoHLrXmmiIKgDy6KC34=; b=Sl6u8/FGVJHeIwROqJXLrm92bgOPjrt9LjxaWj6Di2w3zs9fEBrIF1YV7rXVEMMl2O gQvGrMLvkj7YN4D4m64ZEow2mjHjNzGMHf/QMpvvOTl0a+6u+yOhSncyI8RxZ4tNF7e1 H1x4BArC7QPRBTkNURFMdMpMxWJtHQv8aQoIiqjeYD4V7LtJI7gCZwsGH0R1eti/n45s pkldY+yBWvOC+cSWlx6RAcVCLKVMzMAtTq6LYDd8pmdobfsa71XG9oQLCKHaP063ykmH Rs1BGChanG8frUiPViYLPnD5P5IwYnnQDWpCgQ6oNVjVZdLJeCb2V+SvS0inJgqV8Oeq RBJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x16si16932429pfh.45.2022.01.17.19.12.22; Mon, 17 Jan 2022 19:12:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238735AbiARBvw (ORCPT + 99 others); Mon, 17 Jan 2022 20:51:52 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:38748 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S236467AbiARBvv (ORCPT ); Mon, 17 Jan 2022 20:51:51 -0500 X-UUID: 7fe5b39085b348c1972f0ae24ea6cf92-20220118 X-UUID: 7fe5b39085b348c1972f0ae24ea6cf92-20220118 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 805230940; Tue, 18 Jan 2022 09:51:48 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 18 Jan 2022 09:51:47 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 18 Jan 2022 09:51:45 +0800 Message-ID: Subject: Re: [PATCH net-next v12 3/7] stmmac: dwmac-mediatek: re-arrange clock setting From: Biao Huang To: AngeloGioacchino Del Regno , , Jakub Kicinski , Rob Herring CC: Matthias Brugger , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , , , , , , , , , Date: Tue, 18 Jan 2022 09:51:45 +0800 In-Reply-To: <2c62f337-5eb4-e525-7e3a-289435315c09@collabora.com> References: <20220117070706.17853-1-biao.huang@mediatek.com> <20220117070706.17853-4-biao.huang@mediatek.com> <2c62f337-5eb4-e525-7e3a-289435315c09@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Angelo, Thanks for your comments. On Mon, 2022-01-17 at 11:38 +0100, AngeloGioacchino Del Regno wrote: > Il 17/01/22 08:07, Biao Huang ha scritto: > > The rmii_internal clock is needed only when PHY > > interface is RMII, and reference clock is from MAC. > > > > Re-arrange the clock setting as following: > > 1. the optional "rmii_internal" is controlled by devm_clk_get(), > > 2. other clocks still be configured by devm_clk_bulk_get(). > > > > Signed-off-by: Biao Huang > > --- > > .../ethernet/stmicro/stmmac/dwmac-mediatek.c | 72 +++++++++++++- > > ----- > > 1 file changed, 49 insertions(+), 23 deletions(-) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c > > b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c > > index 8747aa4403e8..2678d2deb26a 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c > > @@ -49,14 +49,15 @@ struct mac_delay_struct { > > struct mediatek_dwmac_plat_data { > > const struct mediatek_dwmac_variant *variant; > > struct mac_delay_struct mac_delay; > > + struct clk *rmii_internal_clk; > > struct clk_bulk_data *clks; > > - struct device_node *np; > > struct regmap *peri_regmap; > > + struct device_node *np; > > struct device *dev; > > phy_interface_t phy_mode; > > - int num_clks_to_config; > > bool rmii_clk_from_mac; > > bool rmii_rxc; > > + int num_clks; > > I don't see any need to get a num_clks here, at this point: since all > functions > reading this are getting passed a pointer to this entire structure, > you can > simply always access plat->variant->num_clks. > > Please, drop the addition of num_clks in this struct. > > Regards, > Angelo OK, will remove it in next send.