From patchwork Wed Jan 18 00:30:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 9522337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A5E66043D for ; Wed, 18 Jan 2017 00:30:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88162284CD for ; Wed, 18 Jan 2017 00:30:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C99428581; Wed, 18 Jan 2017 00:30:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2CEB5284CD for ; Wed, 18 Jan 2017 00:30:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTe9K-0008Nk-TH; Wed, 18 Jan 2017 00:30:50 +0000 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49] helo=osg.samsung.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cTe98-0007wX-5c for linux-arm-kernel@lists.infradead.org; Wed, 18 Jan 2017 00:30:39 +0000 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id AE983A0DE2; Wed, 18 Jan 2017 00:30:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osg.samsung.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (s-opensource.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AzYU3ODZALUD; Wed, 18 Jan 2017 00:30:36 +0000 (UTC) Received: from minerva.localdomain (unknown [181.121.136.80]) by osg.samsung.com (Postfix) with ESMTPSA id 00EB5A1313; Wed, 18 Jan 2017 00:30:31 +0000 (UTC) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] [media] exynos-gsc: Fix imprecise external abort due disabled power domain Date: Tue, 17 Jan 2017 21:30:01 -0300 Message-Id: <1484699402-28738-2-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484699402-28738-1-git-send-email-javier@osg.samsung.com> References: <1484699402-28738-1-git-send-email-javier@osg.samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170117_163038_264463_CB5EF132 X-CRM114-Status: GOOD ( 14.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , linux-samsung-soc@vger.kernel.org, linux-media@vger.kernel.org, Shuah Khan , Andi Shyti , Inki Dae , Javier Martinez Canillas , Kukjin Kim , Krzysztof Kozlowski , Sylwester Nawrocki , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 15f90ab57acc ("[media] exynos-gsc: Make driver functional when CONFIG_PM is unset") removed the implicit dependency that the driver had with CONFIG_PM, since it relied on the config option to be enabled. In order to work with !CONFIG_PM, the GSC reset logic that happens in the runtime resume callback had to be executed on the probe function. The problem is that if CONFIG_PM is enabled, the power domain for the GSC could be disabled and so an attempt to write to the GSC_SW_RESET register leads to an unhandled fault / imprecise external abort error: [ 10.178825] Unhandled fault: imprecise external abort (0x1406) at 0x00000000 [ 10.186982] pgd = ed728000 [ 10.190847] [00000000] *pgd=00000000 [ 10.195553] Internal error: : 1406 [#1] PREEMPT SMP ARM [ 10.229761] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [ 10.237134] task: ed49e400 task.stack: ed724000 [ 10.242934] PC is at gsc_wait_reset+0x5c/0x6c [exynos_gsc] [ 10.249710] LR is at gsc_probe+0x300/0x33c [exynos_gsc] [ 10.256139] pc : [] lr : [] psr: 60070013 [ 10.256139] sp : ed725d30 ip : 00000000 fp : 00000001 [ 10.271492] r10: eea74800 r9 : ecd6a2c0 r8 : ed7d8854 [ 10.277912] r7 : ed7d8c08 r6 : ed7d8810 r5 : ffff8ecd r4 : c0c03900 [ 10.285664] r3 : 00000000 r2 : 00000001 r1 : ed7d8b98 r0 : ed7d8810 So only do a GSC reset if CONFIG_PM is disabled, since if is enabled the runtime PM resume callback will be called by the VIDIOC_STREAMON ioctl, making the reset in probe unneeded. Fixes: 15f90ab57acc ("[media] exynos-gsc: Make driver functional when CONFIG_PM is unset") Signed-off-by: Javier Martinez Canillas --- I-ve only tested with CONFIG_PM enabled since my Exynos5422 Odroid XU4 board fails to boot when the config option is disabled. Best regards, Javier drivers/media/platform/exynos-gsc/gsc-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 83272f10722d..42e1e09ea915 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1083,8 +1083,10 @@ static int gsc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gsc); - gsc_hw_set_sw_reset(gsc); - gsc_wait_reset(gsc); + if (!IS_ENABLED(CONFIG_PM)) { + gsc_hw_set_sw_reset(gsc); + gsc_wait_reset(gsc); + } vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32));