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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 972D5C433F5 for ; Tue, 17 May 2022 18:44:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352328AbiEQSof (ORCPT ); Tue, 17 May 2022 14:44:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347049AbiEQSod (ORCPT ); Tue, 17 May 2022 14:44:33 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81FF139164; Tue, 17 May 2022 11:44:32 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id d3so13218103ilr.10; Tue, 17 May 2022 11:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j51jKuN9LxvI+OJRdkmu6rD6Kj69fRthuGQLklYAkDA=; b=as17G5fbhkMRlyXiHsU2KOLKCrfeZcdSYQlK1LW7Q8XiRvt3/rvMdCt9YdS6IVQIyR G5jGuOFEU38O7dokmbx2OkssSbKCCe4PNCnvyE4PWTfpNTlkqaWFsvCt+rkxOZffu1zn eVkVlRV5tqGqvDBXVggSl4zD/n4rLWObhE3iac3Uua5g5n47TChEhLJcTZtshzjVGzv/ 3H1q1UDPdjttHDKpQM0vIBxiavoZgLzuPVPzzO59GDqil4mokNUn7ON0krii5w1TqmIn KDSSXSC5lcuZhi76ddqFyYUApnEz62L0ffUtc5+71dbXayAAlXPhVVXShSP2c1/9JP/b v0Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j51jKuN9LxvI+OJRdkmu6rD6Kj69fRthuGQLklYAkDA=; b=yJcLuMxwNhw+qN8V91WP+RzXXta284U+Z8KMPsdl2my/Hn/bnuy+aGh4ncB5wxAWmc spmSI6tl/SCTquwM5RIhOOAC294Q2as5bUbipqC4QS+7a2ylUdAxU36HhvWVi5hIHwG0 swF75AFSC3e7uioS+NIKP9FtkyrIR5NyN1etcWH781/LyCSEehD/jvuCgwcSTph3S69D 7lnjGCbbsVGzUgh+Nguq96buJ63HR+NqUAjmIhebBPCDKkgU7Zl/hz4tnyTNEL2IJ9VY HeqHkYFhUvNxpqqVxfi88N6pG2P5fSia1Es002abSv1bM4hoJvg6aLBB/s9KyeRGMiD0 MIaA== X-Gm-Message-State: AOAM5320YFcY7NxgO85v5BFObyjC5VXhDVk7cAr6Br1AKOqD5BU0lKFQ /L4OtY9VQ4Qqtcl8bYXWZWwzYyGCxNFBAmEafbw= X-Google-Smtp-Source: ABdhPJxJ6tU3iv6ZTZdFdsDIf4WvuvuPVt1sg1fug6jUfJkmip9XyKYbki5Vhi6bMNmdl6Ae9J2s/GR+4NVJhh7Ohx4= X-Received: by 2002:a05:6e02:20c3:b0:2cf:976d:f43c with SMTP id 3-20020a056e0220c300b002cf976df43cmr12036180ilq.264.1652813071800; Tue, 17 May 2022 11:44:31 -0700 (PDT) MIME-Version: 1.0 References: <20220515064126.1424-1-linux.amoon@gmail.com> <20220515064126.1424-4-linux.amoon@gmail.com> <7c479bdb-4bf7-68a5-c6e7-20dc19b91dc8@linaro.org> In-Reply-To: <7c479bdb-4bf7-68a5-c6e7-20dc19b91dc8@linaro.org> From: Anand Moon Date: Wed, 18 May 2022 00:14:16 +0530 Message-ID: Subject: Re: [PATCHv2 3/6] thermal: exynos: Check before clk_disable_unprepare() not needed To: Krzysztof Kozlowski Cc: Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Linux PM list , linux-samsung-soc@vger.kernel.org, linux-arm-kernel , Linux Kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On Sun, 15 May 2022 at 15:13, Krzysztof Kozlowski wrote: > > On 15/05/2022 08:41, Anand Moon wrote: > > All code in clk_disable_unprepare() already checks the clk ptr using > > IS_ERR_OR_NULL so there is no need to check it again before calling it. > > A lot of other drivers already rely on this behaviour, so it's safe > > to do so here. > > > > Cc: Bartlomiej Zolnierkiewicz > > Signed-off-by: Anand Moon > > --- > > v1: improve the commit message > > --- > > drivers/thermal/samsung/exynos_tmu.c | 12 ++++-------- > > 1 file changed, 4 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > > index 1ef90dc52c08..58ff1b577c47 100644 > > --- a/drivers/thermal/samsung/exynos_tmu.c > > +++ b/drivers/thermal/samsung/exynos_tmu.c > > @@ -289,8 +289,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) > > > > mutex_lock(&data->lock); > > clk_enable(data->clk); > > - if (!IS_ERR(data->clk_sec)) > > - clk_enable(data->clk_sec); > > + clk_enable(data->clk_sec); > > You say that clk_enable() checks for IS_ERR_OR_NULL. Where? I see only > check for non-null case and then immediately taking clk prepare lock. > > This looks buggy... did you test it? Thanks for your review comments Yes have tested the changes, this was last-minute changes will drop this in the next version. > > Best regards, > Krzysztof Thanks & Regards -Anand 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9ABADC433EF for ; Tue, 17 May 2022 18:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x+JD02W9kRMxQe24JTQtfMzYxFdXTMv0h5EXzNYypJQ=; b=Pin9X3wmDi3LIq OaOxyK75Fe/8R3WsfV3FU7uinvmbY5L8qRD+MwiQDM0Qxd4pGze38TSIg0zpBDUdkEuwhWOMZEtwP A8sN7DbnKWlkk6jMsK2GDY4GDaC9F+GlOl0aVq3pI550G7QoQTtWOu1z8TAwqHoEpioueduah2xY2 iUIBH5/8PK82dDFyQs1xmLwC8TdS2jBXzpDP7IIhiITHS7YFX3DJXPDj2iLWIXTd2ZDcFoe2VuLu5 F75OVw9Q2Hh8oPffHatDCma0umSo1t/48qr3IPgdcdlC9010+KJycQNxh0zKTr17mPtFw0rZCLMPA UmDSfpkw//bUDFcQjNVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nr2BR-00FNx0-42; Tue, 17 May 2022 18:44:37 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nr2BO-00FNvA-AL for linux-arm-kernel@lists.infradead.org; Tue, 17 May 2022 18:44:35 +0000 Received: by mail-il1-x132.google.com with SMTP id 3so13235743ily.2 for ; Tue, 17 May 2022 11:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=j51jKuN9LxvI+OJRdkmu6rD6Kj69fRthuGQLklYAkDA=; b=as17G5fbhkMRlyXiHsU2KOLKCrfeZcdSYQlK1LW7Q8XiRvt3/rvMdCt9YdS6IVQIyR G5jGuOFEU38O7dokmbx2OkssSbKCCe4PNCnvyE4PWTfpNTlkqaWFsvCt+rkxOZffu1zn eVkVlRV5tqGqvDBXVggSl4zD/n4rLWObhE3iac3Uua5g5n47TChEhLJcTZtshzjVGzv/ 3H1q1UDPdjttHDKpQM0vIBxiavoZgLzuPVPzzO59GDqil4mokNUn7ON0krii5w1TqmIn KDSSXSC5lcuZhi76ddqFyYUApnEz62L0ffUtc5+71dbXayAAlXPhVVXShSP2c1/9JP/b v0Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j51jKuN9LxvI+OJRdkmu6rD6Kj69fRthuGQLklYAkDA=; b=8BF8V919+r2FdkLlVY8VRNnqmns/NOc0H9saebbEQw/G23hDEahTfVW96mo7A+Vvc+ yMPaHmqti+tpGHpSTAroAr9cZyqRPuTHnvN/DxuiAlPyQ6Z7nMnSEDgQGPAmNpufBAbx EtDK9xPvYS2b9L4LP3QhTDgXBqTfHZja/tjETGvvdtmd4mAP/WyXowP49yi/0EpWbT7w UVWkua5JyUXLtGIAQLwajkTCYzU4p87P0gEank0icAhGCdvwuatWn9EiQ5RSepdOmsly JYBO7lcAP4WXYgKKn9aLCx+2CcTpFthpReasEbC8QaLnCXlbme/wndHCy1Oz853QFyqN 44nw== X-Gm-Message-State: AOAM531Vo1l2LiQXSrT5maLjkdm0gzwuTTqesut3oGvTdiSJxLXGMit6 TDLpbYRs8H3tSRkTv6wZ1BUeTrH/G+fI8DO2fiw= X-Google-Smtp-Source: ABdhPJxJ6tU3iv6ZTZdFdsDIf4WvuvuPVt1sg1fug6jUfJkmip9XyKYbki5Vhi6bMNmdl6Ae9J2s/GR+4NVJhh7Ohx4= X-Received: by 2002:a05:6e02:20c3:b0:2cf:976d:f43c with SMTP id 3-20020a056e0220c300b002cf976df43cmr12036180ilq.264.1652813071800; Tue, 17 May 2022 11:44:31 -0700 (PDT) MIME-Version: 1.0 References: <20220515064126.1424-1-linux.amoon@gmail.com> <20220515064126.1424-4-linux.amoon@gmail.com> <7c479bdb-4bf7-68a5-c6e7-20dc19b91dc8@linaro.org> In-Reply-To: <7c479bdb-4bf7-68a5-c6e7-20dc19b91dc8@linaro.org> From: Anand Moon Date: Wed, 18 May 2022 00:14:16 +0530 Message-ID: Subject: Re: [PATCHv2 3/6] thermal: exynos: Check before clk_disable_unprepare() not needed To: Krzysztof Kozlowski Cc: Bartlomiej Zolnierkiewicz , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Linux PM list , linux-samsung-soc@vger.kernel.org, linux-arm-kernel , Linux Kernel X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220517_114434_394810_A4B6E55B X-CRM114-Status: GOOD ( 23.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Krzysztof, On Sun, 15 May 2022 at 15:13, Krzysztof Kozlowski wrote: > > On 15/05/2022 08:41, Anand Moon wrote: > > All code in clk_disable_unprepare() already checks the clk ptr using > > IS_ERR_OR_NULL so there is no need to check it again before calling it. > > A lot of other drivers already rely on this behaviour, so it's safe > > to do so here. > > > > Cc: Bartlomiej Zolnierkiewicz > > Signed-off-by: Anand Moon > > --- > > v1: improve the commit message > > --- > > drivers/thermal/samsung/exynos_tmu.c | 12 ++++-------- > > 1 file changed, 4 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > > index 1ef90dc52c08..58ff1b577c47 100644 > > --- a/drivers/thermal/samsung/exynos_tmu.c > > +++ b/drivers/thermal/samsung/exynos_tmu.c > > @@ -289,8 +289,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) > > > > mutex_lock(&data->lock); > > clk_enable(data->clk); > > - if (!IS_ERR(data->clk_sec)) > > - clk_enable(data->clk_sec); > > + clk_enable(data->clk_sec); > > You say that clk_enable() checks for IS_ERR_OR_NULL. Where? I see only > check for non-null case and then immediately taking clk prepare lock. > > This looks buggy... did you test it? Thanks for your review comments Yes have tested the changes, this was last-minute changes will drop this in the next version. > > Best regards, > Krzysztof Thanks & Regards -Anand _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel