Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp671817ybl; Thu, 12 Dec 2019 03:04:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzFSByGQZ2D0K/jhax5+PjHDuU7mfa/YwyMioUwCatS51mbArnHZGR9yNRrEUAP3yixUyfn X-Received: by 2002:a9d:6b17:: with SMTP id g23mr7182374otp.265.1576148693153; Thu, 12 Dec 2019 03:04:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576148693; cv=none; d=google.com; s=arc-20160816; b=rOW8C22O2Oa4/3P+s+3IW2SWQFJ6M+NPFC1qMGkOTwzKFPN8X7r5wOYcKIo56Crjjj VIOU8mfWc1F1/FYX5G4HTUS9d5GCKyL0fGi0mz1x87OiFnOab5ketwM2qSiHRj/DMOK5 VU5jlo6tWuddbGx97Dy6HzA2FBSsg+6txgzL/lClUgoU5ZGSRkveitO45W69IaI7/3U2 UKSEIXENRcOt5qSf11c7ScoOlOh8wmwRLHhbcPxBjSclZi8khsUviGtuYR0GhlsCPP2R nxwJIwCW4x10GdPKMh6Xj7DZMxMlz9XGFRSLnbApnURpIC8a74QzYqKXCFTXS7YdpcAp wCMw== 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 :in-reply-to:references:mime-version:dkim-signature; bh=yJu4cOFz19qPY/wFbXf6h20pXR1Zm2cAQy1qY8KcnAE=; b=qTrBtDugrnFkZCiTbY+rRnX6Tu5a4jOzsf8C9SYo2wJ4gROVgQ/fmhrSn/hGZUMfCb fJfKwRCxaMEY3iDNapcBVt6lhgHJNfYmUhqV9FKVQhL/JblUZFSpOAR0YBrdyyR8wlcZ MobDcdv0nHA6Nhy073ZJ19A7OuyRbTCcslgU3+j5v8AHvHIS3i7IGLMC5eXNYivYAM1Y l8vEz3oyVdE+/f5XgADcvnd771KpbYsVS1nI6x5N8Vx1yws4DyJ/HOxPMwTXCElFF6lk JHgjfBpUN6Ce23ImF0TuVtn+B8HLgPXKjlgnIQG+7rCQ0a1BulAMXMqc3UF/ivqNF/Dw q+4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qNHGjkNN; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si2648011oij.125.2019.12.12.03.04.40; Thu, 12 Dec 2019 03:04:53 -0800 (PST) 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=@kernel.org header.s=default header.b=qNHGjkNN; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728909AbfLLLDv (ORCPT + 99 others); Thu, 12 Dec 2019 06:03:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:52980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728613AbfLLLDv (ORCPT ); Thu, 12 Dec 2019 06:03:51 -0500 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E722122B48; Thu, 12 Dec 2019 11:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576148630; bh=RlQYE4ISnB8w71cVPWrVxWmmiBw1vv7db6O06zPNTEg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qNHGjkNNfqbO/iMeXj8vAZpZYJ8k+Y0WPRnnKuM4Pf8VuXrW7AhgfhGO4LUE6HiOu blPA7D7ic9Ty1uJUHM5vCOuzfgCP28aU3Pa87e9a2XhCQ7xXOShup8BjrRdhR14jtU +ZblW4z0tyJeNYEmpZ0RB+p5B5Jkv/7nrfYLUgM4= Received: by mail-lf1-f43.google.com with SMTP id b15so1373439lfc.4; Thu, 12 Dec 2019 03:03:49 -0800 (PST) X-Gm-Message-State: APjAAAUEWlCU5DXCXKu1M4vfAIaVNFhORK/RiPhAHEsMJ1gWYQbgkfd8 sqduhwSq1/wl+2XBlONreAGQFIPklV2gNmjp8e8= X-Received: by 2002:ac2:5dc7:: with SMTP id x7mr5301381lfq.24.1576148628033; Thu, 12 Dec 2019 03:03:48 -0800 (PST) MIME-Version: 1.0 References: <20191104154942.8935-1-hslester96@gmail.com> <29590e4f-cb9e-c9ac-608c-b7b72c308d25@xs4all.nl> In-Reply-To: <29590e4f-cb9e-c9ac-608c-b7b72c308d25@xs4all.nl> From: Krzysztof Kozlowski Date: Thu, 12 Dec 2019 12:03:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: exynos4-is: add missed clk_disable_unprepare in remove To: Hans Verkuil Cc: Chuhong Yuan , Kyungmin Park , Sylwester Nawrocki , Mauro Carvalho Chehab , Kukjin Kim , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "linux-samsung-soc@vger.kernel.org" , "linux-kernel@vger.kernel.org" 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 On Thu, 12 Dec 2019 at 11:39, Hans Verkuil wrote: > > On 11/4/19 4:49 PM, Chuhong Yuan wrote: > > This driver forgets to disable and unprepare clock when remove. > > Add a call to clk_disable_unprepare to fix it. > > I'd like an Ack from Samsung before I apply this. I see this in the probe() in fimc-lite.c: > > if (!pm_runtime_enabled(dev)) { > ret = clk_prepare_enable(fimc->clock); > if (ret < 0) > goto err_sd; > } > > So is it right to always call clk_disable_unprepare in the remove()? > > I suspect it is correct, but I would like someone else to take a look as well. > > Regards, > > Hans > > > > > Signed-off-by: Chuhong Yuan > > --- > > drivers/media/platform/exynos4-is/fimc-lite.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c > > index e87c6a09205b..6748bd96aada 100644 > > --- a/drivers/media/platform/exynos4-is/fimc-lite.c > > +++ b/drivers/media/platform/exynos4-is/fimc-lite.c > > @@ -1614,6 +1614,7 @@ static int fimc_lite_remove(struct platform_device *pdev) > > struct fimc_lite *fimc = platform_get_drvdata(pdev); > > struct device *dev = &pdev->dev; > > > > + clk_disable_unprepare(fimc->clock); > > pm_runtime_disable(dev); > > pm_runtime_set_suspended(dev); > > fimc_lite_unregister_capture_subdev(fimc); No, it is wrong. The clock is enabled in probe only if !pm_runtime_enabled(). This will matter only if PM is disabled but now it leads to unbalanced disables. This was clearly not tested because I believe any test would trigger error. In such case, please mark the patches as RFT. There is some tendency to post small "fixes" like this without testing... ok, not everyone has hardware but then just mark it as not-tested or RFT... Best regards, Krzysztof