From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY 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 46230C43219 for ; Mon, 29 Apr 2019 08:09:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 16BDA2087B for ; Mon, 29 Apr 2019 08:09:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kNgZaELE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16BDA2087B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WRuRvii1ytgRkSJYsvLnPhVJG2dFZKo3g3I2+lGENr8=; b=kNgZaELEfuwSBY PJhjyF/ZDAbVN3SdIjEG38Wf4j6Ajda1QTjUITZaWfgwTdg2Og9Rw7qZg/yQ6J8ZvCn7kdpyP+lOM rR9wqAVH9ckKsCQYtJPxiZheovWToRXqYBeq31L++jwFXv3ZOEHOn+nNr01+hfgEoUUSbu6CwUPEw 0C/A6/0doXJpo+n5YKVOKL9Z24jLqaK/vARO/9ODS2cx1QrNaISvNrTK75kvg5kHhiPdS/7SN46Ev kldKBC4d22ur/eI2FJOLPgYC+ZR2JrfFaYeCllcbRTLF1/6hv21wzfJatmogPlg8iNmqvGPiHYGxA /maH0dLIV3cV0qqmiKdg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hL1Lp-0004nX-PD; Mon, 29 Apr 2019 08:09:25 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hL1Lm-0004mV-Iy; Mon, 29 Apr 2019 08:09:24 +0000 X-UUID: 4ff5c9dba4d244a2a385a95fd8f691ba-20190429 X-UUID: 4ff5c9dba4d244a2a385a95fd8f691ba-20190429 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 147006063; Mon, 29 Apr 2019 00:09:18 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 29 Apr 2019 01:09:17 -0700 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 29 Apr 2019 16:09:14 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 29 Apr 2019 16:09:13 +0800 Message-ID: <1556525353.24897.30.camel@mhfsdcap03> Subject: Re: [PATCH 2/6] net: stmmac: fix csr_clk can't be zero issue From: biao huang To: Alexandre Torgue Date: Mon, 29 Apr 2019 16:09:13 +0800 In-Reply-To: <24f4b268-aa7f-e1f7-59fc-2bc163eb8277@st.com> References: <1556433009-25759-1-git-send-email-biao.huang@mediatek.com> <1556433009-25759-3-git-send-email-biao.huang@mediatek.com> <24f4b268-aa7f-e1f7-59fc-2bc163eb8277@st.com> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190429_010922_624422_4F4F96A0 X-CRM114-Status: GOOD ( 16.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jianguo.zhang@mediatek.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, yt.shen@mediatek.com, Jose Abreu , linux-mediatek@lists.infradead.org, Maxime Coquelin , Matthias Brugger , Giuseppe Cavallaro , davem@davemloft.net, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Mon, 2019-04-29 at 09:18 +0200, Alexandre Torgue wrote: > Hi > > On 4/28/19 8:30 AM, Biao Huang wrote: > > The specific clk_csr value can be zero, and > > stmmac_clk is necessary for MDC clock which can be set dynamically. > > So, change the condition from plat->clk_csr to plat->stmmac_clk to > > fix clk_csr can't be zero issue. > > > > Signed-off-by: Biao Huang > > --- > > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > index 818ad88..9e89b94 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c > > @@ -4376,7 +4376,7 @@ int stmmac_dvr_probe(struct device *device, > > * set the MDC clock dynamically according to the csr actual > > * clock input. > > */ > > - if (!priv->plat->clk_csr) > > + if (priv->plat->stmmac_clk) > > stmmac_clk_csr_set(priv); > > else > > priv->clk_csr = priv->plat->clk_csr; > > > > So, as soon as stmmac_clk will be declared, it is no longer possible to > fix a CSR through the device tree ? let's focus on the condition: 1. clk_csr may be zero, it should not be the condition. or the clk_csr = 0 will jump to the wrong block. 2. Since stmmac_clk_csr_set will get_clk_rate from stmmac_clk, the plat->stmmac_clk is a more proper condition. In some case, it's impossible to get the clk rate of stmmac_clk, so it's better to remain the clk_csr flow. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel