From patchwork Tue Jul 10 23:02:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1179271 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 C5EC0DFF0F for ; Tue, 10 Jul 2012 23:02:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754849Ab2GJXCL (ORCPT ); Tue, 10 Jul 2012 19:02:11 -0400 Received: from na3sys009aog133.obsmtp.com ([74.125.149.82]:56301 "EHLO na3sys009aog133.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754703Ab2GJXCK (ORCPT ); Tue, 10 Jul 2012 19:02:10 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]) (using TLSv1) by na3sys009aob133.postini.com ([74.125.148.12]) with SMTP ID DSNKT/y0cb0AhqdLbXpLT5O0Ut2woll2Ze53@postini.com; Tue, 10 Jul 2012 16:02:10 PDT Received: by yenr5 with SMTP id r5so694558yen.0 for ; Tue, 10 Jul 2012 16:02:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=HIGdDpp0wbw4VnIX7cpiKWy5bhZPaew8UwFwje0iNVs=; b=J27HzSfS0/dlZ5HRDClqhijyWjsFoeIGw89J/4ATRuw3rBXc3QWysn5VxfoqGd2Vc2 g7pg/VJgfi9j3tQEG6IGt0iJnw3dUP+RypT3o5PaxvQFpGRDqvxdEQ+CzFPmykxzWiws IGU4+tIVrcHV9oMw4F39sxGnUucDZ2n+QzoO2hWPt1C0oekhjfTXEfI/p+gIZ+m934/V /DYbliiuL+KpGxwYa+aCnblivtl0nEepwOf+vK2ss0V8IkxdsNFcGH996XeS6psLDGIu SEFxlfUn/Z5OCQlE6XF0DKxOBUkHcKvuvXoEJFIvoDs9alAgfb4VkAouIxXyZQA43dF6 +3cA== Received: by 10.66.75.201 with SMTP id e9mr77052342paw.54.1341961328923; Tue, 10 Jul 2012 16:02:08 -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 ve4sm389017pbc.55.2012.07.10.16.02.07 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 Jul 2012 16:02:08 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org, Paul Walmsley Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] ARM: OMAP: omap_device: don't attempt late suspend if no driver bound Date: Tue, 10 Jul 2012 16:02:03 -0700 Message-Id: <1341961324-19657-2-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <1341961324-19657-1-git-send-email-khilman@ti.com> References: <1341961324-19657-1-git-send-email-khilman@ti.com> X-Gm-Message-State: ALoCoQnTaDs5v+YieEYsmJ7QcmGAwbwl7hr8cqMXe1RbLFLx5AXJZ+fW/9bfpVXwbhKu0EHw/ATB Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Currently, the omap_device PM domain layer uses the late suspend and early resume callbacks to ensure devices are in their low power states. However, this is attempted even in cases where a driver probe has failed. If a driver's ->probe() method fails, the driver is likely in a state where it is not expecting its runtime PM callbacks to be called, yet currently the omap_device PM domain code attempts to call the drivers callbacks. To fix, use the omap_device driver_status field to check whether a driver is bound to the omap_device before attempting to trigger driver callbacks. Cc: Paul Walmsley Signed-off-by: Kevin Hilman --- arch/arm/plat-omap/omap_device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index 1d1b5ff..150112e 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -756,6 +756,10 @@ static int _od_suspend_noirq(struct device *dev) struct omap_device *od = to_omap_device(pdev); int ret; + /* Don't attempt late suspend on a driver that is not bound */ + if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) + return 0; + ret = pm_generic_suspend_noirq(dev); if (!ret && !pm_runtime_status_suspended(dev)) {