From patchwork Mon Feb 5 15:43:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10200793 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 0F0B16056A for ; Mon, 5 Feb 2018 15:45:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3B6128778 for ; Mon, 5 Feb 2018 15:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E77FE28782; Mon, 5 Feb 2018 15:45:31 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85F2928778 for ; Mon, 5 Feb 2018 15:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbeBEPp1 (ORCPT ); Mon, 5 Feb 2018 10:45:27 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:31807 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753136AbeBEPpT (ORCPT ); Mon, 5 Feb 2018 10:45:19 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180205154516epoutp01c7d96b52a766fa0624aaeb8267fa98ed~QeHSbG9c32278922789epoutp01c; Mon, 5 Feb 2018 15:45:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180205154516epoutp01c7d96b52a766fa0624aaeb8267fa98ed~QeHSbG9c32278922789epoutp01c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1517845516; bh=QAO65AVY+JbWfd+gat5xp6stVnH0EYBZCZB2r2JTdrs=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=FZgAwsZxXOfEpfssaKGyLpWuXA0XrNmAlbFHo8lMdlDFkx1Kf2DXwSffYQZJIS9De iGV8t1Lk3W/kUcsTVnr1hnFydmw6O3C/d47jsrb/kYzgvGEaKzccddJ7U91B9/8LUC zT+XwI9z/woxzO48Hrm2D2uEINry70q4JOlRDJ7c= Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180205154516epcas1p2883a0de79b18d016d96af99c702c0c3f~QeHSMQz_L3252532525epcas1p2N; Mon, 5 Feb 2018 15:45:16 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id CA.0C.04145.C0C787A5; Tue, 6 Feb 2018 00:45:16 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180205154516epcas1p39c5977145e7b32879b935087ee3865f8~QeHR2-aDu1685816858epcas1p37; Mon, 5 Feb 2018 15:45:16 +0000 (GMT) X-AuditID: b6c32a35-891ff70000001031-88-5a787c0ca8df Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 41.92.03826.B0C787A5; Tue, 6 Feb 2018 00:45:15 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P3O00399P1LBQ40@mmp1.samsung.com>; Tue, 06 Feb 2018 00:45:15 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, krzk@kernel.org, jcsing.lee@samsung.com, sbkim73@samsung.com, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Sylwester Nawrocki Subject: [PATCH 3/8] ASoC: samsung: i2s: Prevent external abort on exynos5433 I2S1 access Date: Mon, 05 Feb 2018 16:43:58 +0100 Message-id: <20180205154403.13520-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20180205154403.13520-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCIsWRmVeSWpSXmKPExsWy7bCmni5PTUWUwaYLIhZXLh5istg4Yz2r xdSHT9gs5h85x2rxdn83s8X58xvYLb5d6WCyuLxrDpvFjPP7mCzWHrnLbtG69wi7xeE37awW F1d8YXLg9djwuYnNY+esu+wem1Z1snn0bVnF6PF5k1wAaxSXTUpqTmZZapG+XQJXxqeGQ4wF HdwVH6Y9ZmpgnM/ZxcjJISFgIvHn81mmLkYuDiGBHYwS2z4+gHK+M0rcW/2XEaZq1eXNzBCJ 3YwSG473QTm/GCXO9b1jA6liEzCU6D3aB9YhIiAmcXtOJ1gRs8AZJonp+9YwgSSEBaIl1uzY D9bAIqAq0bhlITOIzStgLfFmwVJWiHXyEu8X3AcbxClgI7Hn3jJGkEESAjvYJLZ8vgVV5CLx 6OZMKFtY4tXxLexdjBxAtrTEpaO2EPX9jBIn1jRDNc9glLjTPoEJosFa4vDxi2DNzAJ8Eu++ 9rBCNPNKdLQJQZR4SPy9NB2q3FFiyauZ0IABGjpr5ny2CYxSCxgZVjGKpRYU56anFhsWGOoV J+YWl+al6yXn525iBMe1lukOxinnfA4xCnAwKvHwCmRURAmxJpYVV+YeYpTgYF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ailID: 20180205154516epcas1p39c5977145e7b32879b935087ee3865f8 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180205154516epcas1p39c5977145e7b32879b935087ee3865f8 X-RootMTR: 20180205154516epcas1p39c5977145e7b32879b935087ee3865f8 References: <20180205154403.13520-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It seems both PCLK_I2S1 and SCLK_I2S1 clocks need to be enabled before I2S1 control registers can be accessed on exynos5433, if SCLK clock is disabled an exception is triggered. To fix this parent clock of the RCLK_SRC clock is assigned to pri_dai->op_clk so required gate clock is handled by the runtime PM ops. Signed-off-by: Sylwester Nawrocki --- sound/soc/samsung/i2s.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index b7d25a63da8b..1c05170e4999 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1328,6 +1328,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to enable clock: %d\n", ret); return ret; } + pri_dai->dma_playback.addr = regs_base + I2STXD; pri_dai->dma_capture.addr = regs_base + I2SRXD; pri_dai->dma_playback.chan_name = "tx"; @@ -1401,9 +1402,14 @@ static int samsung_i2s_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = i2s_register_clock_provider(pdev); - if (!ret) - return 0; + if (ret < 0) + goto err_disable_pm; + + pri_dai->op_clk = clk_get_parent(pri_dai->clk_table[CLK_I2S_RCLK_SRC]); + + return 0; +err_disable_pm: pm_runtime_disable(&pdev->dev); err_disable_clk: clk_disable_unprepare(pri_dai->clk);