From patchwork Mon May 13 11:05:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 2558081 Return-Path: X-Original-To: patchwork-linux-pm@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 D2AA6DF2E5 for ; Mon, 13 May 2013 11:03:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752513Ab3EMLDI (ORCPT ); Mon, 13 May 2013 07:03:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:2297 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753793Ab3EMLDH (ORCPT ); Mon, 13 May 2013 07:03:07 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 May 2013 04:01:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,662,1363158000"; d="scan'208";a="336222356" Received: from blue.fi.intel.com ([10.237.72.156]) by orsmga002.jf.intel.com with ESMTP; 13 May 2013 04:03:04 -0700 Received: by blue.fi.intel.com (Postfix, from userid 1004) id 7D2CAE0085; Mon, 13 May 2013 14:05:27 +0300 (EEST) From: Mika Westerberg To: linux-pm@vger.kernel.org Cc: Pavel Machek , "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Mika Westerberg , linux-kernel@vger.kernel.org Subject: [PATCH] PM / Runtime: honor device autosuspend in pm_generic_runtime_idle() Date: Mon, 13 May 2013 14:05:27 +0300 Message-Id: <1368443127-9636-1-git-send-email-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org If the device is using autosuspend we should honor that and call pm_runtime_autosuspend() instead of pm_runtime_suspend(). Failing to do so causes the device to be suspended immediately even though it expects to be suspended only when the autosuspend delay is expired. Signed-off-by: Mika Westerberg --- drivers/base/power/generic_ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c index bfd898b..19786ca 100644 --- a/drivers/base/power/generic_ops.c +++ b/drivers/base/power/generic_ops.c @@ -29,7 +29,10 @@ int pm_generic_runtime_idle(struct device *dev) return ret; } - pm_runtime_suspend(dev); + if (dev->power.use_autosuspend) + pm_runtime_autosuspend(dev); + else + pm_runtime_suspend(dev); return 0; } EXPORT_SYMBOL_GPL(pm_generic_runtime_idle);