Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp417620yba; Sat, 4 May 2019 05:15:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqygL4lWnnY2YrZkzRpXKowKhZs6C7gRinDUyqCwWImZMRK6HY+wk+W36ysGet67lqCnrTl0 X-Received: by 2002:a63:cd50:: with SMTP id a16mr17796466pgj.394.1556972119747; Sat, 04 May 2019 05:15:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556972119; cv=none; d=google.com; s=arc-20160816; b=BsiL1PbaM7v/ux8mS6513YRr5eH4fDbvN9CWB/yeIISBRkc+Ffs5RvC9gvS2Gfh99e DbNqN9kDnQ3qQlknGJqB9ahR9XMqrjHjeRi47oajumsmwTRYpd+oip7xy0RpF4KacGZi MvLqy0t4ddvz4QTCNrrZBXcvrLqaLSDRzyLwugBiiNg+nFcTd+EEfImQskoY84b2fMu8 CEdDcXUf6jSTdh4eB3+K5w8pVhoIZLlNPSgdB35Jote5MxQhgJThvqjJ7Vc1/NpN9bw6 nEZDD8kb0XnB4nRmgAS6ys3xhhJ7dJIdP9dBZJbofyaE6LByOfJeVNSC/2NkhZpsW6rq Lvaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BiywJZA9r6kxv/OyDdQ+nsf3ks4JUNhEjjCyaz/iKGE=; b=QO8CU2fBfRAjhLpLQyiWPdb/E+Y0MXCIoAq+erbEXbeKOTvW8R1mhQz8B8zUMnt6vM /erKN67kpfImp6EZIWuAKl/cyBs7zaxJ4iu/znUrFr6xzW6xV2QAAGXOdKGwfscFNwYT EmYyl+mp7bIGbTrp58hQRbTwpzKVoiYSd1+wrcYbaKUw+PXDxa2i9WxsMqzDjOgKHwNH Vh7Y0JtbpkIPAWxN7CLSEnB+1hNTGu6oQn9MqB5P+/MbikMb/lI+Ezy+/x/VOTUtvqta 6wW+HdGbi1cpnSZP6T1n93kpW0MI5OsQn0KGwdFp/YMFIZAkGZRHk8IZfHEkHqkEK9kK KwHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q97G8pZi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13si6682203pgn.560.2019.05.04.05.15.04; Sat, 04 May 2019 05:15:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Q97G8pZi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726796AbfEDLD6 (ORCPT + 99 others); Sat, 4 May 2019 07:03:58 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:38293 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfEDLD6 (ORCPT ); Sat, 4 May 2019 07:03:58 -0400 Received: by mail-lj1-f194.google.com with SMTP id e18so7299445lja.5; Sat, 04 May 2019 04:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=BiywJZA9r6kxv/OyDdQ+nsf3ks4JUNhEjjCyaz/iKGE=; b=Q97G8pZiOy62ZVDNe0KVvckArrkMdxecNMK4C/6pgUuK8qH7i5kTR0Xp9u0nXvwy7h ieRz1pH9APKGOrspbwKDycEg93+6W263uNuzYcBeJQYleT8EaeL6QY6XR/yIrk+xtufz C6371n8NrtHYFPe6DHKMlYBxBa1EXFXF5t3V276WQnuPj9AFY5iwuk7lSd8RMNRHtAau XMzujU6b0I2dH/9Qdfs9Te1PrrHwdrUEIrc0lpC7nPuqmC8A/QxsznKfCrqNVO0iWXQ5 8Qm1DP/ACg/HV3uBVnYP5tyRc0+y7isFYLES++OZ0zSPeZN0GeWiwiXuoMQX/Cifce8V qWJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=BiywJZA9r6kxv/OyDdQ+nsf3ks4JUNhEjjCyaz/iKGE=; b=We1011AvdsidE1gxliuTsal6ZnL1SLQzMNvQNUdCA77csaSurqw1ift8VpdtDEJMB+ oZsIXk1Dy5Jn6DN0zL4VpI9ANn+IGVnN4LFEYHYVmEaq0C2iU5iYRmLLfY64mOHvlBWw LT7rTGSbgXOLAkE0p3v5PXiJCArr4ePJUdhyrihwUqwM0uGvWOJOC7a+UKLhh0mTBSQe PYo2PF8MlR1mgxolRUgn56657K9ljYI29Qn5hZlUXajnDoAjDE0OeflBFmxgXrByJwU4 tn+cc5mvmuWX/bkVUzqMcBLcmewGsP3qptV7xZ6oF4gl2x8Ux1cgHrWdgJxrHL1HioAA K47w== X-Gm-Message-State: APjAAAWvPd9VhqcdS1T4m9RpY8N+m3I2hXykGt5juI5+gP6uBgXt11VK 0ZyQ82KZ/8BhtaeULu5Q/tnKAIOYqfGYqyrm7kM= X-Received: by 2002:a2e:9188:: with SMTP id f8mr5201827ljg.100.1556967835818; Sat, 04 May 2019 04:03:55 -0700 (PDT) MIME-Version: 1.0 References: <1556190530-19541-1-git-send-email-liuk@cetca.net.cn> In-Reply-To: <1556190530-19541-1-git-send-email-liuk@cetca.net.cn> From: Fabio Estevam Date: Sat, 4 May 2019 08:03:55 -0300 Message-ID: Subject: Re: [PATCHv2 1/2] ARM: dts: imx6sx: Use MX6SX_CLK_ENET for fec 'ahb' clock To: Kay-Liu Cc: Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Sascha Hauer , NXP Linux Team , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kay-Liu, On Thu, Apr 25, 2019 at 8:09 AM wrote: > > From: Kay-Liu > > The imx6sx's dts file defines five clocks for fec, the > 'ahb'clock's value is IMX6SX_CLK_ENET_AHB, but in the > i.MX6SX Reference Manual there is no such enet ahb clock, > there is only one "enet clock" in the CCM_CCGR3 register > which is controlled by bits 5-4, the enet clock is defined > for the 'ipg' clock, this can cause problem. > The original phenomenon is using imx6-solox processor and > Marvel 88E6390 switch with linux OS, the kernel will hang > during the startup of the linux OS. > After analyzing the phenomenon, the reason of CPU hang is > read/write enet module's register when the enet clock > is disabled. The kernel code try to avoids the problem > by resume enet clock before read/write enet register. > But the enet module's clock config will cause a special > environment which can bypass the clock resume mechanism. > The CPU has only one enet clock, after kernel parses > the dts file, the two clock variables 'ipg' and 'ahb' > finnaly point to the same enet clock register. This will > cause enet clock be disabled after fec probe over. > Because the power saving module will affect the BUG, so > there are two situations for this problem: > 1)Turn off power saving > Turn off power saving means that the resume mechanism is > disabled, so after fec probe over if any one read/write > enet module's register, the CPU will hang because no one > could resume the enet clock. > 2)Turn on power saving > Turn on power saving could resume enet clock before > read/write enet register by enable 'ipg' clk, this will > cause 'ahb' variable state and enet clock register value > don't match.If any task read/write enet at a high > frequently, the kernel will keep resume state and never > enter suspend process, this means that the kernel will > only modifies the register value during the first resume. > But the kernel init will check unused clock variable in > the late initcall, the 'ahb' clock will be treated as > unused, at this time, the enet clock will be disabled > bypass the resume mechanism, then the next read/write > enet module's register will cause the CPU hang. > Proposed solution is delete the 'ahb' clock's definition > in the clk-imx6sx.c, and modify fec device=E2=80=99s clocks in > the dts file, point =E2=80=98ahb=E2=80=99 from IMX6SX_CLK_ENET_AHB to > IMX6SX_CLK_ENET > > Signed-off-by: Kay-Liu > --- > Change since v1: > -inproved commit log description > -add platform related clock change instead of describe is in the external= URL > > arch/arm/boot/dts/imx6sx.dtsi | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dts= i > index 5b16e65..b8b23a6 100644 > --- a/arch/arm/boot/dts/imx6sx.dtsi > +++ b/arch/arm/boot/dts/imx6sx.dtsi > @@ -919,7 +919,7 @@ > interrupts =3D , > ; > clocks =3D <&clks IMX6SX_CLK_ENET>, > - <&clks IMX6SX_CLK_ENET_AHB>, > + <&clks IMX6SX_CLK_ENET>, Yes, there is really no IMX6SX_CLK_ENET_AHB as per the Refernce Manual and it is the same we do on imx6qdl.dtsi: Reviewed-by: Fabio Estevam