Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/807360/?format=api
{ "id": 807360, "url": "http://patchwork.ozlabs.org/api/patches/807360/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/3521168.PErTxbFMEc@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": "<3521168.PErTxbFMEc@aspire.rjw.lan>", "list_archive_url": null, "date": "2017-08-30T00:07:20", "name": "[RFT,v2,3/3] PM: i2c-designware-platdrv: System sleep handling rework", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": false, "hash": "d11688f3fceb91482f04d7b488f9c2e8f3222f20", "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/3521168.PErTxbFMEc@aspire.rjw.lan/mbox/", "series": [ { "id": 507, "url": "http://patchwork.ozlabs.org/api/series/507/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=507", "date": "2017-08-30T00:07:20", "name": "PM / ACPI / i2c: Runtime PM aware system sleep handling", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/507/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/807360/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/807360/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 3xhmRG40vnz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 10:22:18 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751314AbdH3AWN (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tTue, 29 Aug 2017 20:22:13 -0400", "from cloudserver094114.home.net.pl ([79.96.170.134]:65127 \"EHLO\n\tcloudserver094114.home.net.pl\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1751240AbdH3AWM (ORCPT\n\t<rfc822; linux-i2c@vger.kernel.org>); Tue, 29 Aug 2017 20:22:12 -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 2acc850ec96ec145; Wed, 30 Aug 2017 02:22:10 +0200" ], "From": "\"Rafael J. Wysocki\" <rjw@rjwysocki.net>", "To": "linux-pm@vger.kernel.org", "Cc": "Wolfram Sang <wsa@the-dreams.de>, linux-acpi@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\tJohannes Stezenbach <js@sig21.net>, linux-i2c@vger.kernel.org,\n\tUlf Hansson <ulf.hansson@linaro.org>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>", "Subject": "[RFT][PATCH v2 3/3] PM: i2c-designware-platdrv: System sleep\n\thandling rework", "Date": "Wed, 30 Aug 2017 02:07:20 +0200", "Message-ID": "<3521168.PErTxbFMEc@aspire.rjw.lan>", "In-Reply-To": "<1551534.5XKjjnxbAy@aspire.rjw.lan>", "References": "<1551534.5XKjjnxbAy@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\nRework the power management part of the i2c-designware-platdrv driver\nso that it need not be runtime resumed by the generic ACPI PM domain\nand the ACPI LPSS driver during system suspend.\n\nFirst, add a \"suspended\" and \"suspend_skipped\" flags to struct\ndw_i2c_dev and make dw_i2c_plat_suspend() and dw_i2c_plat_resume()\nuse them to avoid suspending or resuming the device twice in a row\nand to avoid resuming a previously runtime-suspended device during\nsystem resume.\n\nSecond, point the driver's ->late_suspend and ->early_resume\ncallbacks, rather than its ->suspend and ->resume callbacks,\nto dw_i2c_plat_suspend() and dw_i2c_plat_resume(), respectively,\nso that they are not executed in parallel with each other, for\nexample if runtime resume of the device takes place during system\nsuspend.\n\nNext, make the driver set the SAFE_SUSPEND driver flag (introduced\nearlier) to inform the upper code layers that from the driver's\nperspective it is fine to leave the device in runtime suspend over\nsystem suspend and resume.\n\nFinally, drop the driver's ->prepare and ->complete PM callbacks\nthat aren't necessary any more, because the driver is now able to\ncope with devices left in runtime suspend over system suspend and\nresume and need not indicate to the PM core that its suspend\nand resume callbacks may be skipped (and need not clean up if the\ncore actually does that).\n\nSigned-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>\n---\n drivers/i2c/busses/i2c-designware-core.h | 2 +\n drivers/i2c/busses/i2c-designware-platdrv.c | 36 +++++++++++++---------------\n 2 files changed, 19 insertions(+), 19 deletions(-)", "diff": "Index: linux-pm/drivers/i2c/busses/i2c-designware-platdrv.c\n===================================================================\n--- linux-pm.orig/drivers/i2c/busses/i2c-designware-platdrv.c\n+++ linux-pm/drivers/i2c/busses/i2c-designware-platdrv.c\n@@ -358,6 +358,7 @@ static int dw_i2c_plat_probe(struct plat\n \tif (dev->pm_disabled) {\n \t\tpm_runtime_forbid(&pdev->dev);\n \t} else {\n+\t\tpdev->dev.power.driver_flags = DPM_FLAG_SAFE_SUSPEND;\n \t\tpm_runtime_set_autosuspend_delay(&pdev->dev, 1000);\n \t\tpm_runtime_use_autosuspend(&pdev->dev);\n \t\tpm_runtime_set_active(&pdev->dev);\n@@ -413,31 +414,23 @@ static const struct of_device_id dw_i2c_\n MODULE_DEVICE_TABLE(of, dw_i2c_of_match);\n #endif\n \n-#ifdef CONFIG_PM_SLEEP\n-static int dw_i2c_plat_prepare(struct device *dev)\n-{\n-\treturn pm_runtime_suspended(dev);\n-}\n-\n-static void dw_i2c_plat_complete(struct device *dev)\n-{\n-\tif (dev->power.direct_complete)\n-\t\tpm_request_resume(dev);\n-}\n-#else\n-#define dw_i2c_plat_prepare\tNULL\n-#define dw_i2c_plat_complete\tNULL\n-#endif\n-\n #ifdef CONFIG_PM\n static int dw_i2c_plat_suspend(struct device *dev)\n {\n \tstruct platform_device *pdev = to_platform_device(dev);\n \tstruct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);\n \n+\tif (i_dev->suspended) {\n+\t\ti_dev->suspend_skipped = true;\n+\t\treturn 0;\n+\t}\n+\n \ti_dev->disable(i_dev);\n \ti2c_dw_plat_prepare_clk(i_dev, false);\n \n+\ti_dev->suspended = true;\n+\ti_dev->suspend_skipped = false;\n+\n \treturn 0;\n }\n \n@@ -446,6 +439,13 @@ static int dw_i2c_plat_resume(struct dev\n \tstruct platform_device *pdev = to_platform_device(dev);\n \tstruct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);\n \n+\tif (!i_dev->suspended || i_dev->suspend_skipped) {\n+\t\ti_dev->suspend_skipped = false;\n+\t\treturn 0;\n+\t}\n+\n+\ti_dev->suspended = false;\n+\n \ti2c_dw_plat_prepare_clk(i_dev, true);\n \ti_dev->init(i_dev);\n \n@@ -453,9 +453,7 @@ static int dw_i2c_plat_resume(struct dev\n }\n \n static const struct dev_pm_ops dw_i2c_dev_pm_ops = {\n-\t.prepare = dw_i2c_plat_prepare,\n-\t.complete = dw_i2c_plat_complete,\n-\tSET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)\n+\tSET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume)\n \tSET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)\n };\n \nIndex: linux-pm/drivers/i2c/busses/i2c-designware-core.h\n===================================================================\n--- linux-pm.orig/drivers/i2c/busses/i2c-designware-core.h\n+++ linux-pm/drivers/i2c/busses/i2c-designware-core.h\n@@ -280,6 +280,8 @@ struct dw_i2c_dev {\n \tint\t\t\t(*acquire_lock)(struct dw_i2c_dev *dev);\n \tvoid\t\t\t(*release_lock)(struct dw_i2c_dev *dev);\n \tbool\t\t\tpm_disabled;\n+\tbool\t\t\tsuspended;\n+\tbool\t\t\tsuspend_skipped;\n \tvoid\t\t\t(*disable)(struct dw_i2c_dev *dev);\n \tvoid\t\t\t(*disable_int)(struct dw_i2c_dev *dev);\n \tint\t\t\t(*init)(struct dw_i2c_dev *dev);\n", "prefixes": [ "RFT", "v2", "3/3" ] }