From patchwork Tue Aug 16 13:35:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9284037 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 C859D60839 for ; Tue, 16 Aug 2016 14:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE4B528EA3 for ; Tue, 16 Aug 2016 14:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B28E328EBD; Tue, 16 Aug 2016 14:16:18 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F406828EA3 for ; Tue, 16 Aug 2016 14:16:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 406F6266D86; Tue, 16 Aug 2016 16:16:17 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CFB53266938; Tue, 16 Aug 2016 16:08:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 74758266908; Tue, 16 Aug 2016 16:08:24 +0200 (CEST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by alsa0.perex.cz (Postfix) with ESMTP id C12332668E1 for ; Tue, 16 Aug 2016 15:36:47 +0200 (CEST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC000FFF8H9OW30@mailout3.w1.samsung.com> for alsa-devel@alsa-project.org; Tue, 16 Aug 2016 14:36:45 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-c3-57b316edcc7a Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id C0.4D.05254.DE613B75; Tue, 16 Aug 2016 14:36:45 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OC000MRK8GNJF30@eusync3.samsung.com>; Tue, 16 Aug 2016 14:36:45 +0100 (BST) From: Krzysztof Kozlowski To: Michael Turquette , Stephen Boyd , Stephen Warren , Lee Jones , Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Krzysztof Kozlowski , Sylwester Nawrocki , Tomasz Figa , Kukjin Kim , Russell King , Mark Brown , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, alsa-devel@alsa-project.org Date: Tue, 16 Aug 2016 15:35:13 +0200 Message-id: <1471354514-24224-17-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> References: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWRW0hTcQDG/Z9zds7Zcnaclw4aPizqIcjy8vBXw4SozqNBMhLLjnq8pFPZ VDKInJC30ikmqSloKcFyXrYpS9B0W8bKqWPeTcNLonlZomGZSpvW2++7wPfwkajoFeZDpqRn cbJ0Nk2MC7DPhx/HLmx4ayWXKoz+cLp1iAdHrQYEdlS38aC69AMGq+aXcHj4fJKAfQobgHub JgKub7QgcG0lACoX11CoL2jEoGZxnAe3ns3xYNHBDoC27jocVsy0E7B6uBeBhqoeANWmWQJa P12D32q0ODSuF/Lgr8GnGNx8uwTg9/4CDKq690GEL9O+nY8z+fYBnLGNW1HGPvmEYGq/Whyy rBRh3tXOEoxGVYwz2qbHzGrFH5zRKR1WmU4FmG2NH9NRHxXpFi24nMClpeRwsovh9wTJL9cU RKbJ/cGivRfLAy/cSgBJ0lQwvdJ5swTwHehNj8y14SVAQIqoZkDbqzX/hAKh635Uos4WTgXR 2jdNR4EnpcLpxgM14hQotQpoi3kPcbY8qETaNDNGOBmjztJbdh3uZCHF0MquKex4z482D1Ty nMx3+EMjiqMFEXWDNrcVYuVA2ABcVMCLy47PlMclSQP85axUnp2e5B+fIdWA4+d29OD1QKgB UCQQuwrNLhqJiMfmyHOlBkCTqNhTaPTSSkTCBDb3ISfLiJVlp3FyA/AlMfEpYX23/ZaISmKz uFSOy+Rk/1OE5PvkgejByFIlv6d82dxsbd3PSN0UNgQdqjR69PfJ6+8tpGUssE4SPn0lpDM2 2JYY3Xe61rVlSntnQa3HQ790hdQU60JNmrCFuORzbsZddjj1zHjs/fqQfnXnhKhJBmRXl+/u oqITcx79UT9dRm6XxzSVjQbOe0/HhA0/8oowTxS5izF5MhtwHpXJ2b8MneEKtQIAAA== Cc: a.hajda@samsung.com, Javier Martinez Canillas , Charles Keepax , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [alsa-devel] [RFC 16/17] Revert "i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 10ff4c5239a137abfc896ec73ef3d15a0f86a16a. --- drivers/i2c/busses/i2c-exynos5.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index c0e3ada02876..8710052eeb6b 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -671,9 +671,7 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap, return -EIO; } - ret = clk_enable(i2c->clk); - if (ret) - return ret; + clk_prepare_enable(i2c->clk); for (i = 0; i < num; i++, msgs++) { stop = (i == num - 1); @@ -697,7 +695,7 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap, } out: - clk_disable(i2c->clk); + clk_disable_unprepare(i2c->clk); return ret; } @@ -749,9 +747,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev) return -ENOENT; } - ret = clk_prepare_enable(i2c->clk); - if (ret) - return ret; + clk_prepare_enable(i2c->clk); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); i2c->regs = devm_ioremap_resource(&pdev->dev, mem); @@ -803,10 +799,6 @@ static int exynos5_i2c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, i2c); - clk_disable(i2c->clk); - - return 0; - err_clk: clk_disable_unprepare(i2c->clk); return ret; @@ -818,8 +810,6 @@ static int exynos5_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&i2c->adap); - clk_unprepare(i2c->clk); - return 0; } @@ -831,8 +821,6 @@ static int exynos5_i2c_suspend_noirq(struct device *dev) i2c->suspended = 1; - clk_unprepare(i2c->clk); - return 0; } @@ -842,9 +830,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev) struct exynos5_i2c *i2c = platform_get_drvdata(pdev); int ret = 0; - ret = clk_prepare_enable(i2c->clk); - if (ret) - return ret; + clk_prepare_enable(i2c->clk); ret = exynos5_hsi2c_clock_setup(i2c); if (ret) { @@ -853,7 +839,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev) } exynos5_i2c_init(i2c); - clk_disable(i2c->clk); + clk_disable_unprepare(i2c->clk); i2c->suspended = 0; return 0;