From patchwork Wed Nov 6 09:39:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 288806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 02BAB2C009D for ; Wed, 6 Nov 2013 20:40:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756001Ab3KFJk6 (ORCPT ); Wed, 6 Nov 2013 04:40:58 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:56164 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755142Ab3KFJk4 (ORCPT ); Wed, 6 Nov 2013 04:40:56 -0500 Received: by mail-pa0-f46.google.com with SMTP id rd3so10212641pab.5 for ; Wed, 06 Nov 2013 01:40:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RWh3hyPyqWO2dnoRUq0ScG8+BoWZD3IIE2O/ymZKuFw=; b=XGKvuVbXR62lQBpdCLUqYLf2Jgf27xpTq2XD80m0yEAHBXKaCkh0fcTYR3J3xaT0j8 lWU9tCC5GrvPJtNZy73zYwm29jSmgxwsXiARld8dR7M8I4MF0VgJMGq1bOLPoNYDGX9W rTSE5VFwGCaFyiQYj11JbHALvYlVJ63OD1CHtKB4WUTiLzUKEnGZ7Phe2+SzGSPXoiNz pd9YQjwU5lyto8E02lJCP4K2kJvrI7PwbgfDKNGD5dFt6dyDLC2SKmh5+VnNdqgJlSmW G3s+IfDsJZf55YtshfU9j68QgFMpiNugTfXm7SeedDpPOtjniIMa05XyN2hRTez2zVJf lPdg== X-Gm-Message-State: ALoCoQlotr4lg4347bynoJNXKSpc1NTjKjevcga1tOhmY3aWBLqDhaHyTNkuOF3QJ7aKLrNlfivU X-Received: by 10.68.202.38 with SMTP id kf6mr2308920pbc.43.1383730855669; Wed, 06 Nov 2013 01:40:55 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id py4sm40124357pbb.33.2013.11.06.01.40.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 01:40:55 -0800 (PST) From: Sachin Kamat To: linux-i2c@vger.kernel.org Cc: wsa@the-dreams.de, sachin.kamat@linaro.org, Naveen Krishna Chatradhi Subject: [PATCH 1/1] i2c: exynos5: Remove incorrect clk_disable_unprepare Date: Wed, 6 Nov 2013 15:09:18 +0530 Message-Id: <1383730758-1771-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org clk_disable_unprepare in remove causes an imbalance and hence gives the below crash on module remove. While at it also remove some duplicate code from probe. / $ rmmod i2c-exynos5 [ 6.996374] ------------[ cut here ]------------ [ 6.999523] WARNING: CPU: 2 PID: 1137 at drivers/clk/clk.c:842 clk_disable+0x18/0x24() [ 7.007403] Modules linked in: i2c_exynos5(-) [ 7.011747] CPU: 2 PID: 1137 Comm: rmmod Not tainted 3.12.0-next-20131105-00083-g16f4799-dirty #21 [ 7.020696] [] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x10/0x14) [ 7.029190] [] (show_stack+0x10/0x14) from [] (dump_stack+0x7c/0xb0) [ 7.037255] [] (dump_stack+0x7c/0xb0) from [] (warn_slowpath_common+0x6c/0x88) [ 7.046190] [] (warn_slowpath_common+0x6c/0x88) from [] (warn_slowpath_null+0x1c/0x24) [ 7.055818] [] (warn_slowpath_null+0x1c/0x24) from [] (clk_disable+0x18/0x24) [ 7.064670] [] (clk_disable+0x18/0x24) from [] (exynos5_i2c_remove+0x1c/0x34 [i2c_exynos5]) [ 7.074736] [] (exynos5_i2c_remove+0x1c/0x34 [i2c_exynos5]) from [] (__device_release_driver+0x58/0xb0) [ 7.085836] [] (__device_release_driver+0x58/0xb0) from [] (driver_detach+0xac/0xb0) [ 7.095291] [] (driver_detach+0xac/0xb0) from [] (bus_remove_driver+0x4c/0xa0) [ 7.104227] [] (bus_remove_driver+0x4c/0xa0) from [] (SyS_delete_module+0x124/0x194) [ 7.113682] [] (SyS_delete_module+0x124/0x194) from [] (ret_fast_syscall+0x0/0x30) [ 7.122957] ---[ end trace 23bb6e4e0bf52196 ]--- [ 7.127591] ------------[ cut here ]------------ [ 7.132187] WARNING: CPU: 2 PID: 1137 at drivers/clk/clk.c:751 clk_unprepare+0x14/0x1c() [ 7.140259] Modules linked in: i2c_exynos5(-) [ 7.144560] CPU: 2 PID: 1137 Comm: rmmod Tainted: G W 3.12.0-next-20131105-00083-g16f4799-dirty #21 [ 7.154493] [] (unwind_backtrace+0x0/0xf4) from [] (show_stack+0x10/0x14) [ 7.163006] [] (show_stack+0x10/0x14) from [] (dump_stack+0x7c/0xb0) [ 7.171052] [] (dump_stack+0x7c/0xb0) from [] (warn_slowpath_common+0x6c/0x88) [ 7.179984] [] (warn_slowpath_common+0x6c/0x88) from [] (warn_slowpath_null+0x1c/0x24) [ 7.189616] [] (warn_slowpath_null+0x1c/0x24) from [] (clk_unprepare+0x14/0x1c) [ 7.198639] [] (clk_unprepare+0x14/0x1c) from [] (exynos5_i2c_remove+0x24/0x34 [i2c_exynos5]) [ 7.208876] [] (exynos5_i2c_remove+0x24/0x34 [i2c_exynos5]) from [] (__device_release_driver+0x58/0xb0) [ 7.219978] [] (__device_release_driver+0x58/0xb0) from [] (driver_detach+0xac/0xb0) [ 7.229434] [] (driver_detach+0xac/0xb0) from [] (bus_remove_driver+0x4c/0xa0) [ 7.238369] [] (bus_remove_driver+0x4c/0xa0) from [] (SyS_delete_module+0x124/0x194) [ 7.247824] [] (SyS_delete_module+0x124/0x194) from [] (ret_fast_syscall+0x0/0x30) [ 7.257104] ---[ end trace 23bb6e4e0bf52197 ]--- Signed-off-by: Sachin Kamat Cc: Naveen Krishna Chatradhi Acked-by: Naveen Krishna Chatradhi --- drivers/i2c/busses/i2c-exynos5.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index d419300..c1ef228 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -702,10 +702,6 @@ static int exynos5_i2c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, i2c); - clk_disable_unprepare(i2c->clk); - - return 0; - err_clk: clk_disable_unprepare(i2c->clk); return ret; @@ -716,7 +712,6 @@ static int exynos5_i2c_remove(struct platform_device *pdev) struct exynos5_i2c *i2c = platform_get_drvdata(pdev); i2c_del_adapter(&i2c->adap); - clk_disable_unprepare(i2c->clk); return 0; }