get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1222139,
    "url": "http://patchwork.ozlabs.org/api/patches/1222139/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200113133359.24847-1-sasha.neftin@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20200113133359.24847-1-sasha.neftin@intel.com>",
    "list_archive_url": null,
    "date": "2020-01-13T13:33:59",
    "name": "[v2] igc: Complete to commit Add legacy power management support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "2ff884fdf32840b73519da00d40d1d48f2f4466b",
    "submitter": {
        "id": 69860,
        "url": "http://patchwork.ozlabs.org/api/people/69860/?format=api",
        "name": "Sasha Neftin",
        "email": "sasha.neftin@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200113133359.24847-1-sasha.neftin@intel.com/mbox/",
    "series": [
        {
            "id": 152817,
            "url": "http://patchwork.ozlabs.org/api/series/152817/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=152817",
            "date": "2020-01-13T13:33:59",
            "name": "[v2] igc: Complete to commit Add legacy power management support",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/152817/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1222139/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1222139/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.133;\n\thelo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 47xF1C0Rk9z9sNx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 14 Jan 2020 00:34:06 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 7ADBE86A07;\n\tMon, 13 Jan 2020 13:34:04 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 5nR0igQz1G+v; Mon, 13 Jan 2020 13:34:03 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id CD92C86963;\n\tMon, 13 Jan 2020 13:34:03 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0A35A1BF328\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Jan 2020 13:34:02 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id F004B85EE7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Jan 2020 13:34:01 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id RIL6XnJhgP2t for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Jan 2020 13:34:01 +0000 (UTC)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id E1421857DC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 13 Jan 2020 13:34:00 +0000 (UTC)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jan 2020 05:34:00 -0800",
            "from ccdlinuxdev08.iil.intel.com ([143.185.161.150])\n\tby FMSMGA003.fm.intel.com with ESMTP; 13 Jan 2020 05:33:59 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,429,1571727600\"; d=\"scan'208\";a=\"273028552\"",
        "From": "Sasha Neftin <sasha.neftin@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Mon, 13 Jan 2020 15:33:59 +0200",
        "Message-Id": "<20200113133359.24847-1-sasha.neftin@intel.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "Subject": "[Intel-wired-lan] [PATCH v2] igc: Complete to commit Add legacy\n\tpower management support",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "commit 9513d2a5dc7f (\"igc: Add legacy power management support\")\nAdd power management resume and schedule suspend requests.\nAdd power management get and put synchronization.\n\nv1 -> v2:\nadd pm_runtime_put_noidle\nadd pm_runtime_get_noresume\n\nSigned-off-by: Sasha Neftin <sasha.neftin@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc_main.c | 27 +++++++++++++++++++++++++++\n 1 file changed, 27 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex 069287a17957..e7787c0929b2 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -4029,6 +4029,9 @@ static void igc_watchdog_task(struct work_struct *work)\n \t\t}\n \t}\n \tif (link) {\n+\t\t/* Cancel scheduled suspend requests. */\n+\t\tpm_runtime_resume(netdev->dev.parent);\n+\n \t\tif (!netif_carrier_ok(netdev)) {\n \t\t\tu32 ctrl;\n \n@@ -4114,6 +4117,8 @@ static void igc_watchdog_task(struct work_struct *work)\n \t\t\t\t\treturn;\n \t\t\t\t}\n \t\t\t}\n+\t\t\tpm_schedule_suspend(netdev->dev.parent,\n+\t\t\t\t\t    MSEC_PER_SEC * 5);\n \n \t\t/* also check for alternate media here */\n \t\t} else if (!netif_carrier_ok(netdev) &&\n@@ -4337,6 +4342,7 @@ static int igc_request_irq(struct igc_adapter *adapter)\n static int __igc_open(struct net_device *netdev, bool resuming)\n {\n \tstruct igc_adapter *adapter = netdev_priv(netdev);\n+\tstruct pci_dev *pdev = adapter->pdev;\n \tstruct igc_hw *hw = &adapter->hw;\n \tint err = 0;\n \tint i = 0;\n@@ -4348,6 +4354,9 @@ static int __igc_open(struct net_device *netdev, bool resuming)\n \t\treturn -EBUSY;\n \t}\n \n+\tif (!resuming)\n+\t\tpm_runtime_get_sync(&pdev->dev);\n+\n \tnetif_carrier_off(netdev);\n \n \t/* allocate transmit descriptors */\n@@ -4386,6 +4395,9 @@ static int __igc_open(struct net_device *netdev, bool resuming)\n \trd32(IGC_ICR);\n \tigc_irq_enable(adapter);\n \n+\tif (!resuming)\n+\t\tpm_runtime_put(&pdev->dev);\n+\n \tnetif_tx_start_all_queues(netdev);\n \n \t/* start the watchdog. */\n@@ -4404,6 +4416,8 @@ static int __igc_open(struct net_device *netdev, bool resuming)\n \tigc_free_all_tx_resources(adapter);\n err_setup_tx:\n \tigc_reset(adapter);\n+\tif (!resuming)\n+\t\tpm_runtime_put(&pdev->dev);\n \n \treturn err;\n }\n@@ -4428,9 +4442,13 @@ static int igc_open(struct net_device *netdev)\n static int __igc_close(struct net_device *netdev, bool suspending)\n {\n \tstruct igc_adapter *adapter = netdev_priv(netdev);\n+\tstruct pci_dev *pdev = adapter->pdev;\n \n \tWARN_ON(test_bit(__IGC_RESETTING, &adapter->state));\n \n+\tif (!suspending)\n+\t\tpm_runtime_get_sync(&pdev->dev);\n+\n \tigc_down(adapter);\n \n \tigc_release_hw_control(adapter);\n@@ -4440,6 +4458,9 @@ static int __igc_close(struct net_device *netdev, bool suspending)\n \tigc_free_all_tx_resources(adapter);\n \tigc_free_all_rx_resources(adapter);\n \n+\tif (!suspending)\n+\t\tpm_runtime_put_sync(&pdev->dev);\n+\n \treturn 0;\n }\n \n@@ -4792,6 +4813,10 @@ static int igc_probe(struct pci_dev *pdev,\n \tpcie_print_link_status(pdev);\n \tnetdev_info(netdev, \"MAC: %pM\\n\", netdev->dev_addr);\n \n+\tdev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_NEVER_SKIP);\n+\n+\tpm_runtime_put_noidle(&pdev->dev);\n+\n \treturn 0;\n \n err_register:\n@@ -4826,6 +4851,8 @@ static void igc_remove(struct pci_dev *pdev)\n \tstruct net_device *netdev = pci_get_drvdata(pdev);\n \tstruct igc_adapter *adapter = netdev_priv(netdev);\n \n+\tpm_runtime_get_noresume(&pdev->dev);\n+\n \tigc_ptp_stop(adapter);\n \n \tset_bit(__IGC_DOWN, &adapter->state);\n",
    "prefixes": [
        "v2"
    ]
}