Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1502666imm; Thu, 19 Jul 2018 02:53:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6JbxjqZycF5eWfqZ2kNcajcGmEknLLs9iSXp9eB/Q1+2RBBYF4hCAwfXESxmnFmj4kIWj X-Received: by 2002:a17:902:48c8:: with SMTP id u8-v6mr9518760plh.152.1531994013195; Thu, 19 Jul 2018 02:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531994013; cv=none; d=google.com; s=arc-20160816; b=HW+4qaViRIxdh5tT0+Fdgplh5R9Eh2LCt0YFU13+aKcjQwqQL52KjlwN+Kp6JuGm6l S2Yg6gl2OQeW0+NIPhDpAd+h4StwQD/GkKwwuE+9DNAdgVcaH2ZjSJBVgDIMKTBgbto7 I6iQ9Rt6LTRCTsimv7SgUcS+brOyohuudi2WkCpu4fauhV1oF4R7w3Wn1ciAVYO2gFd+ uTWKRVYvgbTQR8gHdfNENb0E3/uBpW05WyiAhsCB/Lk1fuV4T6KuWHQjPqQV/jSbAvsW 9Ox6yyP6dUx5qSZdBUBGp7bR5H78ibfo5QooUx8tzKgYM/ROTTYC423ss9bZDyNixera FnVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=aNZ36+QWzshdFgKQsqEgl2M0b/ce0By8tLISrIGhBNI=; b=LOgNIwttSFbrxMbj+L1GYAGeSvlOecmqPFtTItwKzohQyW/KDdciYlNJ+kt9GspTau 5myfkTeXw/DT+qTLiob+bHrHaLY73srb7mDdy2JMgpk7M6KkXRS6xhwgtG8GZZkdgUf1 VZUTWWIIAYVfSoUfVWBwh8m/HPwGqHbLCxi578uJBjdlnq6WqfWppupgx/JLXf/8Ictx Xdda1+S/PFBYmPWMHPY0E3erazTIc49TZB8QbTnhmXF16pBceWRx5jFrg1mPIy03Okx+ 6Z+jCgYyWLhpCFBESeS8kOL+sCGR9iDM1x5mkK1zwWGrpBhvnFGI2ENggdf48A8MQa0N xeuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=imKdtES9; 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 v12-v6si5058658plo.264.2018.07.19.02.53.17; Thu, 19 Jul 2018 02:53:33 -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=imKdtES9; 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 S1727449AbeGSKfE (ORCPT + 99 others); Thu, 19 Jul 2018 06:35:04 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:36393 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbeGSKfE (ORCPT ); Thu, 19 Jul 2018 06:35:04 -0400 Received: by mail-oi0-f66.google.com with SMTP id r16-v6so14417041oie.3; Thu, 19 Jul 2018 02:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aNZ36+QWzshdFgKQsqEgl2M0b/ce0By8tLISrIGhBNI=; b=imKdtES9tGyWhIbTr90I+HQr+WIEL/23SnyrUALl/5g6xBeLLN4SsrX/TJA/w4nwTG LGj914yGZCbyoIGO2Xse3sBhrvPVIL5opS1kHT4IHSQEF9R+rnvIjazgsk8RLkxqxg1j rMpVX7XsJU6/b2DNkpy2+AfeIJ6WHjvx7CKYDSJvSeh6Bz9erpbRshVLVcCAPAZUNh4G sml5hLH64CQ/1FBC3pQnsnRJ+fDXK8jyw/q7xiHWbGQMnuTca1Ya33OFiF6ozZvR+NgB X7QnGNnm+Cwp8+DN81Khj/qh/yXGaXGFikJxEfd6HfNBREJipJYuvsHB4ZVvcBTCqQk2 6P3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aNZ36+QWzshdFgKQsqEgl2M0b/ce0By8tLISrIGhBNI=; b=ltUN+Hj/VhqtGh8KxfOyoHWDTi2/7/hkya+J/z2t6rGPMpN1ppzGl2VkOqbwQJ1/Wj 31euqK9uA6WkyeBKgzQKKrGzLHAlu90ENEcLEKMH6p/TDIu281jSbmARkymNK3k3Cfae xlEMiW1aYmqfTcR3sGzoTqAjyLZlFmRBkp27XcGeKAKbn0b6OqbNwq8XGnBnnyclKaX8 3GWjsQ07o+Rox98MMcLMJEpqlnuhCgWaUD9SVvS6depEO626CZZ42tfL5gnCcRp9Akv6 ZTsTeb9bx8783kgsVNf+q4KXyaKYOZ+fsNNxqPmEkflqNZOiUwaRzk6dGIWDa1Tz8Wpo QX2Q== X-Gm-Message-State: AOUpUlFm+twpblHVxier8IMe+eu4kpC32hmirQ2mispvWcBcdsJY/kV/ myfLcXRmzgxsYXic3HG3nP1revWDlnTIpuL/FVA= X-Received: by 2002:aca:bf07:: with SMTP id p7-v6mr10675148oif.285.1531993962380; Thu, 19 Jul 2018 02:52:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:5b33:0:0:0:0:0 with HTTP; Thu, 19 Jul 2018 02:52:21 -0700 (PDT) In-Reply-To: References: <1531822342-4293-1-git-send-email-linux.amoon@gmail.com> From: Anand Moon Date: Thu, 19 Jul 2018 15:22:21 +0530 Message-ID: Subject: Re: [PATCH 1/5] thermal: exynos: enable core tmu clk on exynos platform To: Krzysztof Kozlowski Cc: Bartlomiej Zolnierkiewicz , Zhang Rui , Eduardo Valentin , Kukjin Kim , Rob Herring , Mark Rutland , Linux PM list , "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel , Linux Kernel , devicetree Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On 18 July 2018 at 15:36, Krzysztof Kozlowski wrote: > On 18 July 2018 at 11:24, Anand Moon wrote: >> Hi Krzysztof >> >> On 18 July 2018 at 11:47, Krzysztof Kozlowski wrote: >>> On 17 July 2018 at 22:23, Anand Moon wrote: >>>> Hi Krzysztof >>>> >>>> On 17 July 2018 at 17:50, Krzysztof Kozlowski wrote: >>>>> Hi Anand, >>>>> >>>>> Thanks for patch. >>>>> >>>>> On 17 July 2018 at 12:12, Anand Moon wrote: >>>>>> clk_summary do not show tmu_apbif clk enable, so replace >>>>>> the clk_prepare with clk_prepare_enables to enable tmu clk. >>>>> >>>>> This is not valid reason to do a change. What is clk_summary does not >>>>> really matter. Your change has negative impact on power consumption as >>>>> the clock stays enabled all the time. This is not what we want... so >>>>> please explain it more - why you need the clock to be enabled all the >>>>> time? What is broken (clk_summary is not broken in this case)? >>>>> >>>> >>>> Opps I could not explain some more in my commit message. >>>> >>>> Actually TMU sensor for Exynos process are controlled by so external clk >>>> >>>> Exynos4412 have VDD18_TS sensor which controls the CLK_SENSE tmu. >>>> Exynos5422 have VDD18_TS01 / VDD18_TS23 / VDD18_TS4 sensor which >>>> control the CLK_SENSE tmu. >>>> >>>> So as per my understanding tmu is clk driver which control the flow PMIC. >>>> >>>> clk_prepare_enable combine clk_prepare and clk_enable >>>> and clk_disable_unprepare combine clk_disable and clk_unprepare. >>>> >>>> most of the driver prefer clk_prepare_enable and clk_disable_unprepare. >>>> >>>> clk_summary is just a reference looking point where we could check the >>>> clk is enable/disable. >>>> >>>> what is broken ? >>>> I still few more parameter need to tuned to configure the tmu driver. >>> >>> I am sorry but I am still unable to see what is broken and what are >>> you trying to fix. I asked what is broken and you replied that there >>> is a sensor, there is a clock, drivers use clk_prepare_enable and some >>> more parameter need to be tuned... None of these are answers to >>> question - what is broken. How can I reproduce the problem? >>> >>> Best regards, >>> Krzysztof >> >> Basically I use thermal testing. >> >> # git clone https://git.linaro.org/power/pm-qa.git >> # cd pm-qa >> # make -C thermal check >> >> most of the testcase failed on Exynos5422 but some pass on Exynos4412. >> >> Attach is the software overview from Exynos5422 user manual. >> >> I am not able to explain in deep technically, but I have studied other thermal >> driver to draw into conclusion that tmu clk's need to be enabled. > > That is true in general - the clk has to be enabled in certain cases. > However you did not say at all when you want this clock to be > enabled... and the your patch enables it for entire lifetime of > device. > >> If you feel the we should not enable these clk, them I will drop the >> clk_prepare_enable check >> and resubmit the changes with better commit message. > > I don't know. This was fifth email in this thread and it is the first > time some real problem is mentioned. Still the issue is not described > entirely so I really do not have a clue whether this patch fixes > something or not. > What is more, you mentioned falling pm-qa tests here (not in commit > msg) but did not say whether this patch fixes anything or not. > > So let me summarize it: > 1. You did not describe the problem you want to fix. > 2. The patch looks incorrect because it enables the clock for entire > lifetime of device which we do not want. > 3. The patch might or not might fix some problem. We even do not know what... > 4. The clock not being enabled when not needed... is obviously not a problem. > > Please start from beginning. Find the problem, tell us how it can be > reproduced and deliver a single patch which fixes the problem. > > This pattern of your code - fixing something without describing the > problem - happened many time before. I repeated this some times before > as well. I would prefer not to repeat to many times. Therefore I would > be happy if you follow the path mentioned in paragraph before always: > find the problem, tell how it can be reproduced, deliver single patch > which fixes the problem. > > Best regards, > Krzysztof Yes I will try to improve my self to the point commit message and code as per the documentation. Let me clear my thoughts on clk's turned on for by driver. Please correct me If I am wrong. Exynos support Power domain to control the dynamic power consumption via clk. Operating voltage Operating frequency Toggling ratios of the logic gate PMU generates power control signal to regulator or PMIC. To reduce the dynamic power consumption, Exynos SCP uses clock gating and frequency scaling. Exynos process support tmu power domain Power Domain Power Source Internal Power Gating Method Included Modules TEMP VDD18_TEMP None TEMP SENSOR Exynos TMU is directly co-related to CPU frequency scaling module. as their is increase in CPU clk speed with increase in temperature TMU will control the flow of cpu speed via clk freq scaling. It might be a good option to implement pm_runtime for tmu driver. If you are not satisfied with this series of change lets drop them. I will just re-submit err-clean up and e-Fuse changes. Best Regards -Anand