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: 5658981 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81B059F357 for ; Mon, 19 Jan 2015 13:51:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A851A20353 for ; Mon, 19 Jan 2015 13:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C74B52020E for ; Mon, 19 Jan 2015 13:51:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751930AbbASNvU (ORCPT ); Mon, 19 Jan 2015 08:51:20 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:38571 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811AbbASNvT (ORCPT ); Mon, 19 Jan 2015 08:51:19 -0500 Received: by mail-lb0-f179.google.com with SMTP id z11so28315523lbi.10 for ; Mon, 19 Jan 2015 05:51:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/vJJ/K4zl83ZBd0U3KnsxKyGTXMXJWXpGyk1YwSYssc=; b=Eirbb8SsvwY9b7+igW5llOqD/kdEoNpUcGKE2NbndUtZXIjc0Xk2lY+4ykgJcldxGQ GvY5IvPTn9iFrsIFkEq+k7DI+5jVE+nLHZADQFXHQ2A3WWOfFcKoHj2Eact+VTrta7w1 iqmzadEg2gGeQKbUOBnoFgrzjwCAG7nMajW10MQxc6qx3JGA6DBqOVSKM0mPhi5OhIi5 HlO37+PglRx3Y5k0IUaGCVTUZNfbFft25HfK+Z9hAPriUOMrGzJNG+ELLD3lPnjaE8nc TAFRlEom89/btmXYelppp6hZQzGI/5KeqBS85XLQASvJE4Tj///VTbUyvmFh4ZhxpWKt Dg/g== X-Gm-Message-State: ALoCoQngGPM4Kz3mzqIof1OT2IXpRLESxIvIVWVAWsuRNFgbF5XWHKNcGGO4HLCkKOOTxN4WxGTj 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;