From patchwork Sun Jan 8 08:41:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 9503369 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 C512960757 for ; Sun, 8 Jan 2017 08:44:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD806282ED for ; Sun, 8 Jan 2017 08:44:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B25C627BE5; Sun, 8 Jan 2017 08:44:14 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 58543282ED for ; Sun, 8 Jan 2017 08:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964775AbdAHIoG (ORCPT ); Sun, 8 Jan 2017 03:44:06 -0500 Received: from mailout2.hostsharing.net ([83.223.90.233]:53873 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935449AbdAHIoF (ORCPT ); Sun, 8 Jan 2017 03:44:05 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout2.hostsharing.net (Postfix) with ESMTPS id BD8F510189AC0; Sun, 8 Jan 2017 09:44:03 +0100 (CET) Received: from localhost (3-38-90-81.adsl.cmo.de [81.90.38.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 8EC396045F8B; Sun, 8 Jan 2017 09:44:02 +0100 (CET) X-Mailbox-Line: From bc77efb7da66b7c81c751a4b07f3b306e6dcba8f Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Lukas Wunner Date: Sun, 8 Jan 2017 09:41:45 +0100 Subject: [PATCH v4 6/8] PM / sleep: Define constant for direct_complete To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Andreas Noever , linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Chen Yu , "Rafael J. Wysocki" , Lee Jones 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 From: Chen Yu The PM core introduced the ability to keep devices runtime suspended during the entire system sleep process with commit aae4518b3124 ("PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily"). Drivers opt in to this so-called "direct_complete" mechanism by returning a positive value from their ->prepare hook. Usually this is achieved with a "return 1;" statement, which looks somewhat cryptic to readers not intimately familiar with the PM core. Improve clarity by defining a DPM_DIRECT_COMPLETE constant which drivers may use instead. Suggested-by: Rafael J. Wysocki Acked-by: Mika Westerberg Reviewed-by: Andy Shevchenko Cc: Lee Jones Signed-off-by: Chen Yu [LW: separate this hunk out of mfd patch, add commit message] Signed-off-by: Lukas Wunner --- include/linux/pm.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/pm.h b/include/linux/pm.h index f926af4..2d651a3 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -788,4 +788,11 @@ enum dpm_order { DPM_ORDER_DEV_LAST, }; +/* + * Return this from system suspend/hibernation ->prepare() callback to + * request the core to leave the device runtime-suspended during system + * suspend if possible. + */ +#define DPM_DIRECT_COMPLETE 1 + #endif /* _LINUX_PM_H */