From patchwork Mon Apr 10 11:38:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 9672455 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CCB860231 for ; Mon, 10 Apr 2017 11:38:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351C625D9E for ; Mon, 10 Apr 2017 11:38:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29B35281F9; Mon, 10 Apr 2017 11:38:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B47AF25D9E for ; Mon, 10 Apr 2017 11:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbdDJLiw (ORCPT ); Mon, 10 Apr 2017 07:38:52 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36358 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753163AbdDJLiv (ORCPT ); Mon, 10 Apr 2017 07:38:51 -0400 Received: by mail-lf0-f67.google.com with SMTP id 75so2808050lfs.3; Mon, 10 Apr 2017 04:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=s692XYeSxU+XRS2uiQv2TA8GBzyNrJ5oUGeN+H68QYw=; b=muFnEfN8NBKJC3SHWQci7S01vc1aXzr7epF1f5i8EoVZ1RliVzEY5Vuy0X8522aLyZ Qrc2/lyIyG3S7HtTuIQJ0z17o+1Cjme/aNXfnJnJAkeQ19grXGMDXUKr8FZyFIoNEXq9 gXmMqU2pAPrJWOR+JpppUlaN6DjSvw2kctcgNnyYy6Kr+SHahf60d7P7xtTy1+hgrP7J bmFfBqM4TBuWfqYXBUO/TA+LnfA/0zcNNbYrSEEOeAXdnJcgGCVOHB89Riy1X9/m7uWq l+xwCUeMjn7NIjak62whHEl1RYcXzWyk6urlY/6tJckfIoj2q1JS+RGp1b/7qbeO3AbN Y0lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=s692XYeSxU+XRS2uiQv2TA8GBzyNrJ5oUGeN+H68QYw=; b=DdtL+hXoMqDvwTBnMNiwfDQ6j9mhi84W2rW4D1jGO6EbSggfDa7LSzJiJVzXgbTHts 3i3auTql/wjUAMqzsc+LSa6V541m41f0/+/HxkoHCjbn32LSu5nmR6UuYkGvzmc5eWo4 mIEnpmKbaw/ou4MqxyJeKcTVgYyD6maS6HlJ1FxCx13a9gT4i1aFagk/YiPUdcwXUUl8 I4aJswdHpUhHUhbgAC8dgv3xOo5EfrZ+B/o2xp02OhVAdV7nH3qqaljwzCOpQclzqXkD T4VFVsdvpKZlV5pWJxEs/2+GEaYR3fYzEZM8saULSo/Qzavbi/8Uv7QWZTpktc1E0X2B ghgA== X-Gm-Message-State: AFeK/H0xnQw4woTTUr37nllxSBRnv0lVlWUkotTPaO2CG9jseC/APut3zFgW3sQr6t8EaQ== X-Received: by 10.25.29.66 with SMTP id d63mr18676326lfd.163.1491824329754; Mon, 10 Apr 2017 04:38:49 -0700 (PDT) Received: from xi.terra (c-42c8e255.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.226.200.66]) by smtp.gmail.com with ESMTPSA id 26sm2789325ljo.2.2017.04.10.04.38.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 04:38:49 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1cxXee-0004XK-1n; Mon, 10 Apr 2017 13:38:44 +0200 From: Johan Hovold To: "Rafael J. Wysocki" Cc: Len Brown , Pavel Machek , Alan Stern , Kevin Hilman , Tony Lindgren , Ulf Hansson , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 1/2] PM / Runtime: fix autosuspend documentation Date: Mon, 10 Apr 2017 13:38:24 +0200 Message-Id: <20170410113825.17399-1-johan@kernel.org> X-Mailer: git-send-email 2.12.2 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update the autosuspend documentation which claimed that the autosuspend delay is not taken into account when using the non-autosuspend helper functions, something which is no longer true since commit d66e6db28df3 ("PM / Runtime: Respect autosuspend when idle triggers suspend"). This specifically means that drivers must now disable autosuspend before disabling runtime pm in probe error paths and remove callbacks if pm_runtime_put_sync was being used to suspend the device before returning. (If an idle callback can prevent suspend, pm_runtime_put_sync_suspend must be used instead of pm_runtime_put_sync as before.) Also remove the claim that the autosuspend helpers behave "just like the non-autosuspend counterparts", something which have never really been true as some of the latter use idle notifications. Signed-off-by: Johan Hovold Acked-by: Tony Lindgren --- Documentation/power/runtime_pm.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt index 64546eb9a16a..56a13b865927 100644 --- a/Documentation/power/runtime_pm.txt +++ b/Documentation/power/runtime_pm.txt @@ -836,9 +836,8 @@ of the non-autosuspend counterparts: Instead of: pm_runtime_put_sync use: pm_runtime_put_sync_autosuspend. Drivers may also continue to use the non-autosuspend helper functions; they -will behave normally, not taking the autosuspend delay into account. -Similarly, if the power.use_autosuspend field isn't set then the autosuspend -helper functions will behave just like the non-autosuspend counterparts. +will behave normally, which means sometimes taking the autosuspend delay into +account (see pm_runtime_idle). Under some circumstances a driver or subsystem may want to prevent a device from autosuspending immediately, even though the usage counter is zero and the