Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2224165/?format=api
{ "id": 2224165, "url": "http://patchwork.ozlabs.org/api/patches/2224165/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260417022104.3973576-5-ycliang@andestech.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": "<20260417022104.3973576-5-ycliang@andestech.com>", "list_archive_url": null, "date": "2026-04-17T02:21:00", "name": "[4/8] spi: atcspi200: Fix double stop call and simplify transfer loop", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "59d69c9c3978177c08a16929ec82b7268d57d143", "submitter": { "id": 79234, "url": "http://patchwork.ozlabs.org/api/people/79234/?format=api", "name": "Leo Yu-Chi Liang", "email": "ycliang@andestech.com" }, "delegate": { "id": 17739, "url": "http://patchwork.ozlabs.org/api/users/17739/?format=api", "username": "jagan", "first_name": "Jagannadha Sutradharudu", "last_name": "Teki", "email": "jagannadh.teki@gmail.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260417022104.3973576-5-ycliang@andestech.com/mbox/", "series": [ { "id": 500221, "url": "http://patchwork.ozlabs.org/api/series/500221/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=500221", "date": "2026-04-17T02:20:56", "name": "spi: atcspi200: Modernize driver and add spi-mem + data merge support", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500221/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2224165/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2224165/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 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=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=fail (p=reject dis=none) header.from=andestech.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de; dmarc=fail (p=reject dis=none)\n header.from=andestech.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=ycliang@andestech.com" ], "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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fxdtr3Nnzz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 12:22:12 +1000 (AEST)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 5CDCD8425F;\n\tFri, 17 Apr 2026 04:21:45 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 5A52984262; Fri, 17 Apr 2026 04:21:44 +0200 (CEST)", "from Atcsqr.andestech.com (unknown [60.248.187.195])\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 E63E08425F\n for <u-boot@lists.denx.de>; Fri, 17 Apr 2026 04:21:41 +0200 (CEST)", "from mail.andestech.com (ATCPCS34.andestech.com [10.0.1.134])\n by Atcsqr.andestech.com with ESMTP id 63H2LBPa015786;\n Fri, 17 Apr 2026 10:21:11 +0800 (+08)\n (envelope-from ycliang@andestech.com)", "from swlinux02.andestech.com (10.0.15.183) by ATCPCS34.andestech.com\n (10.0.1.134) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 17 Apr\n 2026 10:21:10 +0800" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-1.1 required=5.0 tests=BAYES_00,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,RDNS_NONE,SPF_HELO_NONE,SPF_PASS\n autolearn=no autolearn_force=no version=3.4.2", "From": "Leo Yu-Chi Liang <ycliang@andestech.com>", "To": "<u-boot@lists.denx.de>", "CC": "Tom Rini <trini@konsulko.com>, Vignesh R <vigneshr@ti.com>, \"Takahiro\n Kuwano\" <takahiro.kuwano@infineon.com>, Jagan Teki\n <jagan@amarulasolutions.com>, <ycliang@andestech.com>", "Subject": "[PATCH 4/8] spi: atcspi200: Fix double stop call and simplify\n transfer loop", "Date": "Fri, 17 Apr 2026 10:21:00 +0800", "Message-ID": "<20260417022104.3973576-5-ycliang@andestech.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20260417022104.3973576-1-ycliang@andestech.com>", "References": "<20260417022104.3973576-1-ycliang@andestech.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[10.0.15.183]", "X-ClientProxiedBy": "ATCPCS33.andestech.com (10.0.1.100) To\n ATCPCS34.andestech.com (10.0.1.134)", "X-DKIM-Results": "atcpcs34.andestech.com; dkim=none;", "X-DNSRBL": "", "X-MAIL": "Atcsqr.andestech.com 63H2LBPa015786", "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": "- Remove duplicate atcspi200_hw_stop() call after the while loop;\n the stop inside the loop already handles the final chunk\n- Simplify the CHUNK_SIZE=1 transfer logic: since CHUNK_SIZE was\n always 1, remove the constant and inline its value, eliminating\n dead num_bytes/rf_cnt/rx_bytes variables\n- Simplify atcspi200_rx_byte() to void (return value was unused)\n- Add clarifying comment on the multi-chunk address increment\n\nFixes: b41e12e73b2 (\"spi: Add SPI driver for Andestech ATCSPI200 controller\")\nSigned-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>\n---\n drivers/spi/atcspi200_spi.c | 41 ++++++++++++-------------------------\n 1 file changed, 13 insertions(+), 28 deletions(-)", "diff": "diff --git a/drivers/spi/atcspi200_spi.c b/drivers/spi/atcspi200_spi.c\nindex 38345a88260..0e7f7b83081 100644\n--- a/drivers/spi/atcspi200_spi.c\n+++ b/drivers/spi/atcspi200_spi.c\n@@ -18,7 +18,6 @@\n #include <linux/bitops.h>\n \n #define MAX_TRANSFER_LEN\t512\n-#define CHUNK_SIZE\t\t1\n #define SPI_TIMEOUT_MS\t\t1000\n #define SPI_DEF_SRC_CLK\t\t100000000\n #define SPI_DEF_MAX_CLK\t\t40000000\n@@ -188,26 +187,22 @@ static void atcspi200_tx_byte(struct atcspi200_priv *priv, const void *dout)\n \tatcspi200_write(priv, ATCSPI200_REG_DATA, *(u8 *)dout);\n }\n \n-static int atcspi200_rx_byte(struct atcspi200_priv *priv, void *din,\n-\t\t\t unsigned int bytes)\n+static void atcspi200_rx_byte(struct atcspi200_priv *priv, void *din)\n {\n \t*(u8 *)din = (u8)atcspi200_read(priv, ATCSPI200_REG_DATA);\n-\treturn bytes;\n }\n \n static int atcspi200_hw_xfer(struct atcspi200_priv *priv,\n \t\t\t unsigned int bitlen, const void *data_out,\n \t\t\t void *data_in, unsigned long flags)\n {\n-\tunsigned int event, rx_bytes;\n+\tunsigned int event;\n \tconst void *dout = NULL;\n \tvoid *din = NULL;\n \tint num_blks, num_chunks, max_tran_len, tran_len;\n-\tint num_bytes;\n \tu8 *cmd_buf = priv->cmd_buf;\n \tsize_t cmd_len = priv->cmd_len;\n \tunsigned long data_len = bitlen / 8;\n-\tint rf_cnt;\n \tint ret = 0;\n \tunsigned long start;\n \n@@ -250,10 +245,7 @@ static int atcspi200_hw_xfer(struct atcspi200_priv *priv,\n \twhile (num_chunks--) {\n \t\ttran_len = min((size_t)data_len, (size_t)max_tran_len);\n \t\tpriv->tran_len = tran_len;\n-\t\tnum_blks = DIV_ROUND_UP(tran_len, CHUNK_SIZE);\n-\t\tnum_bytes = tran_len % CHUNK_SIZE;\n-\t\tif (num_bytes == 0)\n-\t\t\tnum_bytes = CHUNK_SIZE;\n+\t\tnum_blks = tran_len;\n \t\tstart = get_timer(0);\n \t\tatcspi200_hw_start(priv);\n \n@@ -267,30 +259,24 @@ static int atcspi200_hw_xfer(struct atcspi200_priv *priv,\n \n \t\t\tif ((event & TXEPTY) && data_out) {\n \t\t\t\tatcspi200_tx_byte(priv, dout);\n-\t\t\t\tnum_blks -= CHUNK_SIZE;\n-\t\t\t\tdout += CHUNK_SIZE;\n+\t\t\t\tnum_blks--;\n+\t\t\t\tdout++;\n \t\t\t}\n \n \t\t\tif ((event & RXFVE_MASK) && data_in) {\n-\t\t\t\trf_cnt = FIELD_GET(RXFVE_MASK, event);\n-\t\t\t\tif (rf_cnt >= CHUNK_SIZE)\n-\t\t\t\t\trx_bytes = CHUNK_SIZE;\n-\t\t\t\telse if (num_blks == 1 &&\n-\t\t\t\t\t rf_cnt == num_bytes)\n-\t\t\t\t\trx_bytes = num_bytes;\n-\t\t\t\telse\n-\t\t\t\t\tcontinue;\n-\n-\t\t\t\tif (atcspi200_rx_byte(priv, din, rx_bytes) ==\n-\t\t\t\t rx_bytes) {\n-\t\t\t\t\tnum_blks -= CHUNK_SIZE;\n-\t\t\t\t\tdin = (unsigned char *)din + rx_bytes;\n-\t\t\t\t}\n+\t\t\t\tatcspi200_rx_byte(priv, din);\n+\t\t\t\tnum_blks--;\n+\t\t\t\tdin = (unsigned char *)din + 1;\n \t\t\t}\n \t\t}\n \n \t\tdata_len -= tran_len;\n \t\tif (data_len) {\n+\t\t\t/*\n+\t\t\t * Increment SPI NOR read address in cmd buffer\n+\t\t\t * for multi-chunk transfers (3-byte big-endian\n+\t\t\t * address at cmd_buf[1..3]).\n+\t\t\t */\n \t\t\tpriv->cmd_buf[1] += ((tran_len >> 16) & 0xff);\n \t\t\tpriv->cmd_buf[2] += ((tran_len >> 8) & 0xff);\n \t\t\tpriv->cmd_buf[3] += (tran_len & 0xff);\n@@ -298,7 +284,6 @@ static int atcspi200_hw_xfer(struct atcspi200_priv *priv,\n \t\t}\n \t\tret = atcspi200_hw_stop(priv);\n \t}\n-\tret = atcspi200_hw_stop(priv);\n \n \treturn ret;\n }\n", "prefixes": [ "4/8" ] }