get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1662594,
    "url": "http://patchwork.ozlabs.org/api/patches/1662594/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20220801133146.11481-2-pali@kernel.org/",
    "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": "<20220801133146.11481-2-pali@kernel.org>",
    "list_archive_url": null,
    "date": "2022-08-01T13:31:44",
    "name": "[v2,2/4] board: freescale: p1_p2_rdb_pc: Add workaround for non-working watchdog",
    "commit_ref": "27b2bff6eb18dfb5ba58f68b79fdc57d72c6d2a3",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "5029ba716c84ce1d625c3aa73194924c62d1d496",
    "submitter": {
        "id": 78810,
        "url": "http://patchwork.ozlabs.org/api/people/78810/?format=api",
        "name": "Pali Rohár",
        "email": "pali@kernel.org"
    },
    "delegate": {
        "id": 111897,
        "url": "http://patchwork.ozlabs.org/api/users/111897/?format=api",
        "username": "kabel",
        "first_name": "Marek",
        "last_name": "Behun",
        "email": "marek.behun@nic.cz"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20220801133146.11481-2-pali@kernel.org/mbox/",
    "series": [
        {
            "id": 312107,
            "url": "http://patchwork.ozlabs.org/api/series/312107/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=312107",
            "date": "2022-08-01T13:31:44",
            "name": "[v2,1/4] board: freescale: p1_p2_rdb_pc: Add workaround for board reset reboot loop",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/312107/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1662594/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1662594/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": [
            "bilbo.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=BNsDYsIO;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.b=\"BNsDYsIO\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=kernel.org",
            "phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits))\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4LxJvK0W1Nz9sCD\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  1 Aug 2022 23:32:12 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id C2F8684005;\n\tMon,  1 Aug 2022 15:32:07 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id DED1783E4C; Mon,  1 Aug 2022 15:32:06 +0200 (CEST)",
            "from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n bits)) (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 6B3B383E4C\n for <u-boot@lists.denx.de>; Mon,  1 Aug 2022 15:32:04 +0200 (CEST)",
            "from smtp.kernel.org (relay.kernel.org [52.25.139.140])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by dfw.source.kernel.org (Postfix) with ESMTPS id F06BD612D4;\n Mon,  1 Aug 2022 13:32:02 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id 3A3A2C433C1;\n Mon,  1 Aug 2022 13:32:02 +0000 (UTC)",
            "by pali.im (Postfix)\n id C56E8CD7; Mon,  1 Aug 2022 15:31:59 +0200 (CEST)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,\n SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1659360722;\n bh=jJ1v56NFKxE7wJodq42lr2P8TOUu54ckonvb2gwZoyo=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=BNsDYsIOrWEi4khSwO1+fwi9LbutYnVLom/p31mhSGf9JKpIJRkRLEC/R+KZxiYiL\n dP9iEv+o9yb5Yrx3EwC5F0XMivBGxJTgXi0jq9Q7LYwYW8rwTFCsPdfeJVmFN7aOec\n 09VfMQpKKRaWEn1Xf3ctFOlBHZBcDao/SKfv0yX+7vJvW5pCzfP+Cb9MLVUxqisBdh\n EZYNjFS49MbpjtCnXJJRKDC2uoXcXcyGymC+6g/cSp82JDXNghQrJs+YSyLohiz8XT\n ATlfoOD2N3mvX8fhZXuNjgIJG4zkXEWi2GOyGe3dX0QLDRnOYV/xzho1B6Vq3Nehvb\n A5tjWalSYKhJA==",
        "From": "=?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>",
        "To": "\"Peng Fan (OSS)\" <peng.fan@oss.nxp.com>",
        "Cc": "Tom Rini <trini@konsulko.com>,\n\tu-boot@lists.denx.de",
        "Subject": "[PATCH v2 2/4] board: freescale: p1_p2_rdb_pc: Add workaround for\n non-working watchdog",
        "Date": "Mon,  1 Aug 2022 15:31:44 +0200",
        "Message-Id": "<20220801133146.11481-2-pali@kernel.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20220801133146.11481-1-pali@kernel.org>",
        "References": "<20220501122314.32626-1-pali@kernel.org>\n <20220801133146.11481-1-pali@kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://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 <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.6 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "If watchdog timer was already set to non-disabled value then it means that\nwatchdog timer was already activated, has already expired and caused CPU\nreset. If this happened then due to CPLD firmware bug, writing to wd_cfg\nregister has no effect and therefore it is not possible to reactivate\nwatchdog timer again. Watchdog starts working again after CPU reset via\nnon-watchdog method.\n\nImplement this workaround (reset CPU when it was reset by watchdog) to make\nwatchdog usable again. Watchdog timer logic on these P1/P2 RDB boards is\nconnected to CPLD, not to SoC itself.\n\nNote that reset does not occur immediately after calling do_reset(), but\nafter few ms later as real reset is done by CPLD. So it is normal that\nfunction do_reset() returns. Therefore hangs after calling do_reset() to\nprevent CPU execution of the rest U-Boot code.\n\nSigned-off-by: Pali Rohár <pali@kernel.org>\n---\nChanges in v2:\n* Call eieio() before do_reset() to ensure that all IO operations completes\n* Hang after calling do_reset() as reset does not occur immediately.\n---\n board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 21 +++++++++++++++++++++\n 1 file changed, 21 insertions(+)",
    "diff": "diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c\nindex 84e1d65cdb1f..16224752adb1 100644\n--- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c\n+++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c\n@@ -92,6 +92,7 @@ void board_reset(void)\n void board_cpld_init(void)\n {\n \tstruct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);\n+\tu8 prev_wd_cfg = in_8(&cpld_data->wd_cfg);\n \n \tout_8(&cpld_data->wd_cfg, CPLD_WD_CFG);\n \tout_8(&cpld_data->status_led, CPLD_STATUS_LED);\n@@ -111,6 +112,26 @@ void board_cpld_init(void)\n \t * and it has to be done in 100ms since the last start of reset.\n \t */\n \tout_8(&cpld_data->system_rst, CPLD_SYS_RST);\n+\n+\t/*\n+\t * If watchdog timer was already set to non-disabled value then it means\n+\t * that watchdog timer was already activated, has already expired and\n+\t * caused CPU reset. If this happened then due to CPLD firmware bug,\n+\t * writing to wd_cfg register has no effect and therefore it is not\n+\t * possible to reactivate watchdog timer again. Also if CPU was reset\n+\t * via watchdog then some peripherals like i2c do not work. Watchdog and\n+\t * i2c start working again after CPU reset via non-watchdog method.\n+\t *\n+\t * So in case watchdog timer register in CPLD was already enabled then\n+\t * disable it in CPLD and reset CPU which cause new boot. Watchdog timer\n+\t * is disabled few lines above, after reading CPLD previous value.\n+\t * This logic (disabling timer before reset) prevents reboot loop.\n+\t */\n+\tif (prev_wd_cfg != CPLD_WD_CFG) {\n+\t\teieio();\n+\t\tdo_reset(NULL, 0, 0, NULL);\n+\t\twhile (1); /* do_reset() does not occur immediately */\n+\t}\n }\n \n void board_gpio_init(void)\n",
    "prefixes": [
        "v2",
        "2/4"
    ]
}