From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754235AbcGEIvq (ORCPT ); Tue, 5 Jul 2016 04:51:46 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:28772 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754181AbcGEIux (ORCPT ); Tue, 5 Jul 2016 04:50:53 -0400 X-AuditID: cbfec7f4-f796c6d000001486-c2-577b74ea6eb1 Subject: Re: [RFC PATCH 1/2] rtc: s3c: Remove unnecessary call to disable already disabled clock To: Alim Akhtar , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org References: <1467630195-6929-1-git-send-email-alim.akhtar@samsung.com> <577B5F28.1010905@samsung.com> <577B73FE.1020509@samsung.com> Cc: alexandre.belloni@free-electrons.com, javier@osg.samsung.com, pankaj.dubey@samsung.com From: Krzysztof Kozlowski Message-id: <577B74E8.3010208@samsung.com> Date: Tue, 05 Jul 2016 10:50:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-version: 1.0 In-reply-to: <577B73FE.1020509@samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsVy+t/xK7qvSqrDDd4v57PouLaYyeLBvG1s Fm/ermGyeP3C0OLyrjlsFou2fmG32N/ZwejA7vFk00VGjz0TT7J5bOm/y+7Rt2UVo8fnTXIB rFFcNimpOZllqUX6dglcGfP2T2YqaOGsaHt7hLWBcSt7FyMnh4SAicTLPb2sELaYxIV769m6 GLk4hASWMkr0bV/ADOE8Y5SY/GAdE0iVsECSxOEtt1i6GDk4RARSJVqeGkLUtDFKLF99hBmk hlkgRuLShjVgNpuAscTm5UvYQGxeAS2JK6tvg21jEVCVWPNoEtgVogIRErO2/2CCqBGU+DH5 HguIzSmgLbF3SgsbyC5mAT2J+xe1IMbLS2xe85Z5AqPALCQdsxCqZiGpWsDIvIpRNLU0uaA4 KT3XUK84Mbe4NC9dLzk/dxMjJMC/7GBcfMzqEKMAB6MSD++JhVXhQqyJZcWVuYcYJTiYlUR4 DxdXhwvxpiRWVqUW5ccXleakFh9ilOZgURLnnbvrfYiQQHpiSWp2ampBahFMlomDU6qBMf/S B5nPKYXaW4r5Kn4eCmvUCQ/bvjK7bO5VTtaToodDa7oOp4UfkU2cPPOoiGFJ/t8HiSXzLuut MWCYXiGY+qBOSU/zq9PVxoB5rQu4i9+kVM17KP3Yc5+65FGWa3VfJj9P5jr13M/91M0j7dln uWTOCBo0lld80396wmhW5aeYS7Ulwa4iSizFGYmGWsxFxYkAxKa+5GwCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/05/2016 10:46 AM, Alim Akhtar wrote: > Hi Krzsztof, > > On 07/05/2016 12:48 PM, Krzysztof Kozlowski wrote: >> On 07/04/2016 01:03 PM, Alim Akhtar wrote: >>> At the end of s3c_rtc_probe(), s3c_rtc_disable_clk() being called >>> with rtc >>> clock already disabled, which looks extra and unnecessary call. >>> Lets clean it up. >> >> Does not look right. Till that place, the clocks are enabled. Then >> s3c_rtc_setaie() is called which expects that clocks are disabled... >> otherwise counters get mixed. >> > > The clock is always disabled when it reach s3c_rtc_setfreq() in probe(), > because s3c_rtc_gettime() will always disable the clock. > > As far as s3c_rtc_setaie() is concern, it enables clock while entering > and disables it while leaving the function. And in > s3c_rtc_{enable,disable}_clk() there is check info->clk_disabled flag > which will make sure clock balancing. Ah, you're right. Looks correct although the information that clock is disabled because of s3c_rtc_gettime() would be useful in the commit message. Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof