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: 858962 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p57IMQCp013705 for ; Tue, 7 Jun 2011 18:22:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757826Ab1FGSWY (ORCPT ); Tue, 7 Jun 2011 14:22:24 -0400 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]:47647 "EHLO na3sys009aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757821Ab1FGSWX (ORCPT ); Tue, 7 Jun 2011 14:22:23 -0400 Received: from mail-pz0-f48.google.com ([209.85.210.48]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKTe5sXhY91xnOx2e8PLjSK/N1FpOPT5Hc@postini.com; Tue, 07 Jun 2011 11:22:23 PDT Received: by mail-pz0-f48.google.com with SMTP id 10so2915123pzk.7 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 Cc: linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, Rajendra Nayak , linux-arm-kernel@lists.infradead.org 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 07 Jun 2011 18:22:26 +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, };