get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2218024,
    "url": "http://patchwork.ozlabs.org/api/patches/2218024/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260331095026.38-1-sanjaikumarvs@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": "<20260331095026.38-1-sanjaikumarvs@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-31T09:50:26",
    "name": "[v5] mtd: spi-nor: Fix SST AAI write mode opcode handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "d65a1486eb3e88e391f73f9d4fb4f8b1d1f367d0",
    "submitter": {
        "id": 92552,
        "url": "http://patchwork.ozlabs.org/api/people/92552/?format=api",
        "name": "Sanjaikumar V S",
        "email": "sanjaikumarvs@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20260331095026.38-1-sanjaikumarvs@gmail.com/mbox/",
    "series": [
        {
            "id": 498159,
            "url": "http://patchwork.ozlabs.org/api/series/498159/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=498159",
            "date": "2026-03-31T09:50:26",
            "name": "[v5] mtd: spi-nor: Fix SST AAI write mode opcode handling",
            "version": 5,
            "mbox": "http://patchwork.ozlabs.org/series/498159/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218024/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218024/checks/",
    "tags": {},
    "related": [],
    "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=JZc9WsOu;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=DmROnmk3;\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 4flNfV0554z1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 20:50:58 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w7VkG-0000000CiaG-346a;\n\tTue, 31 Mar 2026 09:50:48 +0000",
            "from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w7VkE-0000000CiZc-1hwS\n\tfor linux-mtd@lists.infradead.org;\n\tTue, 31 Mar 2026 09:50:47 +0000",
            "by mail-pf1-x436.google.com with SMTP id\n d2e1a72fcca58-8296dabef74so5198435b3a.1\n        for <linux-mtd@lists.infradead.org>;\n Tue, 31 Mar 2026 02:50:46 -0700 (PDT)",
            "from f7eceb44c2db ([115.245.213.202])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82ca85fc6e9sm11279771b3a.46.2026.03.31.02.50.41\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 31 Mar 2026 02:50:44 -0700 (PDT)"
        ],
        "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=cmY/97acqJHejxscy9K1j2b0UkyzowfInlFsQr2By0o=; b=JZc9WsOuaf9Z0k\n\tUTL9hfSn8a62ohJqf82ru88GKsaUMd/ix4HeZTSYXIegHLdPWlh/36ThoZz5Edv9T9+ia2PETyW0m\n\t0B00ND5K0MUcC2ZlGXzldz3eVtsIo4Qkj8+WlC5p8Ff+bG+jb4KPTSN0M/VDIg3VmyeoqAB9TXI/c\n\tr5qRG+pSnKujhwQg8PvMBYmCjPGCbOk1/dKfbPMVvx94sRzxH3sFVuhsYaUtrlBjFOTx17Jg+KQ2k\n\t8perguAWf63C5/W8adhcLMmwpUklUQ+w0GluDzfil8p9GTWNpvxVZg7o5SKbLqBehXTI8WkfVRWaz\n\tNVVstt3ItL4VF3MVBCZg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1774950645; x=1775555445;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=GU/F2QI9q8EVNVojnX0CtcCJf9ZvbWREtW+2yWmBDUg=;\n        b=DmROnmk3j5LnH3GHIjIxFmVnnwfaXH1QVOnWPdW9q5f/bUDqeDqzEy04btDQYVAM+9\n         IN14yMlaLet+tbg2n+ctCBSrQD5bolnSi02qO/gKJz7pC8JlOEfIQNF9DwrdmLHCshix\n         Z5g/DPnG07fURNaPe/tOSFLcCY8J2vAhlN6ffug9USewkHYkoxQWtEOMATkex5YgORgU\n         ptvlfq4BYtp5nIkSxtmievBUxcS5oD+N3/RxjPa8zz7fRI0OKje4zJHZtAOFiAab2aMp\n         acDUrNBE5/FEfdqM0qWZeFQ5/OT9zSbOmGu7+t5C0AdTw3Ii3o9eUk95tfC+GOOb5NFn\n         q1Mg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774950645; x=1775555445;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=GU/F2QI9q8EVNVojnX0CtcCJf9ZvbWREtW+2yWmBDUg=;\n        b=B2hC11M2R2Lm6oEaMU+VOhdSwA2Km5x9Y19FJTQDs8U3yI686dGWBfcucBRQEDrVNG\n         xQ/z//UXdGh2DWvPfYs4eQn2uk1dIGksNG0xVbqNvHwfSpcqAl5aEwBmTH492mq8cmmJ\n         9uB1P0ErY0Coea9gZBrEJDIIK2BtgWYvM9EGdcj79NJwT6emwqNB7Sn+hK1AelvT41SJ\n         hHKrrthu5cjjRD9wJDAF5cB+R/R2Gk/kwZAnihWb/7jMUhML6mifXrIyKQAdJhAjFNEz\n         z91mkZro7QoNyKmy9zDjkWS9phVo4//z1Qyk0Ovdmoab8op/vYlWDWgl5pbZFYktq2uc\n         fhHw==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCWgpzA7w8/bO8Srf9ICauqk9ckb/75lVs7ZKtALFsriGyq5UFSDpzqtrnz9cQPATAXHGbVL8nc9p9Q=@lists.infradead.org",
        "X-Gm-Message-State": "AOJu0Yxbl23GB/iM3re84PMoZaZkL9/bxLV49IEiKagOZeQvq+rTJJ4T\n\t54f+qOISJTvUo4qMAdZ2HTeHQWn5soVVep3ioQiuIH7USNCfCoG72eBC",
        "X-Gm-Gg": "ATEYQzwHavKpxc7rYZySYQXdcB/SiRGUXN90fhxacu0wosHmbX0qxhp0WOxmMme57+J\n\tfyDimmN+Sd4Sgq6A2tdLdYHb9j5+mczlrjIaHRR6Nd3R494+iAaO02WTb1Wheg5S0XpEvQcFLTM\n\t4a6kL8oovjsJFEAyFVvCecqj00Qb4iPW9MWQsysUKG2pcgljeMs+J103tmAHo6zbGpc5W8KRA2W\n\tVHC/NL1zHNzMs4DCb3L8irJX6OR8rzt/QHe8j+D+tgQSIg+L3Z7IWpjee9V46YIuci3FkaEI/Wa\n\t0c8I1YD+B+o8Ip1Fd6aS9fgVlHDNrV7CYPVFNgb1qjmN5wdfHEiJjNh/ije4J8ivB9XEyTRD5ri\n\t98IqXVvbLsBqf7BL3sIJ7oTikP4qjzfBL+/NPI/VqEZelWxEB/66h5r18cstO9DElyBGVBrbz/d\n\tmC2TKY3JIbBomhKoAR1gaQQyAlSkGL3N6wK1RA0Ezd4w==",
        "X-Received": "by 2002:a05:6a00:4c9c:b0:82a:7f6b:3fa1 with SMTP id\n d2e1a72fcca58-82c95ed4602mr15144187b3a.33.1774950645507;\n        Tue, 31 Mar 2026 02:50:45 -0700 (PDT)",
        "From": "Sanjaikumar V S <sanjaikumarvs@gmail.com>",
        "To": "mwalle@kernel.org,\n\tpratyush@kernel.org",
        "Cc": "hd@os-cillation.de,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-mtd@lists.infradead.org,\n\tmiquel.raynal@bootlin.com,\n\trichard@nod.at,\n\tsanjaikumar.vs@dicortech.com,\n\tsanjaikumarvs@gmail.com,\n\tstable@vger.kernel.org,\n\ttudor.ambarus@linaro.org,\n\tvigneshr@ti.com",
        "Subject": "[PATCH v5] mtd: spi-nor: Fix SST AAI write mode opcode handling",
        "Date": "Tue, 31 Mar 2026 09:50:26 +0000",
        "Message-ID": "<20260331095026.38-1-sanjaikumarvs@gmail.com>",
        "X-Mailer": "git-send-email 2.52.0",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260331_025046_453710_C5C91805 ",
        "X-CRM114-Status": "GOOD (  18.29  )",
        "X-Spam-Score": "-2.1 (--)",
        "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:  From: Sanjaikumar V S When the SPI controller lacks direct\n    mapping support,\n the fallback path in spi_nor_spimem_write_data() uses nor->write_proto\n    based operation template. However,\n this template uses the standard page pro\n    [...]\n Content analysis details:   (-2.1 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\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 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [sanjaikumarvs(at)gmail.com]\n -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/, no\n                             trust\n                             [2607:f8b0:4864:20:0:0:0:436 listed in]\n                             [list.dnswl.org]",
        "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=\"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": "From: Sanjaikumar V S <sanjaikumar.vs@dicortech.com>\n\nWhen the SPI controller lacks direct mapping support, the fallback path\nin spi_nor_spimem_write_data() uses nor->write_proto based operation\ntemplate. However, this template uses the standard page program opcode\nset during probe, not the AAI opcode required for SST flash.\n\nAdditionally, controllers that do support direct mapping will also use\nthe wrong opcode since the dirmap template is created at probe time\nwith the standard page program opcode.\n\nFix this by:\n1. Checking the nodirmap flag in spi_nor_spimem_write_data() to ensure\n   the code falls through to spi_nor_spimem_exec_op() path which builds\n   the operation at runtime with the correct program_opcode.\n2. Setting nodirmap=true for SST AAI devices in sst_nor_late_init() to\n   disable dirmap and force the runtime opcode path.\n\nThis only affects SST devices with SST_WRITE flag. Other SST devices\nthat use standard page program can still benefit from dirmap.\n\nFixes: df5c21002cf4 (\"mtd: spi-nor: use spi-mem dirmap API\")\nCc: stable@vger.kernel.org\nSigned-off-by: Sanjaikumar V S <sanjaikumar.vs@dicortech.com>\n---\nChanges since v4:\n- Disable dirmap for SST AAI devices in sst_nor_late_init() to fix\n  the case when controller supports direct mapping (Pratyush)\n- Updated commit message and subject to reflect the broader fix\n\nNote: Patch 1/2 from v4 series is already in spi-nor/next.\n\nI don't have hardware to test the new sst.c change. Hendrik, could you\nplease verify this on your SST25VF032B setup?\n\n drivers/mtd/spi-nor/core.c |  2 +-\n drivers/mtd/spi-nor/sst.c  | 10 +++++++++-\n 2 files changed, 10 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c\nindex e6c1fda61f57..2e4b167cab57 100644\n--- a/drivers/mtd/spi-nor/core.c\n+++ b/drivers/mtd/spi-nor/core.c\n@@ -281,7 +281,7 @@ static ssize_t spi_nor_spimem_write_data(struct spi_nor *nor, loff_t to,\n \tif (spi_nor_spimem_bounce(nor, &op))\n \t\tmemcpy(nor->bouncebuf, buf, op.data.nbytes);\n \n-\tif (nor->dirmap.wdesc) {\n+\tif (nor->dirmap.wdesc && !nor->dirmap.wdesc->nodirmap) {\n \t\tnbytes = spi_mem_dirmap_write(nor->dirmap.wdesc, op.addr.val,\n \t\t\t\t\t      op.data.nbytes, op.data.buf.out);\n \t} else {\ndiff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c\nindex db02c14ba16f..cd2f04830a6b 100644\n--- a/drivers/mtd/spi-nor/sst.c\n+++ b/drivers/mtd/spi-nor/sst.c\n@@ -267,8 +267,16 @@ static int sst_nor_write(struct mtd_info *mtd, loff_t to, size_t len,\n \n static int sst_nor_late_init(struct spi_nor *nor)\n {\n-\tif (nor->info->mfr_flags & SST_WRITE)\n+\tif (nor->info->mfr_flags & SST_WRITE) {\n \t\tnor->mtd._write = sst_nor_write;\n+\t\t/*\n+\t\t * AAI mode requires dynamic opcode changes (BP vs AAI_WP).\n+\t\t * Disable dirmap to ensure spi_nor_spimem_exec_op() uses\n+\t\t * the runtime opcode instead of the dirmap template.\n+\t\t */\n+\t\tif (nor->dirmap.wdesc)\n+\t\t\tnor->dirmap.wdesc->nodirmap = true;\n+\t}\n \n \treturn 0;\n }\n",
    "prefixes": [
        "v5"
    ]
}