get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2221226,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2221226/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260408211407.2295175-1-andriy.shevchenko@linux.intel.com/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/1.1/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
    },
    "msgid": "<20260408211407.2295175-1-andriy.shevchenko@linux.intel.com>",
    "date": "2026-04-08T21:11:48",
    "name": "[v3,1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d5e7a7822bb9f86b1dd0a5ddbb4e78b9384a539b",
    "submitter": {
        "id": 8583,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/8583/?format=api",
        "name": "Andy Shevchenko",
        "email": "andriy.shevchenko@linux.intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260408211407.2295175-1-andriy.shevchenko@linux.intel.com/mbox/",
    "series": [
        {
            "id": 499211,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499211/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=499211",
            "date": "2026-04-08T21:11:48",
            "name": "[v3,1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/499211/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2221226/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2221226/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "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 secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=LuqbjzSL;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=UF2kW1O4;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\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 4frbRd5smJz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 07:14:32 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wAaEB-00000009QIo-0qHN;\n\tWed, 08 Apr 2026 21:14:23 +0000",
            "from mgamail.intel.com ([198.175.65.19])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wAaE8-00000009QIM-051F\n\tfor linux-mtd@lists.infradead.org;\n\tWed, 08 Apr 2026 21:14:21 +0000",
            "from orviesa006.jf.intel.com ([10.64.159.146])\n  by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Apr 2026 14:14:17 -0700",
            "from black.igk.intel.com ([10.91.253.5])\n  by orviesa006.jf.intel.com with ESMTP; 08 Apr 2026 14:14:14 -0700",
            "by black.igk.intel.com (Postfix, from userid 1003)\n\tid C928C95; Wed, 08 Apr 2026 23:14:13 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=ATN+RfwG5zGYHghfAiux3U74SHsIwC6CnyZT3oLFglg=; b=LuqbjzSLL1eOrf\n\tqoemya4InsZeR6BWZREbOe3OhAKueDFc+3XimOFejjWz07J1Fys2BwtmaTkqjvhDZabiMGXzHRCyA\n\tOYWwFSnRsLMhX2anqv9qdSiYeeJqf8NaLLXW2YKjjbSkioeKxsXk75qeelvjrwQzYU4GJNhn4HMTN\n\tOVBh7SM3Ci+rt4hyG6L5bKSHwk89HMAQ1xI5De7Oq5Y9e869ywmt0100sJ93wD4xRPOwR3vWJ5cyo\n\td/9FJd9Lv51zEko0kyeKVdCEQCDF4doRytd85utYiq5PZF0Ixb4SBVPIHqO9qv5mkdwokYiM4hwIi\n\t7DGNfskuKkIsTx2vG3aQ==;",
            "v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1775682860; x=1807218860;\n  h=from:to:cc:subject:date:message-id:mime-version:\n   content-transfer-encoding;\n  bh=9ANUT8QdPo5iyQxCYTvuSXlBIUzBWrhApFgNzvDSbLM=;\n  b=UF2kW1O4ILHP7CMx/lQ2gYrjuuxplBQAg+w7C/AiPdOAFAh6hnorzuhm\n   oHvcyjhV8Ws8ZcyKKEPbfGQSbM9I5tUU96Ro782SKAuqXgeSvyPOznPgn\n   xLB0D9M9a0zWzBfp38A3pMKEFbJoS5JHAHG4whRki428ePUwaDeqvJrsM\n   c0lJLVKBlLbc7W8kGJn8aZu6XYMSJmXixE+Ui8MLcWWvO1bwoH7FYgkF4\n   huwSCNe5Ov2o7x3uqzVVKqHHqYW4Ux0I8RQ0dgbi19e+AdiiL1jgFIjhP\n   F9WPlBVaUZMrTnFp4LaV9YfYZitSjJzj2e4RLwx3qLMLuIi4v5V+PUkW0\n   A==;"
        ],
        "X-CSE-ConnectionGUID": [
            "GhlSiwPfRk6iPm7/fOYCOg==",
            "pMtrtxS2QqKzYiiMiOok4Q=="
        ],
        "X-CSE-MsgGUID": [
            "nD0IlihaQVydbeMupyIoFA==",
            "Ydf4K/UpR8anBuZiejN56Q=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6800,10657,11753\"; a=\"76583112\"",
            "E=Sophos;i=\"6.23,168,1770624000\";\n   d=\"scan'208\";a=\"76583112\"",
            "E=Sophos;i=\"6.23,168,1770624000\";\n   d=\"scan'208\";a=\"227586491\""
        ],
        "X-ExtLoop1": "1",
        "From": "Andy Shevchenko <andriy.shevchenko@linux.intel.com>",
        "To": "Andy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tlinux-mtd@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org",
        "Cc": "Miquel Raynal <miquel.raynal@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tVignesh Raghavendra <vigneshr@ti.com>,\n\tLukas Wunner <lukas@wunner.de>,\n\tAndrew Morton <akpm@linux-foundation.org>",
        "Subject": "[PATCH v3 1/1] mtd: cfi_cmdset_0001: Factor out\n do_write_buffer_locked() to reduce stack frame",
        "Date": "Wed,  8 Apr 2026 23:11:48 +0200",
        "Message-ID": "<20260408211407.2295175-1-andriy.shevchenko@linux.intel.com>",
        "X-Mailer": "git-send-email 2.50.1",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260408_141420_125135_8A88F935 ",
        "X-CRM114-Status": "GOOD (  18.45  )",
        "X-Spam-Score": "-4.7 (----)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Compiler is not happy about used stack frame:\n drivers/mtd/chips/cfi_cmdset_0001.c:\n    In function 'do_write_buffer': drivers/mtd/chips/cfi_cmdset_0001.c:1887:1:\n    error: the frame size of 1296 bytes is larger than 1280 bytes\n [-Werror=frame-larger-than\n    [...]\n Content analysis details:   (-4.7 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,\n                             medium trust\n                             [198.175.65.19 listed in list.dnswl.org]\n  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [198.175.65.19 listed in sa-accredit.habeas.com]\n  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n                             query to Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                          [198.175.65.19 listed in\n sa-trusted.bondedsender.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n                              Validity was blocked.  See\n                             https://knowledge.validity.com/hc/en-us/articles/20961730681243\n                              for more information.\n                             [198.175.65.19 listed in\n bl.score.senderscore.com]\n -0.5 DKIMWL_WL_HIGH         DKIMwl.org - High trust sender",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "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 <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 <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Compiler is not happy about used stack frame:\n\ndrivers/mtd/chips/cfi_cmdset_0001.c: In function 'do_write_buffer':\ndrivers/mtd/chips/cfi_cmdset_0001.c:1887:1: error: the frame size of 1296 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]\n\nFix this by factoring out do_write_buffer_locked().\n\nSigned-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>\n---\nv3: addressed set but unused variables when MTD_XIP=y (LKP)\nv2: kept DIS/ENABLE_VPP paired\n\n drivers/mtd/chips/cfi_cmdset_0001.c | 88 +++++++++++++++++------------\n 1 file changed, 51 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c\nindex 5a4d2e16a9d1..7733e076ad40 100644\n--- a/drivers/mtd/chips/cfi_cmdset_0001.c\n+++ b/drivers/mtd/chips/cfi_cmdset_0001.c\n@@ -1154,7 +1154,8 @@ static void __xipram xip_enable(struct map_info *map, struct flchip *chip,\n \n static int __xipram xip_wait_for_operation(\n \t\tstruct map_info *map, struct flchip *chip,\n-\t\tunsigned long adr, unsigned int chip_op_time_max)\n+\t\tunsigned long adr, unsigned long inval_adr, int inval_len,\n+\t\tunsigned int chip_op_time, unsigned int chip_op_time_max)\n {\n \tstruct cfi_private *cfi = map->fldrv_priv;\n \tstruct cfi_pri_intelext *cfip = cfi->cmdset_priv;\n@@ -1276,8 +1277,7 @@ static int __xipram xip_wait_for_operation(\n #define XIP_INVAL_CACHED_RANGE(map, from, size)  \\\n \tINVALIDATE_CACHED_RANGE(map, from, size)\n \n-#define INVAL_CACHE_AND_WAIT(map, chip, cmd_adr, inval_adr, inval_len, usec, usec_max) \\\n-\txip_wait_for_operation(map, chip, cmd_adr, usec_max)\n+#define INVAL_CACHE_AND_WAIT xip_wait_for_operation\n \n #else\n \n@@ -1720,42 +1720,24 @@ static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t le\n }\n \n \n-static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,\n-\t\t\t\t    unsigned long adr, const struct kvec **pvec,\n-\t\t\t\t    unsigned long *pvec_seek, int len)\n+static int __xipram do_write_buffer_locked(struct map_info *map, struct flchip *chip,\n+\t\t\t\t\t   unsigned long cmd_adr, unsigned long adr,\n+\t\t\t\t\t   const struct kvec **pvec,\n+\t\t\t\t\t   unsigned long *pvec_seek, int len)\n {\n \tstruct cfi_private *cfi = map->fldrv_priv;\n \tmap_word status, write_cmd, datum;\n-\tunsigned long cmd_adr;\n-\tint ret, wbufsize, word_gap, words;\n+\tint ret, word_gap, words;\n \tconst struct kvec *vec;\n \tunsigned long vec_seek;\n \tunsigned long initial_adr;\n \tint initial_len = len;\n \n-\twbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;\n-\tadr += chip->start;\n \tinitial_adr = adr;\n-\tcmd_adr = adr & ~(wbufsize-1);\n-\n-\t/* Sharp LH28F640BF chips need the first address for the\n-\t * Page Buffer Program command. See Table 5 of\n-\t * LH28F320BF, LH28F640BF, LH28F128BF Series (Appendix FUM00701) */\n-\tif (is_LH28F640BF(cfi))\n-\t\tcmd_adr = adr;\n \n \t/* Let's determine this according to the interleave only once */\n \twrite_cmd = (cfi->cfiq->P_ID != P_ID_INTEL_PERFORMANCE) ? CMD(0xe8) : CMD(0xe9);\n \n-\tmutex_lock(&chip->mutex);\n-\tret = get_chip(map, chip, cmd_adr, FL_WRITING);\n-\tif (ret) {\n-\t\tmutex_unlock(&chip->mutex);\n-\t\treturn ret;\n-\t}\n-\n-\tXIP_INVAL_CACHED_RANGE(map, initial_adr, initial_len);\n-\tENABLE_VPP(map);\n \txip_disable(map, chip, cmd_adr);\n \n \t/* §4.8 of the 28FxxxJ3A datasheet says \"Any time SR.4 and/or SR.5 is set\n@@ -1789,7 +1771,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,\n \t\txip_enable(map, chip, cmd_adr);\n \t\tprintk(KERN_ERR \"%s: Chip not ready for buffer write. Xstatus = %lx, status = %lx\\n\",\n \t\t\t\tmap->name, Xstatus.x[0], status.x[0]);\n-\t\tgoto out;\n+\t\treturn ret;\n \t}\n \n \t/* Figure out the number of words to write */\n@@ -1853,7 +1835,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,\n \t\tchip->state = FL_STATUS;\n \t\txip_enable(map, chip, cmd_adr);\n \t\tprintk(KERN_ERR \"%s: buffer write error (status timeout)\\n\", map->name);\n-\t\tgoto out;\n+\t\treturn ret;\n \t}\n \n \t/* check for errors */\n@@ -1866,21 +1848,53 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,\n \t\tmap_write(map, CMD(0x70), cmd_adr);\n \t\txip_enable(map, chip, cmd_adr);\n \n-\t\tif (chipstatus & 0x02) {\n-\t\t\tret = -EROFS;\n-\t\t} else if (chipstatus & 0x08) {\n+\t\tif (chipstatus & 0x02)\n+\t\t\treturn -EROFS;\n+\n+\t\tif (chipstatus & 0x08) {\n \t\t\tprintk(KERN_ERR \"%s: buffer write error (bad VPP)\\n\", map->name);\n-\t\t\tret = -EIO;\n-\t\t} else {\n-\t\t\tprintk(KERN_ERR \"%s: buffer write error (status 0x%lx)\\n\", map->name, chipstatus);\n-\t\t\tret = -EINVAL;\n+\t\t\treturn  -EIO;\n \t\t}\n \n-\t\tgoto out;\n+\t\tprintk(KERN_ERR \"%s: buffer write error (status 0x%lx)\\n\", map->name, chipstatus);\n+\t\treturn -EINVAL;\n \t}\n \n \txip_enable(map, chip, cmd_adr);\n- out:\tDISABLE_VPP(map);\n+\treturn 0;\n+}\n+\n+static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,\n+\t\t\t\t    unsigned long adr, const struct kvec **pvec,\n+\t\t\t\t    unsigned long *pvec_seek, int len)\n+{\n+\tstruct cfi_private *cfi = map->fldrv_priv;\n+\tunsigned long cmd_adr;\n+\tint ret, wbufsize;\n+\n+\twbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;\n+\tadr += chip->start;\n+\tcmd_adr = adr & ~(wbufsize - 1);\n+\n+\t/* Sharp LH28F640BF chips need the first address for the\n+\t * Page Buffer Program command. See Table 5 of\n+\t * LH28F320BF, LH28F640BF, LH28F128BF Series (Appendix FUM00701) */\n+\tif (is_LH28F640BF(cfi))\n+\t\tcmd_adr = adr;\n+\n+\tmutex_lock(&chip->mutex);\n+\tret = get_chip(map, chip, cmd_adr, FL_WRITING);\n+\tif (ret) {\n+\t\tmutex_unlock(&chip->mutex);\n+\t\treturn ret;\n+\t}\n+\n+\tXIP_INVAL_CACHED_RANGE(map, adr, len);\n+\tENABLE_VPP(map);\n+\n+\tret = do_write_buffer_locked(map, chip, cmd_adr, adr, pvec, pvec_seek, len);\n+\n+\tDISABLE_VPP(map);\n \tput_chip(map, chip, cmd_adr);\n \tmutex_unlock(&chip->mutex);\n \treturn ret;\n",
    "prefixes": [
        "v3",
        "1/1"
    ]
}