From patchwork Wed Oct 17 15:34:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1606721 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 413F0E00AF for ; Wed, 17 Oct 2012 15:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932325Ab2JQPjt (ORCPT ); Wed, 17 Oct 2012 11:39:49 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:46580 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932203Ab2JQPjr (ORCPT ); Wed, 17 Oct 2012 11:39:47 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9HFdeDO006509; Wed, 17 Oct 2012 10:39:40 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9HFdehZ001383; Wed, 17 Oct 2012 10:39:40 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Wed, 17 Oct 2012 10:39:40 -0500 Received: from localhost (h68-7.vpn.ti.com [172.24.68.7]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9HFdd54021534; Wed, 17 Oct 2012 10:39:40 -0500 From: Felipe Balbi To: Tony Lindgren CC: Paul Walmsley , Kevin Hilman , Santosh Shilimkar , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Felipe Balbi Subject: [RFC/NOT FOR MERGING 2/5] arm: omap: don't forcefully runtime suspend a device Date: Wed, 17 Oct 2012 18:34:00 +0300 Message-ID: <1350488043-5053-3-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.8.0.rc0 In-Reply-To: <1350488043-5053-1-git-send-email-balbi@ti.com> References: <1350488043-5053-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org device drivers should be smart enough to provide ->suspend/->resume callbacks when needed and they should take care of doing whatever needs to be done in order to allow a device to be suspended. Calling pm_runtime_* from system suspend isn't the right way to achieve that, as it creates a situation where OMAP's PM has different requirements and semantics than all other architectures. Signed-off-by: Felipe Balbi --- arch/arm/plat-omap/omap_device.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 935f416..cd84eac 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -817,11 +817,9 @@ static int _od_suspend_noirq(struct device *dev) ret = pm_generic_suspend_noirq(dev); if (!ret && !pm_runtime_status_suspended(dev)) { - if (pm_generic_runtime_suspend(dev) == 0) { - if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)) - omap_device_idle(pdev); - od->flags |= OMAP_DEVICE_SUSPENDED; - } + if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)) + omap_device_idle(pdev); + od->flags |= OMAP_DEVICE_SUSPENDED; } return ret; @@ -841,7 +839,6 @@ static int _od_resume_noirq(struct device *dev) od->flags &= ~OMAP_DEVICE_SUSPENDED; if (!(od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND)) omap_device_enable(pdev); - pm_generic_runtime_resume(dev); } return pm_generic_resume_noirq(dev);