From patchwork Tue Jun 7 18:22:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 858992 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p57INCOF010352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 7 Jun 2011 18:23:33 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QU0vc-000709-3d; Tue, 07 Jun 2011 18:23:00 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QU0vb-0007eD-CL; Tue, 07 Jun 2011 18:22:59 +0000 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QU0v7-0007Xh-54 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2011 18:22:30 +0000 Received: from mail-pz0-f49.google.com ([209.85.210.49]) (using TLSv1) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKTe5sX9uL5f8PpQ5G8Id/mnarEj8c9PW7@postini.com; Tue, 07 Jun 2011 11:22:26 PDT Received: by pzk28 with SMTP id 28so3165575pzk.8 for ; Tue, 07 Jun 2011 11:22:22 -0700 (PDT) Received: by 10.68.0.102 with SMTP id 6mr310995pbd.487.1307470942671; Tue, 07 Jun 2011 11:22:22 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net [24.19.7.36]) by mx.google.com with ESMTPS id y2sm471103pbg.88.2011.06.07.11.22.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Jun 2011 11:22:22 -0700 (PDT) From: Kevin Hilman To: Ben Dooks Subject: [PATCH 3/3] I2C: OMAP: remove racy suspend/resume callbacks Date: Tue, 7 Jun 2011 11:22:31 -0700 Message-Id: <1307470951-22801-4-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1307470951-22801-1-git-send-email-khilman@ti.com> References: <1307470951-22801-1-git-send-email-khilman@ti.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110607_142229_445446_86E4C771 X-CRM114-Status: GOOD ( 14.86 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.207 listed in list.dnswl.org] Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, Rajendra Nayak X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 07 Jun 2011 18:23:33 +0000 (UTC) Current system PM methods for this driver race with the runtime PM methods when an i2c xfer is in progress when the system suspend path is excuted. These callbacks are only needed when runtime PM is disabled from userspace, so for now we accept that this device will not hit retention, even in suspend, if runtime PM disabled. The correct fix (forthcoming) for v3.0+ is to use device power domain callbacks at the system PM level to handle this, but for now, this avoids the race. Signed-off-by: Kevin Hilman --- drivers/i2c/busses/i2c-omap.c | 20 -------------------- 1 files changed, 0 insertions(+), 20 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 4e3256f..77ed95f 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1150,27 +1150,7 @@ static int omap_i2c_runtime_resume(struct device *dev) return 0; } -static int omap_i2c_suspend(struct device *dev) -{ - if (!pm_runtime_suspended(dev)) - if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_suspend) - dev->bus->pm->runtime_suspend(dev); - - return 0; -} - -static int omap_i2c_resume(struct device *dev) -{ - if (!pm_runtime_suspended(dev)) - if (dev->bus && dev->bus->pm && dev->bus->pm->runtime_resume) - dev->bus->pm->runtime_resume(dev); - - return 0; -} - static struct dev_pm_ops omap_i2c_pm_ops = { - .suspend = omap_i2c_suspend, - .resume = omap_i2c_resume, .runtime_suspend = omap_i2c_runtime_suspend, .runtime_resume = omap_i2c_runtime_resume, };