get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 670161,
    "url": "http://patchwork.ozlabs.org/api/patches/670161/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1473895479-23035-7-git-send-email-bimmy.pujari@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": "<1473895479-23035-7-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2016-09-14T23:24:36",
    "name": "[next,S47,6/9] i40e: reopen client after reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "775c375b9fb428f0f9d9927704fbe986d13afd74",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@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/1473895479-23035-7-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/670161/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/670161/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.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"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3sZHhj5jG8z9s9N\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 15 Sep 2016 09:25:25 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DB402869C5;\n\tWed, 14 Sep 2016 23:25:23 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id at3pONwrcPg6; Wed, 14 Sep 2016 23:25:21 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 7D63E88BD8;\n\tWed, 14 Sep 2016 23:25:20 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id C20291C1F19\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 14 Sep 2016 23:25:15 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C00928BD8E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 14 Sep 2016 23:25:15 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id WuWCTe6q-KTq for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 14 Sep 2016 23:25:13 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 6ADC18BE11\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 14 Sep 2016 23:25:13 +0000 (UTC)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga102.jf.intel.com with ESMTP; 14 Sep 2016 16:25:12 -0700",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.177])\n\tby fmsmga006.fm.intel.com with ESMTP; 14 Sep 2016 16:25:12 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.30,336,1470726000\"; d=\"scan'208\";a=\"8507718\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 14 Sep 2016 16:24:36 -0700",
        "Message-Id": "<1473895479-23035-7-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1473895479-23035-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1473895479-23035-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S47 6/9] i40e: reopen client after\n\treset",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.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@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "From: Mitch Williams <mitch.a.williams@intel.com>\n\nAllow the client interface to reopen existing clients if they were\nclosed. This allows clients to recover from reset, which is essential\nfor supporting VF RDMA. In one instance, the driver was not clearing the\nopen bit when the client was closed. Add the code to clear this bit so\nthat the state is accurate and the driver will not attempt to reopen\nalready-open clients. Remove the ref_cnt variable; it was just getting\nin the way and was not being used consistently.\n\nSigned-off-by: Mitch Williams <mitch.a.williams@intel.com>\nChange-ID: Ic71af4553b096963ac0c56a997f887c9a4ed162d\n---\nTesting Hints : enable VF RDMA\n\n drivers/net/ethernet/intel/i40e/i40e_client.c | 47 ++++++++++-----------------\n drivers/net/ethernet/intel/i40e/i40e_client.h |  2 --\n 2 files changed, 17 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c\nindex 417ac16..7fe72ab 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c\n@@ -287,6 +287,7 @@ void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset)\n \t\t\t}\n \t\t\tcdev->client->ops->close(&cdev->lan_info, cdev->client,\n \t\t\t\t\t\t reset);\n+\t\t\tclear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n \t\t\ti40e_client_release_qvlist(&cdev->lan_info);\n \t\t}\n \t}\n@@ -544,28 +545,27 @@ void i40e_client_subtask(struct i40e_pf *pf)\n \t\t\tcontinue;\n \n \t\tif (!existing) {\n-\t\t\t/* Also up the ref_cnt for no. of instances of this\n-\t\t\t * client.\n-\t\t\t */\n-\t\t\tatomic_inc(&client->ref_cnt);\n \t\t\tdev_info(&pf->pdev->dev, \"Added instance of Client %s to PF%d bus=0x%02x func=0x%02x\\n\",\n \t\t\t\t client->name, pf->hw.pf_id,\n \t\t\t\t pf->hw.bus.device, pf->hw.bus.func);\n-\t\t\tmutex_lock(&i40e_client_instance_mutex);\n-\t\t\tatomic_inc(&cdev->ref_cnt);\n+\t\t}\n+\n+\t\tmutex_lock(&i40e_client_instance_mutex);\n+\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n+\t\t\t      &cdev->state)) {\n+\t\t\t/* Send an Open request to the client */\n \t\t\tif (client->ops && client->ops->open)\n \t\t\t\tret = client->ops->open(&cdev->lan_info,\n \t\t\t\t\t\t\tclient);\n-\t\t\tatomic_dec(&cdev->ref_cnt);\n-\t\t\tif (ret < 0) {\n-\t\t\t\tmutex_unlock(&i40e_client_instance_mutex);\n+\t\t\tif (!ret) {\n+\t\t\t\tset_bit(__I40E_CLIENT_INSTANCE_OPENED,\n+\t\t\t\t\t&cdev->state);\n+\t\t\t} else {\n+\t\t\t\t/* remove client instance */\n \t\t\t\ti40e_client_del_instance(pf, client);\n-\t\t\t\tatomic_dec(&client->ref_cnt);\n-\t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tset_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n-\t\t\tmutex_unlock(&i40e_client_instance_mutex);\n \t\t}\n+\t\tmutex_unlock(&i40e_client_instance_mutex);\n \t}\n \tmutex_unlock(&i40e_client_mutex);\n }\n@@ -660,10 +660,6 @@ static int i40e_client_release(struct i40e_client *client)\n \t\t\tcontinue;\n \t\tpf = (struct i40e_pf *)cdev->lan_info.pf;\n \t\tif (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {\n-\t\t\tif (atomic_read(&cdev->ref_cnt) > 0) {\n-\t\t\t\tret = I40E_ERR_NOT_READY;\n-\t\t\t\tgoto out;\n-\t\t\t}\n \t\t\tif (client->ops && client->ops->close)\n \t\t\t\tclient->ops->close(&cdev->lan_info, client,\n \t\t\t\t\t\t   false);\n@@ -676,11 +672,9 @@ static int i40e_client_release(struct i40e_client *client)\n \t\t}\n \t\t/* delete the client instance from the list */\n \t\tlist_move(&cdev->list, &cdevs_tmp);\n-\t\tatomic_dec(&client->ref_cnt);\n \t\tdev_info(&pf->pdev->dev, \"Deleted client instance of Client %s\\n\",\n \t\t\t client->name);\n \t}\n-out:\n \tmutex_unlock(&i40e_client_instance_mutex);\n \n \t/* free the client device and release its vsi */\n@@ -1006,17 +1000,10 @@ int i40e_unregister_client(struct i40e_client *client)\n \t\tret = -ENODEV;\n \t\tgoto out;\n \t}\n-\tif (atomic_read(&client->ref_cnt) == 0) {\n-\t\tclear_bit(__I40E_CLIENT_REGISTERED, &client->state);\n-\t\tlist_del(&client->list);\n-\t\tpr_info(\"i40e: Unregistered client %s with return code %d\\n\",\n-\t\t\tclient->name, ret);\n-\t} else {\n-\t\tret = I40E_ERR_NOT_READY;\n-\t\tpr_err(\"i40e: Client %s failed unregister - client has open instances\\n\",\n-\t\t       client->name);\n-\t}\n-\n+\tclear_bit(__I40E_CLIENT_REGISTERED, &client->state);\n+\tlist_del(&client->list);\n+\tpr_info(\"i40e: Unregistered client %s with return code %d\\n\",\n+\t\tclient->name, ret);\n out:\n \tmutex_unlock(&i40e_client_mutex);\n \treturn ret;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h\nindex 38a6c36..528bd79 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.h\n@@ -203,8 +203,6 @@ struct i40e_client_instance {\n \tstruct i40e_info lan_info;\n \tstruct i40e_client *client;\n \tunsigned long  state;\n-\t/* A count of all the in-progress calls to the client */\n-\tatomic_t ref_cnt;\n };\n \n struct i40e_client {\n",
    "prefixes": [
        "next",
        "S47",
        "6/9"
    ]
}