From patchwork Tue Aug 16 13:35:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9283831 X-Patchwork-Delegate: sboyd@codeaurora.org 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 5E92B6086A for ; Tue, 16 Aug 2016 13:37:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BE5228AEE for ; Tue, 16 Aug 2016 13:37:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FE7F28C11; Tue, 16 Aug 2016 13:37:42 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 BA0C828999 for ; Tue, 16 Aug 2016 13:37:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753781AbcHPNhN (ORCPT ); Tue, 16 Aug 2016 09:37:13 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:41847 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753898AbcHPNgz (ORCPT ); Tue, 16 Aug 2016 09:36:55 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC000GFL8HB6E30@mailout3.w1.samsung.com>; Tue, 16 Aug 2016 14:36:47 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-80-57b316ee8a9e Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id D8.BB.04866.EE613B75; Tue, 16 Aug 2016 14:36:46 +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:46 +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 Cc: Marek Szyprowski , Charles Keepax , Javier Martinez Canillas , a.hajda@samsung.com, Bartlomiej Zolnierkiewicz Subject: [RFC 17/17] Revert "i2c: s3c2410: fix ABBA deadlock by keeping clock prepared" Date: Tue, 16 Aug 2016 15:35:14 +0200 Message-id: <1471354514-24224-18-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: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsVy+t/xq7rvxDaHG/Q+NrK4te4cq8WVi4eY LDbOWM9qsbb3KIvF1IdP2Cz+TbnBbnGg8TKjxa93R9gt3rxdw2Tx+oWhRf/j18wWO9oWslhs enyN1eJjzz1Wi46/XxgtLu+aw2Yx8fYGdosZ5/cxWRyaupfRYu2Ru+wWF0+5WjyduZnN4vCb dlaLH2e6WSzerX7CaPHqYBuLxapdfxgdpD02fG5i82h6f4zN4/K1i8we72+0snvMun8WyO3r ZfLYOesuu8emVZ1sHpuX1Hu8nPibzWNLP1Cob8sqRo/Pm+Q8Ns4NDeCL4rJJSc3JLEst0rdL 4MrYvWEja8FByYoPV5wbGO+JdDFyckgImEhM2rqCCcIWk7hwbz1bFyMXh5DAUkaJH8+3M0M4 jUwSV/9vZQSpYhMwlti8fAlYlYjAKjaJhX/XMoE4zAIvGSXOnvwFNktYIFKid/ZdFhCbRUBV 4vLnJqBuDg5eAQ+JOW9qIdbJSZw8NpkVxOYECp+70MgMYgsJuEucXN/OMoGRdwEjwypG0dTS 5ILipPRcI73ixNzi0rx0veT83E2MkIj7uoNx6TGrQ4wCHIxKPLwnGDaFC7EmlhVX5h5ilOBg VhLhPSy6OVyINyWxsiq1KD++qDQntfgQozQHi5I478xd70OEBNITS1KzU1MLUotgskwcnFIN jLW9OjPEvm/Omuzdrtxi7fvVjevE1bQzO92C1t1Of1Z1X3fN87caLM0Cdc+4ea/dNnt6q1zm VUNqcdCM2fetmWbW1Mq1xqa2Pzp/KiRXJWl9kMjR5VeeOvO8/cWzplxGLSpOvjbufrLmIXYG /a/fbn9by2ay9Mw1g1r7wJX9Vu+m8289sWTRYiWW4oxEQy3mouJEAOMXeP20AgAA Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 34e81ad5f0b60007c95995eb7803da7e00c6c611. Signed-off-by: Krzysztof Kozlowski Conflicts: drivers/i2c/busses/i2c-s3c2410.c --- drivers/i2c/busses/i2c-s3c2410.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 38dc1cacfd8b..571250415617 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -771,16 +771,14 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, int retry; int ret; - ret = clk_enable(i2c->clk); - if (ret) - return ret; + clk_prepare_enable(i2c->clk); for (retry = 0; retry < adap->retries; retry++) { ret = s3c24xx_i2c_doxfer(i2c, msgs, num); if (ret != -EAGAIN) { - clk_disable(i2c->clk); + clk_disable_unprepare(i2c->clk); return ret; } @@ -789,7 +787,7 @@ static int s3c24xx_i2c_xfer(struct i2c_adapter *adap, udelay(100); } - clk_disable(i2c->clk); + clk_disable_unprepare(i2c->clk); return -EREMOTEIO; } @@ -1165,7 +1163,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) } ret = s3c24xx_i2c_init(i2c); - clk_disable(i2c->clk); + clk_disable_unprepare(i2c->clk); if (ret != 0) { dev_err(&pdev->dev, "I2C controller init failed\n"); clk_unprepare(i2c->clk); @@ -1180,7 +1178,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) i2c->irq = ret = platform_get_irq(pdev, 0); if (ret <= 0) { dev_err(&pdev->dev, "cannot find IRQ\n"); - clk_unprepare(i2c->clk); return ret; } @@ -1188,7 +1185,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) 0, dev_name(&pdev->dev), i2c); if (ret != 0) { dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq); - clk_unprepare(i2c->clk); return ret; } } @@ -1196,7 +1192,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) ret = s3c24xx_i2c_register_cpufreq(i2c); if (ret < 0) { dev_err(&pdev->dev, "failed to register cpufreq notifier\n"); - clk_unprepare(i2c->clk); return ret; } @@ -1218,7 +1213,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to add bus to i2c core\n"); pm_runtime_disable(&pdev->dev); s3c24xx_i2c_deregister_cpufreq(i2c); - clk_unprepare(i2c->clk); return ret; } @@ -1230,8 +1224,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) { struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); - clk_unprepare(i2c->clk); - pm_runtime_disable(&pdev->dev); s3c24xx_i2c_deregister_cpufreq(i2c); @@ -1262,16 +1254,13 @@ static int s3c24xx_i2c_resume_noirq(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); - int ret; if (!IS_ERR(i2c->sysreg)) regmap_write(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, i2c->sys_i2c_cfg); - ret = clk_enable(i2c->clk); - if (ret) - return ret; + clk_prepare_enable(i2c->clk); s3c24xx_i2c_init(i2c); - clk_disable(i2c->clk); + clk_disable_unprepare(i2c->clk); i2c->suspended = 0; return 0;