Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217010/?format=api
{ "id": 2217010, "url": "http://patchwork.ozlabs.org/api/patches/2217010/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260327140508.3680105-3-richard.genoud@bootlin.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": "<20260327140508.3680105-3-richard.genoud@bootlin.com>", "list_archive_url": null, "date": "2026-03-27T14:05:05", "name": "[v2,2/5] mtd: rawnand: sunxi: make the code mode self-explanatory", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "60afb63083b7038ccc559e22d5c7e2df1bc8c48c", "submitter": { "id": 88519, "url": "http://patchwork.ozlabs.org/api/people/88519/?format=api", "name": "Richard Genoud", "email": "richard.genoud@bootlin.com" }, "delegate": { "id": 114289, "url": "http://patchwork.ozlabs.org/api/users/114289/?format=api", "username": "apritzel", "first_name": "Andre", "last_name": "Przywara", "email": "andre.przywara@arm.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260327140508.3680105-3-richard.genoud@bootlin.com/mbox/", "series": [ { "id": 497775, "url": "http://patchwork.ozlabs.org/api/series/497775/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=497775", "date": "2026-03-27T14:05:03", "name": "mtd: rawnand: sunxi: Fix user data length for H6", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/497775/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217010/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217010/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256\n header.s=dkim header.b=ikpyIbwE;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "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=bootlin.com header.i=@bootlin.com header.b=\"ikpyIbwE\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=bootlin.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=richard.genoud@bootlin.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fj2VZ3Rhjz1y1P\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 01:05:58 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id EFED183E7A;\n\tFri, 27 Mar 2026 15:05:39 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id DFE8083FE9; Fri, 27 Mar 2026 15:05:37 +0100 (CET)", "from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id DA8908394E\n for <u-boot@lists.denx.de>; Fri, 27 Mar 2026 15:05:35 +0100 (CET)", "from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233])\n by smtpout-02.galae.net (Postfix) with ESMTPS id 7555C1A3023;\n Fri, 27 Mar 2026 14:05:35 +0000 (UTC)", "from mail.galae.net (mail.galae.net [212.83.136.155])\n by smtpout-01.galae.net (Postfix) with ESMTPS id 4B6B060230;\n Fri, 27 Mar 2026 14:05:35 +0000 (UTC)", "from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)\n with ESMTPSA id 8084210451293; Fri, 27 Mar 2026 15:05:33 +0100 (CET)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim;\n t=1774620334; h=from:subject:date:message-id:to:cc:mime-version:\n content-transfer-encoding:in-reply-to:references;\n bh=d0HDTQLtWj6oXQIGyZ/8udQ/OdPfsb4WsCXMrBzuxeo=;\n b=ikpyIbwEVDa3BkamIByt5CzMeB5QTWqyRKQbjc1ZVHS/eHIZuU2F9Cl2qu0QNbYbCqWpsP\n /VbT1CIC8KDd+XGOFW91nLOQ4nKNVGqP7F3Z4abPBpL6Af3RwwPp66CmKXr56gxu6xAeWU\n q3RDc6HA+4kKNgKGk6dPS7pNt0brHOyTzZBlzBmuPRheL/Hs0QVi2QDXAg4S1RFawki0EA\n 3Rm7nt5qxUtFQWcNJQiTDD/yVsIQuPEyvm/6rkrlBYLMSCFgxuXqCFcEA/z9pzLcX+bRlE\n Ev+RI4zeS3WXRht4XMZzKEsENbvZYVDykIlZB9wC0u4XaCdnWx3Q7YddNAX1FA==", "From": "Richard Genoud <richard.genoud@bootlin.com>", "To": "Dario Binacchi <dario.binacchi@amarulasolutions.com>,\n Michael Trimarchi <michael@amarulasolutions.com>,\n Tom Rini <trini@konsulko.com>, Andre Przywara <andre.przywara@arm.com>", "Cc": "Andrew Goodbody <andrew.goodbody@linaro.org>,\n Miquel Raynal <miquel.raynal@bootlin.com>,\n James Hilliard <james.hilliard1@gmail.com>,\n Boris Brezillon <bbrezillon@kernel.org>,\n Thomas Petazzoni <thomas.petazzoni@bootlin.com>, u-boot@lists.denx.de,\n Richard Genoud <richard.genoud@bootlin.com>", "Subject": "[PATCH v2 2/5] mtd: rawnand: sunxi: make the code mode\n self-explanatory", "Date": "Fri, 27 Mar 2026 15:05:05 +0100", "Message-ID": "<20260327140508.3680105-3-richard.genoud@bootlin.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260327140508.3680105-1-richard.genoud@bootlin.com>", "References": "<20260327140508.3680105-1-richard.genoud@bootlin.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Last-TLS-Session-Version": "TLSv1.3", "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.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "In sunxi_nfc_hw_ecc_{read,write}_chunk(), the ECC step was force to 0,\nthe reason is not trivial to get when reading the code.\n\nThe explanation is that, from the NAND flash controller perspective, we\nare indeed at step 0 for user data length and ECC errors.\n\nJust add a const value with an explanation to clarify things.\n\nSigned-off-by: Richard Genoud <richard.genoud@bootlin.com>\n---\n drivers/mtd/nand/raw/sunxi_nand.c | 20 ++++++++++++--------\n drivers/mtd/nand/raw/sunxi_nand_spl.c | 6 ++++--\n 2 files changed, 16 insertions(+), 10 deletions(-)", "diff": "diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c\nindex 91f7da2c5ce5..9fc9bc5e0198 100644\n--- a/drivers/mtd/nand/raw/sunxi_nand.c\n+++ b/drivers/mtd/nand/raw/sunxi_nand.c\n@@ -758,6 +758,8 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,\n \tu32 status;\n \tu32 pattern_found;\n \tint ret;\n+\t/* From the controller point of view, we are at step 0 */\n+\tconst int nfc_step = 0;\n \n \tif (*cur_off != data_off)\n \t\tnand->cmdfunc(mtd, NAND_CMD_RNDOUT, data_off, -1);\n@@ -772,7 +774,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,\n \t\treturn ret;\n \n \tsunxi_nfc_reset_user_data_len(nfc);\n-\tsunxi_nfc_set_user_data_len(nfc, USER_DATA_SZ, 0);\n+\tsunxi_nfc_set_user_data_len(nfc, USER_DATA_SZ, nfc_step);\n \n \tsunxi_nfc_randomizer_enable(mtd);\n \twritel(NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD | NFC_ECC_OP,\n@@ -787,7 +789,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,\n \n \tpattern_found = readl(nfc->regs + nfc->caps->reg_pat_found);\n \tpattern_found = field_get(NFC_ECC_PAT_FOUND_MSK(nfc), pattern_found);\n-\tif (pattern_found & NFC_ECC_PAT_FOUND(0)) {\n+\tif (pattern_found & NFC_ECC_PAT_FOUND(nfc_step)) {\n \t\tu8 pattern = 0xff;\n \n \t\tif (unlikely(!(readl(nfc->regs + NFC_REG_PAT_ID(nfc)) & 0x1)))\n@@ -799,7 +801,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,\n \t\treturn 1;\n \t}\n \n-\tret = NFC_ECC_ERR_CNT(0, readl(nfc->regs + NFC_REG_ECC_ERR_CNT(nfc, 0)));\n+\tret = NFC_ECC_ERR_CNT(nfc_step, readl(nfc->regs + NFC_REG_ECC_ERR_CNT(nfc, nfc_step)));\n \n \tmemcpy_fromio(data, nfc->regs + NFC_RAM0_BASE, ecc->size);\n \n@@ -807,7 +809,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,\n \tsunxi_nfc_randomizer_read_buf(mtd, oob, ecc->bytes + USER_DATA_SZ, true, page);\n \n \tstatus = readl(nfc->regs + NFC_REG_ECC_ST);\n-\tif (status & NFC_ECC_ERR(0)) {\n+\tif (status & NFC_ECC_ERR(nfc_step)) {\n \t\t/*\n \t\t * Re-read the data with the randomizer disabled to identify\n \t\t * bitflips in erased pages.\n@@ -830,7 +832,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct mtd_info *mtd,\n \t\t * Retrieve the corrected OOB bytes.\n \t\t */\n \t\tsunxi_nfc_user_data_to_buf(readl(nfc->regs +\n-\t\t\t\t\t\t NFC_REG_USER_DATA(nfc, 0)),\n+\t\t\t\t\t\t NFC_REG_USER_DATA(nfc, nfc_step)),\n \t\t\t\t\t oob);\n \n \t\t/* De-randomize the Bad Block Marker. */\n@@ -888,6 +890,8 @@ static int sunxi_nfc_hw_ecc_write_chunk(struct mtd_info *mtd,\n \tstruct sunxi_nfc *nfc = to_sunxi_nfc(nand->controller);\n \tstruct nand_ecc_ctrl *ecc = &nand->ecc;\n \tint ret;\n+\t/* From the controller point of view, we are at step 0 */\n+\tconst int nfc_step = 0;\n \n \tif (data_off != *cur_off)\n \t\tnand->cmdfunc(mtd, NAND_CMD_RNDIN, data_off, -1);\n@@ -901,10 +905,10 @@ static int sunxi_nfc_hw_ecc_write_chunk(struct mtd_info *mtd,\n \t\tmemcpy(user_data, oob, USER_DATA_SZ);\n \t\tsunxi_nfc_randomize_bbm(mtd, page, user_data);\n \t\twritel(sunxi_nfc_buf_to_user_data(user_data),\n-\t\t nfc->regs + NFC_REG_USER_DATA(nfc, 0));\n+\t\t nfc->regs + NFC_REG_USER_DATA(nfc, nfc_step));\n \t} else {\n \t\twritel(sunxi_nfc_buf_to_user_data(oob),\n-\t\t nfc->regs + NFC_REG_USER_DATA(nfc, 0));\n+\t\t nfc->regs + NFC_REG_USER_DATA(nfc, nfc_step));\n \t}\n \n \tif (data_off + ecc->size != oob_off)\n@@ -915,7 +919,7 @@ static int sunxi_nfc_hw_ecc_write_chunk(struct mtd_info *mtd,\n \t\treturn ret;\n \n \tsunxi_nfc_reset_user_data_len(nfc);\n-\tsunxi_nfc_set_user_data_len(nfc, USER_DATA_SZ, 0);\n+\tsunxi_nfc_set_user_data_len(nfc, USER_DATA_SZ, nfc_step);\n \n \tsunxi_nfc_randomizer_enable(mtd);\n \twritel(NFC_DATA_TRANS | NFC_DATA_SWAP_METHOD |\ndiff --git a/drivers/mtd/nand/raw/sunxi_nand_spl.c b/drivers/mtd/nand/raw/sunxi_nand_spl.c\nindex 3a5271b49c36..0d1f060cc425 100644\n--- a/drivers/mtd/nand/raw/sunxi_nand_spl.c\n+++ b/drivers/mtd/nand/raw/sunxi_nand_spl.c\n@@ -302,6 +302,8 @@ static int nand_read_page(const struct nfc_config *conf, u32 offs,\n \tint page = offs / conf->page_size;\n \tu32 ecc_st, pattern_found;\n \tint i;\n+\t/* From the controller point of view, we are at step 0 */\n+\tconst int nfc_step = 0;\n \n \tif (offs % conf->page_size || len % conf->ecc_size ||\n \t len > conf->page_size || len < 0)\n@@ -343,7 +345,7 @@ static int nand_read_page(const struct nfc_config *conf, u32 offs,\n \t\tnand_change_column(oob_off);\n \n \t\tsunxi_nfc_reset_user_data_len(conf);\n-\t\tsunxi_nfc_set_user_data_len(conf, USER_DATA_SZ, 0);\n+\t\tsunxi_nfc_set_user_data_len(conf, USER_DATA_SZ, nfc_step);\n \n \t\tnand_exec_cmd(NFC_DATA_TRANS | NFC_ECC_OP);\n \t\t/* Get the ECC status */\n@@ -361,7 +363,7 @@ static int nand_read_page(const struct nfc_config *conf, u32 offs,\n \t\t\tpattern_found = readl_nfc(conf->caps->reg_pat_found);\n \t\t\tpattern_found = field_get(NFC_ECC_PAT_FOUND_MSK(conf),\n \t\t\t\t\t\t pattern_found);\n-\t\t\tif (pattern_found & NFC_ECC_PAT_FOUND(0))\n+\t\t\tif (pattern_found & NFC_ECC_PAT_FOUND(nfc_step))\n \t\t\t\treturn 1;\n \t\t}\n \n", "prefixes": [ "v2", "2/5" ] }