Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806884/?format=api
{ "id": 806884, "url": "http://patchwork.ozlabs.org/api/patches/806884/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/35841101.LqGbCjJMGH@aspire.rjw.lan/", "project": { "id": 35, "url": "http://patchwork.ozlabs.org/api/projects/35/?format=api", "name": "Linux I2C development", "link_name": "linux-i2c", "list_id": "linux-i2c.vger.kernel.org", "list_email": "linux-i2c@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<35841101.LqGbCjJMGH@aspire.rjw.lan>", "list_archive_url": null, "date": "2017-08-29T00:20:11", "name": "[1/3] PM / core: Add SAFE_SUSPEND driver flag", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "1dfb73ff896a2cf2a0daeb799a2d29711d666c01", "submitter": { "id": 26536, "url": "http://patchwork.ozlabs.org/api/people/26536/?format=api", "name": "Rafael J. Wysocki", "email": "rjw@rjwysocki.net" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-i2c/patch/35841101.LqGbCjJMGH@aspire.rjw.lan/mbox/", "series": [ { "id": 283, "url": "http://patchwork.ozlabs.org/api/series/283/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=283", "date": "2017-08-29T00:59:49", "name": "PM / ACPI / i2c: Runtime PM aware system sleep handling", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/283/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806884/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806884/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-i2c-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-i2c-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xh9Xv4rGxz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 11:10:07 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751298AbdH2BKF (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tMon, 28 Aug 2017 21:10:05 -0400", "from cloudserver094114.home.net.pl ([79.96.170.134]:57114 \"EHLO\n\tcloudserver094114.home.net.pl\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1751227AbdH2BKD (ORCPT\n\t<rfc822; linux-i2c@vger.kernel.org>); Mon, 28 Aug 2017 21:10:03 -0400", "from 79.184.253.199.ipv4.supernova.orange.pl (79.184.253.199)\n\t(HELO aspire.rjw.lan)\n\tby serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer\n\t0.82) id 716c1e630edd6c76; Tue, 29 Aug 2017 03:10:01 +0200" ], "From": "\"Rafael J. Wysocki\" <rjw@rjwysocki.net>", "To": "Ulf Hansson <ulf.hansson@linaro.org>", "Cc": "Wolfram Sang <wsa@the-dreams.de>, Len Brown <lenb@kernel.org>,\n\tlinux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,\n\tKevin Hilman <khilman@kernel.org>,\n\tJarkko Nikula <jarkko.nikula@linux.intel.com>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tJisheng Zhang <jszhang@marvell.com>,\n\tJohn Stultz <john.stultz@linaro.org>, Guodong Xu <guodong.xu@linaro.org>,\n\tSumit Semwal <sumit.semwal@linaro.org>,\n\tHaojian Zhuang <haojian.zhuang@linaro.org>,\n\tlinux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>", "Subject": "[PATCH 1/3] PM / core: Add SAFE_SUSPEND driver flag", "Date": "Tue, 29 Aug 2017 02:20:11 +0200", "Message-ID": "<35841101.LqGbCjJMGH@aspire.rjw.lan>", "In-Reply-To": "<4245176.X6JjkhnUAM@aspire.rjw.lan>", "References": "<1503499329-28834-1-git-send-email-ulf.hansson@linaro.org>\n\t<4245176.X6JjkhnUAM@aspire.rjw.lan>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "7Bit", "Content-Type": "text/plain; charset=\"us-ascii\"", "Sender": "linux-i2c-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-i2c.vger.kernel.org>", "X-Mailing-List": "linux-i2c@vger.kernel.org" }, "content": "From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>\n\nAdd a driver_flags field to struct dev_pm_info for flags that can be\nset by device drivers at the probe time to inform the PM core and/or\nbus types, PM domains and so on on the capabilities and/or\npreferences of device drivers. It is anticipated that more than one\nflag of this kind will be necessary going forward.\n\nDefine and document a SAFE_SUSPEND flag to instruct bus types and PM\ndomains that the system suspend callbacks provided by the driver can\ncope with runtime suspended devices, so from the driver's perspective\nit should be safe to leave devices in runtime suspend during system\nsuspend.\n\nSigned-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>\n---\n Documentation/driver-api/pm/devices.rst | 7 +++++++\n drivers/base/dd.c | 2 ++\n include/linux/pm.h | 16 ++++++++++++++++\n 3 files changed, 25 insertions(+)", "diff": "Index: linux-pm/include/linux/pm.h\n===================================================================\n--- linux-pm.orig/include/linux/pm.h\n+++ linux-pm/include/linux/pm.h\n@@ -550,6 +550,21 @@ struct pm_subsys_data {\n #endif\n };\n \n+/*\n+ * Driver flags to control system suspend/resume behavior.\n+ *\n+ * These flags can be set by device drivers at the probe time. They need not be\n+ * cleared by the drivers as the driver core will take care of that.\n+ *\n+ * SAFE_SUSPEND: No need to runtime resume the device during system suspend.\n+ *\n+ * Setting SAFE_SUSPEND instructs bus types and PM domains which may want to\n+ * runtime resume the device upfront during system suspend that doing so is not\n+ * necessary from the driver's perspective, because the system suspend callbacks\n+ * provided by it can cope with a runtime suspended device.\n+ */\n+#define DPM_FLAG_SAFE_SUSPEND\tBIT(0)\n+\n struct dev_pm_info {\n \tpm_message_t\t\tpower_state;\n \tunsigned int\t\tcan_wakeup:1;\n@@ -561,6 +576,7 @@ struct dev_pm_info {\n \tbool\t\t\tis_late_suspended:1;\n \tbool\t\t\tearly_init:1;\t/* Owned by the PM core */\n \tbool\t\t\tdirect_complete:1;\t/* Owned by the PM core */\n+\tunsigned int\t\tdriver_flags;\n \tspinlock_t\t\tlock;\n #ifdef CONFIG_PM_SLEEP\n \tstruct list_head\tentry;\nIndex: linux-pm/drivers/base/dd.c\n===================================================================\n--- linux-pm.orig/drivers/base/dd.c\n+++ linux-pm/drivers/base/dd.c\n@@ -436,6 +436,7 @@ pinctrl_bind_failed:\n \tif (dev->pm_domain && dev->pm_domain->dismiss)\n \t\tdev->pm_domain->dismiss(dev);\n \tpm_runtime_reinit(dev);\n+\tdev->power.driver_flags = 0;\n \n \tswitch (ret) {\n \tcase -EPROBE_DEFER:\n@@ -841,6 +842,7 @@ static void __device_release_driver(stru\n \t\tif (dev->pm_domain && dev->pm_domain->dismiss)\n \t\t\tdev->pm_domain->dismiss(dev);\n \t\tpm_runtime_reinit(dev);\n+\t\tdev->power.driver_flags = 0;\n \n \t\tklist_remove(&dev->p->knode_driver);\n \t\tdevice_pm_check_callbacks(dev);\nIndex: linux-pm/Documentation/driver-api/pm/devices.rst\n===================================================================\n--- linux-pm.orig/Documentation/driver-api/pm/devices.rst\n+++ linux-pm/Documentation/driver-api/pm/devices.rst\n@@ -729,6 +729,13 @@ state temporarily, for example so that i\n disabled. This all depends on the hardware and the design of the subsystem and\n device driver in question.\n \n+Some bus types and PM domains have a policy to runtime resume all\n+devices upfront in their ``->suspend`` callbacks, but that may not be really\n+necessary if the system suspend-resume callbacks provided by the device's\n+driver can cope with a runtime-suspended device. The driver can indicate that\n+by setting ``DPM_FLAG_SAFE_SUSPEND`` in :c:member:`power.driver_flags` at the\n+probe time.\n+\n During system-wide resume from a sleep state it's easiest to put devices into\n the full-power state, as explained in :file:`Documentation/power/runtime_pm.txt`.\n Refer to that document for more information regarding this particular issue as\n", "prefixes": [ "1/3" ] }