From patchwork Fri Aug 10 18:39:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1306351 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 287A83FC33 for ; Fri, 10 Aug 2012 18:39:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759921Ab2HJSjT (ORCPT ); Fri, 10 Aug 2012 14:39:19 -0400 Received: from na3sys009aog118.obsmtp.com ([74.125.149.244]:38301 "EHLO na3sys009aog118.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759903Ab2HJSjS (ORCPT ); Fri, 10 Aug 2012 14:39:18 -0400 Received: from mail-gg0-f182.google.com ([209.85.161.182]) (using TLSv1) by na3sys009aob118.postini.com ([74.125.148.12]) with SMTP ID DSNKUCVVVWMgbkHDm5ZGPq8JDCU2EAF0S5/y@postini.com; Fri, 10 Aug 2012 11:39:18 PDT Received: by ggnk4 with SMTP id k4so2298318ggn.13 for ; Fri, 10 Aug 2012 11:39:17 -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=LeYY+nF+XV9uDfg0zH/hLsfMZizVCaO/9DvczBnb08tZEw1GL0q1rFUtGiYc0sKp7R eekPinq0aHPD7BOhQ8dUkvcFZeXyNGGwjZyAO9nX33I+V+hWRHLMfa/I1CcJNb0Yj9Ge br4haa0rmGk9q1X1Ddk7ItnpNr7B4rst81hxDJdzwWad+SMRETvWk7OKXN+WXy6OpV02 rnIOW4FEsQIAC8kAipVZDjqzKIZsXJqxUTw3DYBbVJEtQzl6wmLwMt5u+n7ckJ2AyrOg G7TrkkERCeROyj1YZ4f9ArnYNZWOUtn4vVZuKpvl86hPlkZ4FcFOyVjK+O/qgR+xFPJg FLiQ== Received: by 10.66.76.231 with SMTP id n7mr1283835paw.68.1344623957146; Fri, 10 Aug 2012 11:39:17 -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 hr9sm3816897pbc.36.2012.08.10.11.39.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 11:39:16 -0700 (PDT) From: Kevin Hilman To: Paul Walmsley , linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] ARM: OMAP: omap_device: don't attempt late suspend if no driver bound Date: Fri, 10 Aug 2012 11:39:12 -0700 Message-Id: <1344623953-26434-3-git-send-email-khilman@ti.com> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <1344623953-26434-1-git-send-email-khilman@ti.com> References: <1344623953-26434-1-git-send-email-khilman@ti.com> X-Gm-Message-State: ALoCoQkIZYmuzTXG6bpbPMErv4yCkN7rLDchwkEXF0fePt2ozYrxOL2sxbnfGYIxZcbGlE0s+9L3 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)) {