From patchwork Mon Feb 12 16:15:34 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: 10213507 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 0893060329 for ; Mon, 12 Feb 2018 16:19:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA8E28CA7 for ; Mon, 12 Feb 2018 16:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCD1228CC3; Mon, 12 Feb 2018 16:19:19 +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 5FEB228CA7 for ; Mon, 12 Feb 2018 16:19:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964878AbeBLQTC (ORCPT ); Mon, 12 Feb 2018 11:19:02 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:19791 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934873AbeBLQQt (ORCPT ); Mon, 12 Feb 2018 11:16:49 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20180212161647epoutp02d80c4525007282ea3a6e6aa5942513b5~SoDzs1hDn1746617466epoutp02H; Mon, 12 Feb 2018 16:16:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20180212161647epoutp02d80c4525007282ea3a6e6aa5942513b5~SoDzs1hDn1746617466epoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1518452207; bh=5+rzZRA7ndwgbmuXZ8wPwAZQcZgxNvXth4HFbXxr5a4=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=BZr82Lh3K8QulGBiVdmCPvYhjRVJNPqTujokgXFjpmUHzM5RSQXUPbFDtjK8uWGrb 1NwehPenHgyYpKDQeB9iggqDMugZlUCMpPQRgySRY8/VADb2oAP/TeFDT5kLF8tVQa 2k/wfSuRtsL/uzTgjfNICo04uKFsfjQR+E4rJST8= Received: from epsmges1p3.samsung.com (unknown [182.195.42.55]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180212161647epcas1p3c6a6f564c6f69ae11de17f2040072c9f~SoDzY5e7c1312713127epcas1p3L; Mon, 12 Feb 2018 16:16:47 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id A3.AB.04137.FEDB18A5; Tue, 13 Feb 2018 01:16:47 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180212161646epcas1p2dabca4c8d98d3e66b7a78133d926bccb~SoDyuPrNL2042920429epcas1p2y; Mon, 12 Feb 2018 16:16:46 +0000 (GMT) X-AuditID: b6c32a37-44bff70000001029-6a-5a81bdefdd73 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 75.48.03826.EEDB18A5; Tue, 13 Feb 2018 01:16:46 +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 <0P4100BF1P6787A0@mmp1.samsung.com>; Tue, 13 Feb 2018 01:16:46 +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 v2 3/7] ASoC: samsung: i2s: Prevent external abort on exynos5433 I2S1 access Date: Mon, 12 Feb 2018 17:15:34 +0100 Message-id: <20180212161538.22669-4-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20180212161538.22669-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7bCmge77vY1RBstey1lcuXiIyWLjjPWs FlMfPmGzmH/kHKvF2/3dzBbnz29gt/h2pYPJ4vKuOWwWM87vY7JYe+Quu0Xr3iPsFofftLNa XFzxhcmB12PD5yY2j52z7rJ7bFrVyebRt2UVo8fnTXIBrFFcNimpOZllqUX6dglcGbf7Ewo6 OSvWfjvB0sB4ir2LkZNDQsBEYtLSRYxdjFwcQgI7GCV2TF3CCuF8Z5To/L6bCabq+5QtUInd jBIvL/8DaxcS+MUosX2FLojNJmAo0Xu0jxHEFhEQk7g9p5MZpIFZ4AyTxPR9a8AmCQvEScz9 3g9mswioSvyZvJEZxOYVsJZ4ePgVC8Q2eYn3C+6DDeIUsJGYdHk51BVb2CSm3nfsYuQAsl0k jt6uhwgLS7w6voUdIiwtcemoLchaCYF+RomPx/ezQDirGSVef9vFCtFgLXH4+EUwm1mAT+Ld 1x5WiGZeiY42IYgSD4nTq2+xQdiOEs13prNBPA809GrfFpYJjFILGBlWMYqlFhTnpqcWGxYY 6xUn5haX5qXrJefnbmIEx7OW+Q7GDed8DjEKcDAq8fB2zG6MEm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MS-MailID: 20180212161646epcas1p2dabca4c8d98d3e66b7a78133d926bccb X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180212161646epcas1p2dabca4c8d98d3e66b7a78133d926bccb X-RootMTR: 20180212161646epcas1p2dabca4c8d98d3e66b7a78133d926bccb References: <20180212161538.22669-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 Acked-by: Krzysztof Kozlowski --- Changes since v1: - removed stray whitespace change. --- sound/soc/samsung/i2s.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 5088d12faeda..7b57ad11ca15 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1404,9 +1404,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);