From patchwork Thu Oct 10 10:01:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 20932 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BB80A25C9D for ; Thu, 10 Oct 2013 10:02:22 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id i4sf7591797oah.3 for ; Thu, 10 Oct 2013 03:02:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=TnOTNdzNwM+MR+DhxKUakISgW2EiTDKv+EuunPCy8BA=; b=GOq/ybE449fs4FyCMDaNgCu8p5mo6Gx4dDELUyhYbEHpWhp1xABTqSFpOPVubWI3Ji 8fnUvO81p68qP3KJm/SPhopbanT+jM4xThS+ZoD5JdBEhEYdFY+r6YMUG6EOAPgPMjrE EwUauRq6j7TDyfXOaVHtZuQshfqKFDK50LIJOJ3sSGAdS5QncyhoukRrjlyp8TvqVhD6 dJgzY4qOOh8NRLYePOWiFxQfsf7Yxr264RBDpcfsOxBKcTXwE48wft/0bcU/31+YhL0q MUHAZTvQU13i3rHPD8j7pWihjaWb5+jIQo3IrQMGZyrkf+Gd3vvkuo+1zdVgAbGb9Nb2 Gz1g== X-Received: by 10.50.82.103 with SMTP id h7mr4171534igy.5.1381399341447; Thu, 10 Oct 2013 03:02:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.11.179 with SMTP id r19ls952035qeb.76.gmail; Thu, 10 Oct 2013 03:02:21 -0700 (PDT) X-Received: by 10.221.16.200 with SMTP id pz8mr5239278vcb.53.1381399341334; Thu, 10 Oct 2013 03:02:21 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id sc5si13893048vdc.35.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 03:02:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lf11so1445673vcb.35 for ; Thu, 10 Oct 2013 03:02:21 -0700 (PDT) X-Gm-Message-State: ALoCoQkzfV615/Iag03RmCL91IbQp38A5rSHR1hWZlzHeCthOX9KpS9g2PILKFvhW8l0IC0dpeib X-Received: by 10.52.37.69 with SMTP id w5mr6381086vdj.32.1381399341094; Thu, 10 Oct 2013 03:02:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp361930vcz; Thu, 10 Oct 2013 03:02:20 -0700 (PDT) X-Received: by 10.204.233.129 with SMTP id jy1mr7120765bkb.27.1381399339955; Thu, 10 Oct 2013 03:02:19 -0700 (PDT) Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by mx.google.com with ESMTPS id i5si7002876bkr.6.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 03:02:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.47 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.214.47; Received: by mail-bk0-f47.google.com with SMTP id mx12so856956bkb.34 for ; Thu, 10 Oct 2013 03:02:19 -0700 (PDT) X-Received: by 10.204.69.12 with SMTP id x12mr11540396bki.12.1381399339232; Thu, 10 Oct 2013 03:02:19 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id l5sm26653429bko.7.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 03:02:18 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Len Brown , Pavel Machek , " Rafael J. Wysocki" , Kevin Hilman , Alan Stern , Mika Westerberg , linux-pm@vger.kernel.org, Ulf Hansson Subject: [PATCH 2/2] mmc: core: Use autosuspend when applicable at runtime idle Date: Thu, 10 Oct 2013 12:01:47 +0200 Message-Id: <1381399307-21534-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381399307-21534-1-git-send-email-ulf.hansson@linaro.org> References: <1381399307-21534-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Typically the runtime idle function is triggered after resume and probe. Instead of immediately requesting the device to go into in-active state we make use of the autosuspend, if we have enabled it earlier. Cc: Len Brown Cc: Pavel Machek Cc: Rafael J. Wysocki Cc: Kevin Hilman Cc: Alan Stern Cc: Mika Westerberg Cc: linux-pm@vger.kernel.org Signed-off-by: Ulf Hansson --- drivers/mmc/core/bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index cdca8a7..7f0e900 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -205,6 +205,12 @@ static int mmc_runtime_resume(struct device *dev) static int mmc_runtime_idle(struct device *dev) { + if (pm_runtime_autosuspend_used(dev)) { + pm_runtime_mark_last_busy(dev); + pm_runtime_autosuspend(dev); + return -EBUSY; + } + return 0; }