get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 809975,
    "url": "http://patchwork.ozlabs.org/api/patches/809975/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openbmc/patch/20170905072828.8749-3-andrew@aj.id.au/",
    "project": {
        "id": 56,
        "url": "http://patchwork.ozlabs.org/api/projects/56/?format=api",
        "name": "OpenBMC development",
        "link_name": "openbmc",
        "list_id": "openbmc.lists.ozlabs.org",
        "list_email": "openbmc@lists.ozlabs.org",
        "web_url": "http://github.com/openbmc/",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170905072828.8749-3-andrew@aj.id.au>",
    "list_archive_url": null,
    "date": "2017-09-05T07:28:27",
    "name": "[2/3] hwmon: pmbus: Add set_page() callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "806acf30ed872666f32236edf63553d7ccde1b03",
    "submitter": {
        "id": 68332,
        "url": "http://patchwork.ozlabs.org/api/people/68332/?format=api",
        "name": "Andrew Jeffery",
        "email": "andrew@aj.id.au"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openbmc/patch/20170905072828.8749-3-andrew@aj.id.au/mbox/",
    "series": [
        {
            "id": 1500,
            "url": "http://patchwork.ozlabs.org/api/series/1500/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openbmc/list/?series=1500",
            "date": "2017-09-05T07:28:25",
            "name": "pmbus: Fix error propagation for register check functions",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/1500/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/809975/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/809975/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "openbmc@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "openbmc@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmdf82g7Vz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 17:30:08 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xmdf81RKVzDrKG\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 17:30:08 +1000 (AEST)",
            "from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n\t[66.111.4.25])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xmdd22tL6zDrFq\n\tfor <openbmc@lists.ozlabs.org>; Tue,  5 Sep 2017 17:29:10 +1000 (AEST)",
            "from compute4.internal (compute4.nyi.internal [10.202.2.44])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 4633520C41;\n\tTue,  5 Sep 2017 03:29:08 -0400 (EDT)",
            "from frontend1 ([10.202.2.160])\n\tby compute4.internal (MEProxy); Tue, 05 Sep 2017 03:29:08 -0400",
            "from keelia.au.ibm.com (bh02i525f01.au.ibm.com [202.81.18.30])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id 7D4377FA75;\n\tTue,  5 Sep 2017 03:29:06 -0400 (EDT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"Gwd9Bpca\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"sEoMD3G0\"; \n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"Gwd9Bpca\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"sEoMD3G0\"; \n\tdkim-atps=neutral",
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=aj.id.au\n\t(client-ip=66.111.4.25; helo=out1-smtp.messagingengine.com;\n\tenvelope-from=andrew@aj.id.au; receiver=<UNKNOWN>)",
            "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"Gwd9Bpca\";\n\tdkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com\n\theader.b=\"sEoMD3G0\"; dkim-atps=neutral"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=cc\n\t:date:from:in-reply-to:message-id:references:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=pF7JkI\n\tViaZ9xOsYXarz0N75Pbg+BspjOVEhaZVuG/FE=; b=Gwd9BpcaSprNn0ZXCCWa/H\n\t0cJJlOvYaWUY1/GluOW/sg+ZrCB8DFcbFMOG4l4FfqnSxpXGIG59qxC8I/guTnSD\n\t7yFs4DwRtvr8HjnQ7WT3ZSPkx2GrrSC5KKypsgUpf4R7czN3CaZ9Gm45py72LFJr\n\tt191gVvqZK7AZxWZzV8sc/1fvnjirALQzce0pZJ70HvnKKdXrjCA8OcQ5WztHLMQ\n\tmY5c/HMUMEThYeefGRtqX/bQGTTgejkhiyIeV8zjiumYP5XIs/61l0pxc8zuC41q\n\toWFqFlFqLwuvdg0bzWxv7j/+5+h7n88/oopvJBWvAvkqOwRqcbJDRCucwowgdnCg\n\t==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:date:from:in-reply-to:message-id\n\t:references:subject:to:x-me-sender:x-me-sender:x-sasl-enc\n\t:x-sasl-enc; s=fm1; bh=pF7JkIViaZ9xOsYXarz0N75Pbg+BspjOVEhaZVuG/\n\tFE=; b=sEoMD3G0wiABDToTh3xYAomixCRp8It+CeJtw/0GXMb4SnLhSIIQQA2Yx\n\tgG9y2MyXNI8BfsFsiCLckODo+o0XuvVigYO0qjlhmAPUUGozUa1JnKL1eAVVLoQN\n\t0ruPckbcOgClUtHotXxZdp6uITYYb0/aDa/IYp+yjx1hbUaS3JwFYb9e+yMAqKIT\n\tJro0JfDZCEEp+4Vet7GTxpXZAfxKEdKo5x1r6k8W5PMPqXbSbqZsqfuyMURhkC8V\n\ti5bhpTtDTp7Vh4Y3l2pcwMEVMewAb2n+I1kbNXZXOdixX6qWIR9wkWKsuzAoqi7q\n\tCVACJETKgsGC3o+DjaL4DiFzuXReA=="
        ],
        "X-ME-Sender": "<xms:RFKuWX8VHBuob5dT3d1UsY2NkktEzXewqe1q-5xu8bBfL42WlOD7rA>",
        "X-Sasl-enc": "wBJHzAmvqSzAsusrHAMOiT/oVV5p/dEOg5C2exnZuhig 1504596547",
        "From": "Andrew Jeffery <andrew@aj.id.au>",
        "To": "openbmc@lists.ozlabs.org",
        "Subject": "[PATCH 2/3] hwmon: pmbus: Add set_page() callback",
        "Date": "Tue,  5 Sep 2017 17:28:27 +1000",
        "Message-Id": "<20170905072828.8749-3-andrew@aj.id.au>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170905072828.8749-1-andrew@aj.id.au>",
        "References": "<20170905072828.8749-1-andrew@aj.id.au>",
        "X-BeenThere": "openbmc@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Development list for OpenBMC <openbmc.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/openbmc/>",
        "List-Post": "<mailto:openbmc@lists.ozlabs.org>",
        "List-Help": "<mailto:openbmc-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "Andrew Jeffery <andrew@aj.id.au>",
        "Errors-To": "openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "With the improvement to error reporting in the PMBus core, issuing\nCLEAR_FAULTS now propagates the error up the call chain where in the\npast it was swallowed. This error propagation affects the 'virtual\npages' implemented in the max31785 driver: In some circumstances\npmbus_clear_faults() is issued unconditionally against a device.\npmbus_clear_faults() eventually calls pmbus_set_page(), which may issue\na PAGE command to the device. pmbus_set_page() issues\ni2c_smbus_write_byte_data() directly, not routing through any of the\nexisting write path hooks, leaving the driver with no method to\nintercept it.\n\nAs such, add a callback so we can intercept it.\n\nSigned-off-by: Andrew Jeffery <andrew@aj.id.au>\n---\n drivers/hwmon/pmbus/pmbus.h      |  1 +\n drivers/hwmon/pmbus/pmbus_core.c | 17 ++++++++++++++++-\n 2 files changed, 17 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h\nindex f8d7a7e0dce0..ed15d3b92f76 100644\n--- a/drivers/hwmon/pmbus/pmbus.h\n+++ b/drivers/hwmon/pmbus/pmbus.h\n@@ -394,6 +394,7 @@ struct pmbus_driver_info {\n \t * register does not exist, and that no attempt should be made to read\n \t * the standard register.\n \t */\n+\tint (*set_page)(struct i2c_client *client, int page);\n \tint (*read_byte_data)(struct i2c_client *client, int page, int reg);\n \tint (*read_word_data)(struct i2c_client *client, int page, int reg);\n \tint (*write_word_data)(struct i2c_client *client, int page, int reg,\ndiff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c\nindex b71d214d1510..5411b0af363d 100644\n--- a/drivers/hwmon/pmbus/pmbus_core.c\n+++ b/drivers/hwmon/pmbus/pmbus_core.c\n@@ -158,7 +158,7 @@ void pmbus_clear_cache(struct i2c_client *client)\n }\n EXPORT_SYMBOL_GPL(pmbus_clear_cache);\n \n-int pmbus_set_page(struct i2c_client *client, u8 page)\n+static int _pmbus_set_page(struct i2c_client *client, u8 page)\n {\n \tstruct pmbus_data *data = i2c_get_clientdata(client);\n \tint rv = 0;\n@@ -174,6 +174,21 @@ int pmbus_set_page(struct i2c_client *client, u8 page)\n \t}\n \treturn rv;\n }\n+\n+int pmbus_set_page(struct i2c_client *client, u8 page)\n+{\n+\tstruct pmbus_data *data = i2c_get_clientdata(client);\n+\tconst struct pmbus_driver_info *info = data->info;\n+\tint status;\n+\n+\tif (info->set_page) {\n+\t\tstatus = info->set_page(client, page);\n+\t\tif (status != -ENODATA)\n+\t\t\treturn status;\n+\t}\n+\n+\treturn _pmbus_set_page(client, page);\n+}\n EXPORT_SYMBOL_GPL(pmbus_set_page);\n \n int pmbus_write_byte(struct i2c_client *client, int page, u8 value)\n",
    "prefixes": [
        "2/3"
    ]
}