get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 819045,
    "url": "http://patchwork.ozlabs.org/api/patches/819045/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170927083555.16580-5-romain.izard.pro@gmail.com/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170927083555.16580-5-romain.izard.pro@gmail.com>",
    "list_archive_url": null,
    "date": "2017-09-27T08:35:51",
    "name": "[v3,4/8] mtd: nand: atmel: Avoid ECC errors when leaving backup mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "69c0145aba6342a154e8dcfa7654629cd7cc2ca6",
    "submitter": {
        "id": 8236,
        "url": "http://patchwork.ozlabs.org/api/people/8236/?format=api",
        "name": "Romain Izard",
        "email": "romain.izard.pro@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20170927083555.16580-5-romain.izard.pro@gmail.com/mbox/",
    "series": [
        {
            "id": 5311,
            "url": "http://patchwork.ozlabs.org/api/series/5311/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=5311",
            "date": "2017-09-27T08:35:49",
            "name": "Various patches for SAMA5D2 backup mode",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/5311/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/819045/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/819045/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"gel5tOUr\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"jbfL4Wdp\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.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 3y2B6S00yCz9t3x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 18:38:07 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dx7qt-0004GM-NY; Wed, 27 Sep 2017 08:37:55 +0000",
            "from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dx7pd-0002kg-Tf\n\tfor linux-mtd@lists.infradead.org; Wed, 27 Sep 2017 08:36:48 +0000",
            "by mail-wm0-x241.google.com with SMTP id m72so15481667wmc.1\n\tfor <linux-mtd@lists.infradead.org>;\n\tWed, 27 Sep 2017 01:36:17 -0700 (PDT)",
            "from localhost.localdomain (146.187.3.109.rev.sfr.net.\n\t[109.3.187.146]) by smtp.gmail.com with ESMTPSA id\n\tr6sm9699900wrg.40.2017.09.27.01.36.14\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 27 Sep 2017 01:36:15 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References:\n\tIn-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=J9HaVX40zZZj1QQnN7jog1/FJngBmYyHup3wxrL5mvY=;\n\tb=gel5tOUr9XHCJYclZjORv6Pv08\n\ty3BohgN3b/7Whow0CwbVZjRPwdYZ6zaarO+l9q8PimrwCWG6SKIO/yAVcYAkq/Iw5te+p6wlrYdRS\n\tosADXfx27+vOREvnV+Np4D521hrMA2avnC9BQrmZkYu0agKl+Wp4z3EMfU73n86Y27bsrUt1nU0tQ\n\txKIGkUHiQA8/Td+JlzHanXua5bbYxxKistfXM+dSz4k9tttPiYcqWV8bUmQ+EdauFt707slhv8Ub0\n\tmtEnqvdL4Lbbv4xFSo0WXamzH6trKqHCQP/f+QpgxIqpbeiY0NlDq+gn9Nh7B4YSdIfEjVR8eO1cj\n\tFvH4JPUA==;",
            "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=YbTyumyy6P4kge3veVl/A0z9dzATwB6TcaPmHuC1BkA=;\n\tb=jbfL4WdpgAFTGIUHTMUkozrT8YPYvH/Qe3M/a3Z1dN3sK3+xHrTKrq1L+GrmSWLvEz\n\tIEQ/6/+PQFd3yvhgfCLGF/CMXzebyu+kmOH7AjhZ252ReTObm0W8XnJusQbzpJwFZceK\n\tjWVRYuoXPb7F2MnBEIrJD1p0FfRjDaqUWEdPBiFK83vlydVVnh4R94e9klHsbB2n+TZW\n\tOaiN+0be9kWZuaRTz5HEdnqMcxpapFAqWeTl8JWbqzWLO9IHakXvH9vJEVFowoa3f4IR\n\tXUvT89QoKjeMa/kFSevm66QOsXZ9yfk6pLQTw77vCO4Y4C8sRqMLdcXU3EDFoKxoKV25\n\tIJPw=="
        ],
        "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=YbTyumyy6P4kge3veVl/A0z9dzATwB6TcaPmHuC1BkA=;\n\tb=jqKFMtOkLQhdx2B2xH0YHimFk/U/Pb2k3gKX609twHUGjsO0vaM8ECsWmbniW0aPZd\n\taHjiHeM7x6uvqm0+X/x+dac8GjL4DAagsfpMcnJilHDh9XZhg1JsHOCWRCjSf2nFmCh2\n\tRXpiYRyIo1NoLQleLFqh6OpZgXCb5I8q6hWvzp0Qoq4po+yWtNmuklqym9QbWQBozf+1\n\tD2Pt7OUIQpSm2sDfpz0N4QZQP8B4bL2IaCselSlFuPyOj2rWTkchW56TcJ2sH4KfO7Dy\n\tB8K8Bv4ONvvv/resdoiL0BbTdWvfj0q8DYWJ1S++E0jNw3OhfctY7JvWnXwezBlyI+K9\n\taf7g==",
        "X-Gm-Message-State": "AHPjjUjb6V8U14eAytmQqAx26pgGqocZxNxCO5KrXZy4lonA/y5k3TFw\n\tk0mBXkHijKfUkpuP97hD+6E=",
        "X-Google-Smtp-Source": "AOwi7QCDvaTM95g9jizq059H+Q/H/WJwHn5cqLxwodS6V9OvQfJiuMBrYNYZfbKgx8so/m+IqdnIRw==",
        "X-Received": "by 10.28.140.18 with SMTP id o18mr863571wmd.145.1506501376157;\n\tWed, 27 Sep 2017 01:36:16 -0700 (PDT)",
        "From": "Romain Izard <romain.izard.pro@gmail.com>",
        "To": "Boris Brezillon <boris.brezillon@free-electrons.com>,\n\tMichael Turquette <mturquette@baylibre.com>,\n\tStephen Boyd <sboyd@codeaurora.org>, Lee Jones <lee.jones@linaro.org>,\n\tWenyou Yang <wenyou.yang@atmel.com>, Josh Wu <rainyfeeling@outlook.com>, \n\tRichard Weinberger <richard@nod.at>,\n\tDavid Woodhouse <dwmw2@infradead.org>, \n\tBrian Norris <computersforpeace@gmail.com>,\n\tMarek Vasut <marek.vasut@gmail.com>,\n\tCyrille Pitchen <cyrille.pitchen@wedev4u.fr>,\n\tThierry Reding <thierry.reding@gmail.com>,\n\tRichard Genoud <richard.genoud@gmail.com>,\n\tGreg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tJiri Slaby <jslaby@suse.com>, Alan Stern <stern@rowland.harvard.edu>, \n\tLudovic Desroches <ludovic.desroches@microchip.com>,\n\tNicolas Ferre <nicolas.ferre@microchip.com>,\n\tAlexandre Belloni <alexandre.belloni@free-electrons.com>",
        "Subject": "[PATCH v3 4/8] mtd: nand: atmel: Avoid ECC errors when leaving\n\tbackup mode",
        "Date": "Wed, 27 Sep 2017 10:35:51 +0200",
        "Message-Id": "<20170927083555.16580-5-romain.izard.pro@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170927083555.16580-1-romain.izard.pro@gmail.com>",
        "References": "<20170927083555.16580-1-romain.izard.pro@gmail.com>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170927_013638_423684_762CAEB4 ",
        "X-CRM114-Status": "GOOD (  15.56  )",
        "X-Spam-Score": "-2.0 (--)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a00:1450:400c:c09:0:0:0:241 listed in] [list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (romain.izard.pro[at]gmail.com)\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Cc": "linux-pwm@vger.kernel.org, linux-usb@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,\n\tlinux-serial@vger.kernel.org, Romain Izard <romain.izard.pro@gmail.com>, \n\tlinux-clk@vger.kernel.org",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "During backup mode, the contents of all registers will be cleared as the\nSoC will be completely powered down. For a product that boots on NAND\nFlash memory, the bootloader will obviously use the related controller\nto read the Flash and correct any detected error in the memory, before\nhandling back control to the kernel's resuming entry point.\n\nBut it does not clean the NAND controller registers after use and on its\nside the kernel driver expects the error locator to be powered down and\nin a clean state. Add a resume hook for the PMECC error locator, and\nreset its registers.\n\nSigned-off-by: Romain Izard <romain.izard.pro@gmail.com>\n---\nChange in v3:\n* keep the PMECC disabled when not in use, and use atmel_pmecc_resume to\n  reset the controller after the bootloader has left it enabled.\n\n drivers/mtd/nand/atmel/nand-controller.c |  3 +++\n drivers/mtd/nand/atmel/pmecc.c           | 22 ++++++++++++++--------\n drivers/mtd/nand/atmel/pmecc.h           |  1 +\n 3 files changed, 18 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c\nindex f25eca79f4e5..86c2199380c2 100644\n--- a/drivers/mtd/nand/atmel/nand-controller.c\n+++ b/drivers/mtd/nand/atmel/nand-controller.c\n@@ -2530,6 +2530,9 @@ static __maybe_unused int atmel_nand_controller_resume(struct device *dev)\n \tstruct atmel_nand_controller *nc = dev_get_drvdata(dev);\n \tstruct atmel_nand *nand;\n \n+\tif (nand->pmecc)\n+\t\tatmel_pmecc_resume(nand->pmecc);\n+\n \tlist_for_each_entry(nand, &nc->chips, node) {\n \t\tint i;\n \ndiff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c\nindex 146af8218314..ff09c0f25dd4 100644\n--- a/drivers/mtd/nand/atmel/pmecc.c\n+++ b/drivers/mtd/nand/atmel/pmecc.c\n@@ -765,6 +765,12 @@ void atmel_pmecc_get_generated_eccbytes(struct atmel_pmecc_user *user,\n }\n EXPORT_SYMBOL_GPL(atmel_pmecc_get_generated_eccbytes);\n \n+void atmel_pmecc_reset(struct atmel_pmecc *pmecc)\n+{\n+\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n+\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n+}\n+\n int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op)\n {\n \tstruct atmel_pmecc *pmecc = user->pmecc;\n@@ -797,14 +803,17 @@ EXPORT_SYMBOL_GPL(atmel_pmecc_enable);\n \n void atmel_pmecc_disable(struct atmel_pmecc_user *user)\n {\n-\tstruct atmel_pmecc *pmecc = user->pmecc;\n-\n-\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n-\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n+\tatmel_pmecc_reset(user->pmecc);\n \tmutex_unlock(&user->pmecc->lock);\n }\n EXPORT_SYMBOL_GPL(atmel_pmecc_disable);\n \n+void atmel_pmecc_resume(struct atmel_pmecc_user *user)\n+{\n+\tatmel_pmecc_reset(user->pmecc);\n+}\n+EXPORT_SYMBOL_GPL(atmel_pmecc_resume);\n+\n int atmel_pmecc_wait_rdy(struct atmel_pmecc_user *user)\n {\n \tstruct atmel_pmecc *pmecc = user->pmecc;\n@@ -855,10 +864,7 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,\n \n \t/* Disable all interrupts before registering the PMECC handler. */\n \twritel(0xffffffff, pmecc->regs.base + ATMEL_PMECC_IDR);\n-\n-\t/* Reset the ECC engine */\n-\twritel(PMECC_CTRL_RST, pmecc->regs.base + ATMEL_PMECC_CTRL);\n-\twritel(PMECC_CTRL_DISABLE, pmecc->regs.base + ATMEL_PMECC_CTRL);\n+\tatmel_pmecc_reset(pmecc);\n \n \treturn pmecc;\n }\ndiff --git a/drivers/mtd/nand/atmel/pmecc.h b/drivers/mtd/nand/atmel/pmecc.h\nindex a8ddbfca2ea5..488a90f1965d 100644\n--- a/drivers/mtd/nand/atmel/pmecc.h\n+++ b/drivers/mtd/nand/atmel/pmecc.h\n@@ -63,6 +63,7 @@ void atmel_pmecc_destroy_user(struct atmel_pmecc_user *user);\n \n int atmel_pmecc_enable(struct atmel_pmecc_user *user, int op);\n void atmel_pmecc_disable(struct atmel_pmecc_user *user);\n+void atmel_pmecc_resume(struct atmel_pmecc_user *user);\n int atmel_pmecc_wait_rdy(struct atmel_pmecc_user *user);\n int atmel_pmecc_correct_sector(struct atmel_pmecc_user *user, int sector,\n \t\t\t       void *data, void *ecc);\n",
    "prefixes": [
        "v3",
        "4/8"
    ]
}