Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228AbbDALEQ (ORCPT ); Wed, 1 Apr 2015 07:04:16 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:62372 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbbDALEN (ORCPT ); Wed, 1 Apr 2015 07:04:13 -0400 X-AuditID: cbfec7f5-b7fc86d0000066b7-da-551bcfe1cc95 Message-id: <551BD07E.2090506@samsung.com> Date: Wed, 01 Apr 2015 13:03:26 +0200 From: Sylwester Nawrocki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-version: 1.0 To: Javier Martinez Canillas Cc: Abhilash Kesavan , Tomasz Figa , Stephen Boyd , Mike Turquette , Kukjin Kim , Olof Johansson , Doug Anderson , Krzysztof Kozlowski , Kevin Hilman , Tyler Baker , Chanwoo Choi , linux-arm-kernel , "linux-samsung-soc@vger.kernel.org" , linux-kernel Subject: Re: [RFC PATCH v3 2/2] clk: exynos5420: Make sure MDMA0 clock is enabled during suspend References: <1427730803-28635-1-git-send-email-javier.martinez@collabora.co.uk> <1427730803-28635-3-git-send-email-javier.martinez@collabora.co.uk> <551976F1.1000605@collabora.co.uk> <551AFCCE.4050404@collabora.co.uk> In-reply-to: <551AFCCE.4050404@collabora.co.uk> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRmVeSWpSXmKPExsVy+t/xK7oPz0uHGvR+Z7W4/uU5q8XZZQfZ LI7+LrB4/cLQYs1fJYv+x6+ZLb4eXsFosenxNVaLy7vmsFnMOL+PyeLphItsFqeuf2az+HGm m8Vi1a4/jBYfd9xjceD3mN1wkcXjcl8vk8ff59dZPHbOusvusWlVJ5vHnWt72Dw2L6n3uHKi idWjb8sqRo/Pm+QCuKK4bFJSczLLUov07RK4Mtb9n8RUcFiiYuPqlywNjOeEuxg5OSQETCTu nbvMDmGLSVy4t56ti5GLQ0hgKaNEd9t9JpCEkMAnRonFB+NAbF4BLYk3G9rYQGwWAVWJ3R9n gDWzCRhK9B7tYwSxRQUiJE7e3cMOUS8o8WPyPRYQW0TATuLG6ofMIDazwEsWiaczxUBsYYEk iTMbH0Etfssk0dmwBmwBp4C+xP6mKUBDOYAa1CWmTMmF6JWX2LzmLfMERoFZSFbMQqiahaRq ASPzKkbR1NLkguKk9FwjveLE3OLSvHS95PzcTYyQ6Pq6g3HpMatDjAIcjEo8vIXZUqFCrIll xZW5hxglOJiVRHjPnpAOFeJNSaysSi3Kjy8qzUktPsTIxMEp1cC4znxjZISjiu4+b3mG3xYH N83wOLE/f7lHIt9F/SqFkqgXaZYTTL5G1SyIU107va3t36TDyn71Ph9F3YSvaBR0/8szDE39 Yff+HNcCc7Hz59d2JaR5lC8x2nRl53KmOmEFLzF3//WLhXLCeXpP2XObH9ydclC/9hbL4uzt srs+nzx657vH+htKLMUZiYZazEXFiQB8rQlejAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3319 Lines: 70 Hello, On 31/03/15 22:00, Javier Martinez Canillas wrote: > On 03/31/2015 04:38 PM, Abhilash Kesavan wrote: >> javier.martinez@collabora.co.uk> wrote: >>> Unfortunately I don't fully understand why this clock needs to be >>> enabled. It would be good if someone at Samsung can explain in >>> more detail what the real problem really is. >>> >> >> I had a look at this some more today. The problem actually occurs when the >> mdma0 clock's parent - aclk266_g2d gets disabled. The run-time pm support >> in the dma driver disables mdma0 and in turn aclk266_g2d which causes the >> issue. >> From the User Manual, it appears that aclk266_g2d should be gated only when >> certain bits in the clock gating status register are 0. I cannot say for >> certain, but our gating the aclk266_g2d clock without the CG_STATUS bits >> being 0 could be a cause of the suspend failure. >> > > Thanks a lot for the explanation. I see the NOTE at the bottom of section > 7.9.1.159 CLK_GATE_BUS_TOP that mentions that. I'll add this information > to the commit message when posting as a proper patch instead of a RFC. > > I confirmed that changing the patch to prevent "aclk266_g2d" to be gated > instead of "mdm0" also makes the system to resume correctly from suspend > so I'll change that on the patch as well. > > I see that many of the Exynos5420 clocks (including "aclk266_g2d") use the > CLK_IGNORE_UNUSED flag but AFAIU it only prevents the common clock framework > to disable the clocks on init but doesn't prevent the clocks to be disabled > if all the clock childs are gated so the parent is gated as well. > >> As the CG_STATUS bits are not being checked anywhere in the kernel I think >> aclk266_g2d (and others in GATE_BUS_TOP) should not be gated. I am OK with > > For now I'll just add "aclk266_g2d" but later if needed all the GATE_BUS_TOP > clocks (and others) that should only be gated when CG_STATUS is 0 can be > added. My patch iterates over a list of clocks to be kept during suspend even > when there is only one for now so adding more later if needed will be trivial. It's not clear what subsystems affect state of the CG_STATUSx registers, it would be good if we could get more information on that. They are in the PMU block and are related to LPI (Low Power Interface handshaking), but what subsystems/peripheral blocks exactly are associated with them it's not clear from the documentation. I think it's essential to understand what triggers changes in CG_STATUSx registers, before we start checking their value in the clock driver. Also it might be that there are indeed some clocks which must stay enabled over suspend/resume cycle, then the approach with enabling/disabling clocks in the clock driver might not be such a hack as it looks at first sight. > Or do you think that I should add all the GATE_BUS_TOP clocks now? No, please don't do that. That includes many important clocks and we should be certain what we are doing. I don't think it is expected to touch those clocks in that way, it would likely cause more issues. -- Thanks Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/