From patchwork Mon Jan 19 13:22:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 43309 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF2342410B for ; Mon, 19 Jan 2015 13:23:22 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e49sf10841542eek.3 for ; Mon, 19 Jan 2015 05:23:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=/vJJ/K4zl83ZBd0U3KnsxKyGTXMXJWXpGyk1YwSYssc=; b=Frmv2RZ9ZE8683R4WeawE2/3x0krFFDhJRg+4fZoGmrifVbikmei2TGsu0vosvuWVD 1JOFQkA3mzNtimmKNY3M0bIUwMreZR2zhOj0nzHs5Gv4NmyoWqFbKKXfkjiMK5GYFY1M TgKQ3/d1ocOC5LYolNV+1nSO3Ui6TDH3/n2ArvQ/Ju53ohiD0/j0dsAf5LjXHTJ9r71Y HMPy1ZEBiHu9KfbBECfjUpjZ2xdqFze8Sk1DIGYuYlOVIBxLV4FDKq3sV4sCsSoIQOki 0R47vRBMNSNDhNDF2fOruVLka6iQsYVGgqpMyfsX29j27iB+qdk3cc2yP/VBiZFzvlCH MtdQ== X-Gm-Message-State: ALoCoQlvWHYMUHX6R9RAv35hFbSpnXo9hystToy0HzBYFecjdr4NHbOv11chGTANJ816z3nnDEGh X-Received: by 10.152.170.201 with SMTP id ao9mr322771lac.5.1421673800631; Mon, 19 Jan 2015 05:23:20 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.115 with SMTP id q19ls80114laa.55.gmail; Mon, 19 Jan 2015 05:23:20 -0800 (PST) X-Received: by 10.112.97.163 with SMTP id eb3mr24382477lbb.47.1421673800353; Mon, 19 Jan 2015 05:23:20 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id xk7si9800749lac.129.2015.01.19.05.23.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Jan 2015 05:23:20 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so28652398lab.9 for ; Mon, 19 Jan 2015 05:23:20 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr30733963lbb.80.1421673799911; Mon, 19 Jan 2015 05:23:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1089804lbb; Mon, 19 Jan 2015 05:23:19 -0800 (PST) X-Received: by 10.152.6.132 with SMTP id b4mr31367529laa.59.1421673791397; Mon, 19 Jan 2015 05:23:11 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id o5si12913701lae.100.2015.01.19.05.23.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Jan 2015 05:23:09 -0800 (PST) Received-SPF: temperror (google.com: error in processing during lookup of ulf.hansson@linaro.org: DNS timeout) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id pv20so28794978lab.13 for ; Mon, 19 Jan 2015 05:23:06 -0800 (PST) X-Received: by 10.152.205.75 with SMTP id le11mr30889328lac.20.1421673784610; Mon, 19 Jan 2015 05:23:04 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id v4sm3080344lbz.12.2015.01.19.05.23.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jan 2015 05:23:03 -0800 (PST) From: Ulf Hansson To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim , Sylwester Nawrocki , Kyungmin Park , Ulf Hansson Subject: [PATCH V2 5/8] [media] exynos-gsc: Fixup clock management at ->remove() Date: Mon, 19 Jan 2015 14:22:37 +0100 Message-Id: <1421673760-2600-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421673760-2600-1-git-send-email-ulf.hansson@linaro.org> References: <1421673760-2600-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , To make sure the clock is fully gated in ->remove(), we first need to to bring the device into full power by invoking pm_runtime_get_sync(). Then, let's both unprepare and disable the clock. Signed-off-by: Ulf Hansson --- drivers/media/platform/exynos-gsc/gsc-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index e84bc35..5d3cfe8 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1104,12 +1104,15 @@ static int gsc_remove(struct platform_device *pdev) { struct gsc_dev *gsc = platform_get_drvdata(pdev); + pm_runtime_get_sync(&pdev->dev); + gsc_unregister_m2m_device(gsc); v4l2_device_unregister(&gsc->v4l2_dev); - vb2_dma_contig_cleanup_ctx(gsc->alloc_ctx); + clk_disable_unprepare(gsc->clock); + pm_runtime_disable(&pdev->dev); - clk_unprepare(gsc->clock); + pm_runtime_put_noidle(&pdev->dev); dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name); return 0;