get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 813639,
    "url": "http://patchwork.ozlabs.org/api/patches/813639/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-3-robdclark@gmail.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170913220546.19560-3-robdclark@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-13T22:05:25",
    "name": "[U-Boot,v3,02/21] part: extract MBR signature from partitions",
    "commit_ref": "ff98cb90514d9b787ddc097c203ac8db2941efe1",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "2e9febb1bac3e1f36446c9da392e37b33e0133f4",
    "submitter": {
        "id": 18760,
        "url": "http://patchwork.ozlabs.org/api/people/18760/?format=api",
        "name": "Rob Clark",
        "email": "robdclark@gmail.com"
    },
    "delegate": {
        "id": 3400,
        "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api",
        "username": "agraf",
        "first_name": "Alexander",
        "last_name": "Graf",
        "email": "agraf@suse.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20170913220546.19560-3-robdclark@gmail.com/mbox/",
    "series": [
        {
            "id": 2990,
            "url": "http://patchwork.ozlabs.org/api/series/2990/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=2990",
            "date": "2017-09-13T22:05:23",
            "name": "efi_loader: enough UEFI for standard distro boot",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/2990/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/813639/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/813639/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"UWmHfWUF\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xswm33MzQz9ryQ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 08:08:35 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 1AFFAC2245A; Wed, 13 Sep 2017 22:06:42 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 4034EC2259B;\n\tWed, 13 Sep 2017 22:06:29 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid EA81FC2256A; Wed, 13 Sep 2017 22:06:01 +0000 (UTC)",
            "from mail-qt0-f195.google.com (mail-qt0-f195.google.com\n\t[209.85.216.195])\n\tby lists.denx.de (Postfix) with ESMTPS id 654EAC222F6\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 22:05:57 +0000 (UTC)",
            "by mail-qt0-f195.google.com with SMTP id f24so942178qte.5\n\tfor <u-boot@lists.denx.de>; Wed, 13 Sep 2017 15:05:57 -0700 (PDT)",
            "from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a])\n\tby smtp.gmail.com with ESMTPSA id\n\te39sm10445954qtb.67.2017.09.13.15.05.54\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 13 Sep 2017 15:05:54 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=bXVPZO0IiYE3zUISsLm4fk0OfB020ozBmqh5YtAiWL4=;\n\tb=UWmHfWUFyUi/AdRNXhVVNwD/LhpnENrwTnhXf99pJ11brofMcwGyJGWJLP+l5lC9fE\n\tZmNBc1XD7Ge1mgPPWwEkjAsGCygzeulNTQvW4jx1i6svexBn8B3RSTNXhmiDrqu9VyCU\n\tFgFU2W0SPnK2qCLxn5UD+nd2/iTtNMh1UpR3WNX7erF2GpiGalV6xqmOzFg/eK/PD2Bc\n\tDcrfk2lU4axYv+PbI8CCBKcax1R9H9B7YNllmS8YQqv3g7saEtna88xFG8eic1ZRs0ak\n\tMr/9WpQvMTprgFnBolvNviQ2z7K60FuMYklPpPQefl5swjrmjmmwjGqIIVi5PMc/Xs+b\n\tu6jg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=bXVPZO0IiYE3zUISsLm4fk0OfB020ozBmqh5YtAiWL4=;\n\tb=Lu1YR6eJAEjCTx9lg2cn2AD3qMaaxc03T9U2mWgcwXe8X+YwVDnF722Ql1489u34Pg\n\tEdP8st/eloiLx9TBP7LBCOoBH9BhYdcmue7KG19IpDhKhmy06lrE0xLV+OgUASqNAgo0\n\tZQWJy3ii4Z5mh8N3g0yEgJzXanmIqe19x5tfVDzdiT8pC9O6+omfp7jMI0fHOjS7m7wP\n\t1uVlYtoY4mSlHmH8GqBDPchZHc0ga2ZABbUdR3Ejpg2Q4znHZ6odma0/vN5uXkaDtGFF\n\t2AH5nwez2YVatY2VW3eKPnj9GUr20jyR9rmwf0RuFHJn6WQ7p2MZeURI01fQr1hGScig\n\tjhug==",
        "X-Gm-Message-State": "AHPjjUg0aSZWhqlN9S4WJIVv2zV3JgvLoDKpJ0SxDdUPsC0phi8yQ4Pv\n\t0gCjO3uNidRpKqxy66Y=",
        "X-Google-Smtp-Source": "AOwi7QAMkBkMWaT9O/2vU2OSlrsql77Q5fgURwfvPay1s37VubMmen5z63JShS2NL/t7+0g3cbCpFA==",
        "X-Received": "by 10.200.37.157 with SMTP id e29mr12160386qte.271.1505340356035;\n\tWed, 13 Sep 2017 15:05:56 -0700 (PDT)",
        "From": "Rob Clark <robdclark@gmail.com>",
        "To": "U-Boot Mailing List <u-boot@lists.denx.de>",
        "Date": "Wed, 13 Sep 2017 18:05:25 -0400",
        "Message-Id": "<20170913220546.19560-3-robdclark@gmail.com>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170913220546.19560-1-robdclark@gmail.com>",
        "References": "<20170913220546.19560-1-robdclark@gmail.com>",
        "Cc": "Petr Kulhavy <brain@jikos.cz>, Heinrich Schuchardt <xypron.glpk@gmx.de>, \n\tWenbin Song <wenbin.song@nxp.com>,\n\tAlison Chaiken <alison@peloton-tech.com>, \n\tPeter Jones <pjones@redhat.com>,\n\tVincent Tinelli <vincent.tinelli@intel.com>, \n\tSteve Rae <steve.rae@raedomain.com>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>",
        "Subject": "[U-Boot] [PATCH v3 02/21] part: extract MBR signature from\n\tpartitions",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "From: Peter Jones <pjones@redhat.com>\n\nEFI client programs need the signature information from the partition\ntable to determine the disk a partition is on, so we need to fill that\nin here.\n\nSigned-off-by: Peter Jones <pjones@redhat.com>\n[separated from efi_loader part, and fixed build-errors for non-\n CONFIG_EFI_PARTITION case]\nSigned-off-by: Rob Clark <robdclark@gmail.com>\n---\n disk/part_dos.c | 12 +++++++++---\n disk/part_efi.c | 20 ++++++++++++++++++++\n include/blk.h   | 18 ++++++++++++++++++\n 3 files changed, 47 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/disk/part_dos.c b/disk/part_dos.c\nindex 7ede15ec26..850a538e83 100644\n--- a/disk/part_dos.c\n+++ b/disk/part_dos.c\n@@ -89,14 +89,20 @@ static int test_block_type(unsigned char *buffer)\n \n static int part_test_dos(struct blk_desc *dev_desc)\n {\n-\tALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);\n+\tALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);\n \n-\tif (blk_dread(dev_desc, 0, 1, (ulong *)buffer) != 1)\n+\tif (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)\n \t\treturn -1;\n \n-\tif (test_block_type(buffer) != DOS_MBR)\n+\tif (test_block_type((unsigned char *)mbr) != DOS_MBR)\n \t\treturn -1;\n \n+\tif (dev_desc->sig_type == SIG_TYPE_NONE &&\n+\t    mbr->unique_mbr_signature != 0) {\n+\t\tdev_desc->sig_type = SIG_TYPE_MBR;\n+\t\tdev_desc->mbr_sig = mbr->unique_mbr_signature;\n+\t}\n+\n \treturn 0;\n }\n \ndiff --git a/disk/part_efi.c b/disk/part_efi.c\nindex 2973d52f6a..208bb14ee8 100644\n--- a/disk/part_efi.c\n+++ b/disk/part_efi.c\n@@ -923,11 +923,19 @@ static int is_pmbr_valid(legacy_mbr * mbr)\n static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,\n \t\t\tgpt_header *pgpt_head, gpt_entry **pgpt_pte)\n {\n+\tALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);\n+\n \tif (!dev_desc || !pgpt_head) {\n \t\tprintf(\"%s: Invalid Argument(s)\\n\", __func__);\n \t\treturn 0;\n \t}\n \n+\t/* Read MBR Header from device */\n+\tif (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) {\n+\t\tprintf(\"*** ERROR: Can't read MBR header ***\\n\");\n+\t\treturn 0;\n+\t}\n+\n \t/* Read GPT Header from device */\n \tif (blk_dread(dev_desc, (lbaint_t)lba, 1, pgpt_head) != 1) {\n \t\tprintf(\"*** ERROR: Can't read GPT header ***\\n\");\n@@ -937,6 +945,18 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,\n \tif (validate_gpt_header(pgpt_head, (lbaint_t)lba, dev_desc->lba))\n \t\treturn 0;\n \n+\tif (dev_desc->sig_type == SIG_TYPE_NONE) {\n+\t\tefi_guid_t empty = {};\n+\t\tif (memcmp(&pgpt_head->disk_guid, &empty, sizeof(empty))) {\n+\t\t\tdev_desc->sig_type = SIG_TYPE_GUID;\n+\t\t\tmemcpy(&dev_desc->guid_sig, &pgpt_head->disk_guid,\n+\t\t\t      sizeof(empty));\n+\t\t} else if (mbr->unique_mbr_signature != 0) {\n+\t\t\tdev_desc->sig_type = SIG_TYPE_MBR;\n+\t\t\tdev_desc->mbr_sig = mbr->unique_mbr_signature;\n+\t\t}\n+\t}\n+\n \t/* Read and allocate Partition Table Entries */\n \t*pgpt_pte = alloc_read_gpt_entries(dev_desc, pgpt_head);\n \tif (*pgpt_pte == NULL) {\ndiff --git a/include/blk.h b/include/blk.h\nindex 1965812a9d..41b4d7efa8 100644\n--- a/include/blk.h\n+++ b/include/blk.h\n@@ -8,6 +8,8 @@\n #ifndef BLK_H\n #define BLK_H\n \n+#include <efi.h>\n+\n #ifdef CONFIG_SYS_64BIT_LBA\n typedef uint64_t lbaint_t;\n #define LBAFlength \"ll\"\n@@ -41,6 +43,17 @@ enum if_type {\n #define BLK_REV_SIZE\t\t8\n \n /*\n+ * Identifies the partition table type (ie. MBR vs GPT GUID) signature\n+ */\n+enum sig_type {\n+\tSIG_TYPE_NONE,\n+\tSIG_TYPE_MBR,\n+\tSIG_TYPE_GUID,\n+\n+\tSIG_TYPE_COUNT\t\t\t/* Number of signature types */\n+};\n+\n+/*\n  * With driver model (CONFIG_BLK) this is uclass platform data, accessible\n  * with dev_get_uclass_platdata(dev)\n  */\n@@ -67,6 +80,11 @@ struct blk_desc {\n \tchar\t\tvendor[BLK_VEN_SIZE + 1]; /* device vendor string */\n \tchar\t\tproduct[BLK_PRD_SIZE + 1]; /* device product number */\n \tchar\t\trevision[BLK_REV_SIZE + 1]; /* firmware revision */\n+\tenum sig_type\tsig_type;\t/* Partition table signature type */\n+\tunion {\n+\t\tuint32_t mbr_sig;\t/* MBR integer signature */\n+\t\tefi_guid_t guid_sig;\t/* GPT GUID Signature */\n+\t};\n #if CONFIG_IS_ENABLED(BLK)\n \t/*\n \t * For now we have a few functions which take struct blk_desc as a\n",
    "prefixes": [
        "U-Boot",
        "v3",
        "02/21"
    ]
}