From patchwork Tue Oct 14 07:15:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 38692 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5FDA20549 for ; Tue, 14 Oct 2014 07:16:08 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf3610741wib.1 for ; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) 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=LDYMgfFEg7mgKRvzXJFMbc1Dz1vS0lZgRlc/hvdpbnE=; b=Wvaijkh1LlT5LBCXkkE6Lc+NWnQ2hvINUDaLU6S3uhz6NNCuZjBi9LpmIZTb0r+rcT Ta4IvuREtTSXsfdzgw70ndnfTv1hhuWPb24sQuIs8A6rhvm+e6NUd9auXstHxPZbeaT0 51g+BP6qr8StwIDFEwy+w8rOjLvr7qRFoa1RxF3cEQrKkr4uuhtK3cVcSuZ+PcEwWTE1 kGi7+42f54dmON+eNdjOe2Zwh4j5M/gX8pOxankXS8svAYoDjJNBEizzO0ipnX14qkC0 UOlozeTd+xoSq2zqvwN+3wOE0uhkWPamO0mA+jd7KW5wZTnTV8DX55oYcgvI2zLUZ3WS 4L0Q== X-Gm-Message-State: ALoCoQlBkEi5EiolBu7m/1PWnLc1eCeIRaDmvPM1BRRJeD6+uP/Ad6n8/Gap/DyG0EN/9iT9VwVg X-Received: by 10.112.217.102 with SMTP id ox6mr72895lbc.19.1413270967880; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.132 with SMTP id ei4ls207782lad.109.gmail; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) X-Received: by 10.152.198.204 with SMTP id je12mr3310541lac.61.1413270967749; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id qh2si25287011lbb.34.2014.10.14.00.16.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 00:16:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so7477812lbi.8 for ; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) X-Received: by 10.112.173.134 with SMTP id bk6mr3366359lbc.66.1413270967599; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) 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.84.229 with SMTP id c5csp345566lbz; Tue, 14 Oct 2014 00:16:07 -0700 (PDT) X-Received: by 10.112.243.100 with SMTP id wx4mr3243219lbc.77.1413270966607; Tue, 14 Oct 2014 00:16:06 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) by mx.google.com with ESMTPS id ql10si16509271lbb.25.2014.10.14.00.16.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 00:16:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so7839091lab.26 for ; Tue, 14 Oct 2014 00:16:06 -0700 (PDT) X-Received: by 10.152.22.194 with SMTP id g2mr3311793laf.33.1413270966514; Tue, 14 Oct 2014 00:16:06 -0700 (PDT) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id a2sm5279497lbs.21.2014.10.14.00.16.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Oct 2014 00:16:05 -0700 (PDT) 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, linux-pm@vger.kernel.org, Geert Uytterhoeven , Kevin Hilman , Tomasz Figa , Kukjin Kim , Philipp Zabel , Sylwester Nawrocki , "Rafael J. Wysocki" , Pavel Machek , Ulf Hansson Subject: [PATCH 6/7] [media] exynos-gsc: Fixup clock management at ->remove() Date: Tue, 14 Oct 2014 09:15:39 +0200 Message-Id: <1413270940-4378-7-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1413270940-4378-1-git-send-email-ulf.hansson@linaro.org> References: <1413270940-4378-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.217.177 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: , We want to make sure that the clock is fully gated after ->remove(). To do this, we need to bring the device into full power and not only unprepare the clock, but also disable it. 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 1b9f3d7..e48aefa 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1139,12 +1139,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;