get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/809485/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 809485,
    "url": "http://patchwork.ozlabs.org/api/patches/809485/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/patch/6044272.h4jTMoqRfC@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": "<6044272.h4jTMoqRfC@aspire.rjw.lan>",
    "list_archive_url": null,
    "date": "2017-09-03T23:14:44",
    "name": "[RFT,2/2] PM / i2c: designware: Clean up system sleep handling without ACPI",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "9a992570f2dfac2bbe2995e6fd22a1a8dc449362",
    "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/6044272.h4jTMoqRfC@aspire.rjw.lan/mbox/",
    "series": [
        {
            "id": 1289,
            "url": "http://patchwork.ozlabs.org/api/series/1289/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-i2c/list/?series=1289",
            "date": "2017-09-03T23:14:44",
            "name": "i2c: designware: Runtime PM aware system sleep handling",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1289/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/809485/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809485/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 3xlpx304qHz9t0F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  4 Sep 2017 09:25:10 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753168AbdICXZG (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tSun, 3 Sep 2017 19:25:06 -0400",
            "from cloudserver094114.home.net.pl ([79.96.170.134]:57867 \"EHLO\n\tcloudserver094114.home.net.pl\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1753020AbdICXZF (ORCPT\n\t<rfc822;linux-i2c@vger.kernel.org>); Sun, 3 Sep 2017 19:25:05 -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 89e27049e3c82197; Mon, 4 Sep 2017 01:25:03 +0200"
        ],
        "From": "\"Rafael J. Wysocki\" <rjw@rjwysocki.net>",
        "To": "linux-pm@vger.kernel.org, linux-i2c@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>, Ulf Hansson <ulf.hansson@linaro.org>",
        "Subject": "[RFT][PATCH 2/2] PM / i2c: designware: Clean up system sleep\n\thandling without ACPI",
        "Date": "Mon, 04 Sep 2017 01:14:44 +0200",
        "Message-ID": "<6044272.h4jTMoqRfC@aspire.rjw.lan>",
        "In-Reply-To": "<3023226.l5IfJK6GIc@aspire.rjw.lan>",
        "References": "<3023226.l5IfJK6GIc@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\nAfter commit a23318feeff6 (i2c: designware: Fix system suspend)\nthe i2c-designware-platdrv driver always resumes the device in its\nsystem sleep ->suspend callback which isn't particularly nice,\neven though it is technically correct.\n\nA better approach would be to make the driver track the PM state of\nthe device so that it doesn't need to resume it in ->suspend and\nto drop its ->prepare and ->complete callbacks which would only be\nmarginally useful then, so implement it.\n\nFirst, drop dw_i2c_plat_suspend() added by commit a23318feeff6 and\nrename dw_i2c_plat_runtime_suspend() back to dw_i2c_plat_suspend().\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.  Also, since the driver enables runtime PM unconditionally\nin dw_i2c_plat_probe(), this change allows the\npm_runtime_status_suspended() check to be used in the PM callbacks\nto determine whether or not the device needs to be either suspended\nor resumed (moving the callbacks into the late/early stages of\nsystem suspend/resume, respectively, guarantees the stability\nof the runtime PM status at the time when they are invoked).\n\nNext, add a \"skip_resume\" flag to struct dw_i2c_dev and make\ndw_i2c_plat_suspend() and dw_i2c_plat_resume() use it to avoid\nresuming a previously runtime-suspended device during system resume.\n\nFinally, drop the driver's ->prepare and ->complete PM callbacks,\nbecause returning \"true\" from ->prepare for runtime-suspended\ndevices is marginally useful (the PM core may still ignore that\nreturn value and invoke the driver's ->suspend callback anyway)\nand ->complete is only needed because of what ->prepare does.\n\nOverrides: a23318feeff6 (i2c: designware: Fix system suspend)\nSigned-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>\n---\n drivers/i2c/busses/i2c-designware-core.h    |    1 \n drivers/i2c/busses/i2c-designware-platdrv.c |   47 +++++++++-------------------\n 2 files changed, 17 insertions(+), 31 deletions(-)",
    "diff": "Index: 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,7 @@ 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\tskip_resume;\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);\nIndex: 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@@ -434,28 +434,17 @@ 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_runtime_suspend(struct device *dev)\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 (pm_runtime_status_suspended(dev)) {\n+\t\ti_dev->skip_resume = 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@@ -467,27 +456,23 @@ 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 (!pm_runtime_status_suspended(dev))\n+\t\treturn 0;\n+\n+\tif (i_dev->skip_resume) {\n+\t\ti_dev->skip_resume = false;\n+\t\treturn 0;\n+\t}\n+\n \ti2c_dw_plat_prepare_clk(i_dev, true);\n \ti_dev->init(i_dev);\n \n \treturn 0;\n }\n \n-#ifdef CONFIG_PM_SLEEP\n-static int dw_i2c_plat_suspend(struct device *dev)\n-{\n-\tpm_runtime_resume(dev);\n-\treturn dw_i2c_plat_runtime_suspend(dev);\n-}\n-#endif\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_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend,\n-\t\t\t   dw_i2c_plat_resume,\n-\t\t\t   NULL)\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 \n #define DW_I2C_DEV_PMOPS (&dw_i2c_dev_pm_ops)\n",
    "prefixes": [
        "RFT",
        "2/2"
    ]
}