From nobody Sun Feb 8 05:54:57 2026 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 054FB262FC1 for ; Sun, 1 Feb 2026 16:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769965130; cv=none; b=NEL6oNqsDl8YaSD6gEyIqKAbYrY3cOx7s4ptoHEXF7ur0BbXo4kWnXESMLFJTZbWBmDvnNEW5i6ygakrX68PIrCqI01qG2W2YwrEVwqyMJ0ODIf7PuW8xsvyiN5mrmxcPDSWQA42mM1oui8QNsaaoluNQ4yHUOf/qtlPWPizvCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769965130; c=relaxed/simple; bh=ddelZs4saclLRF6sch2rRSjldIrJ72w7jZXXb06+vSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WIYd04pZGETF/ikP8uq4ikAdarQse0hq9RrvlAqcsC5Ro2dKbWhZ2q5Z5rDLJEdJhZ6KIrADpVbQtcHlXjCbaMtdJntmBqrD3Tg84/nve6lFmfdQs8PSnzuu20xBGrWfVrIqxn9a7QwuL4r6V6gW6vn7UIaotxpwzsJ/OmJSMcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A384mZOn; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A384mZOn" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2a7a23f5915so23805365ad.2 for ; Sun, 01 Feb 2026 08:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769965128; x=1770569928; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IKlyXwPFG6GKEH0YaZ7/fSJxwTIFwYdtxia1Wrm6PzE=; b=A384mZOnKn4F2pysgtXG8oONp0sO+21Wp2hbTsCrDGW2UQ1XyYSauVsFxQ6HqjkT2x x+blqLZWJ2JvQIeltdA98TyE6CQVLWFezIeTa+X0hbyDgnFZVK1Fdal4gId4+kLUW2l3 29oRVjV/KU2RI8stP82/ypMlM5azigmav9UhwMpyUpDv+8EcTcJzYIA8GmN+DPERfHCs BJbjdmVCTT1pre39bdehBeMS7kLBz9ZHMeyNjOV6kd9RvSbZPs/t5PuBRFZuvQ4eIThg t3+MWQo/51D+AuF6fNayZQSrNtNdZM8MPjUEDPdRALT1V6JJgvacxA9fxbpa1FCxJb4v Geig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769965128; x=1770569928; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IKlyXwPFG6GKEH0YaZ7/fSJxwTIFwYdtxia1Wrm6PzE=; b=nq25/gMg2uYQqKKmtY287OR5VeXjiqVJ7iekyu5bh5XKenb2s0hEfkqRnq93kbL3cg kNf07oJRAZcYOYMNZRENQwHxA/JFObKJt8J1BvjQpY7bPgcM0+e4FJY6chLVEdtA/2WO Df224ujmJx7gm735vjhT+BmK7rN3dT1uZx/g461cLBAei0yC8Pk2pBKOmHoZXbvPNl5o WIttcDw8F/BPKEWO8hhG/D0VylP6bZtXtv4PtzhdpLBAJMx/qB4D1Y3TuTF+OxHMzsja Ar0ckMQmnbt0oxcmNxkkyq6UL3n0xdEr/pO1d82Wy40RrIuHe6RJeZXE4oSUTGJm0vQs Mkbw== X-Forwarded-Encrypted: i=1; AJvYcCUXud7MHt/IbIBFyPRFQrPq76CZ8L+VoztaAlZX9FpO5zCOhT9Zp/v0srKUewkRBqGvF3kAivtJkmxEGtg=@vger.kernel.org X-Gm-Message-State: AOJu0YzGYD2fqxcFJnYKSoPzO2WLaQMPohzl4pV2nk16FUM0z6u4QUsE Mtyy0bbEHrgUqVqz0KxPz/jreqoq2SMBp81hjqKv0lYj1Gxe+5N/Hppk X-Gm-Gg: AZuq6aLs+P8zKt8uxY9WK+TWVcYuReL3Bf7EH03YRmeBa7NnJB/8Lp13CbtGgGcdZif f/xRg/B996FG3GJE7uvralGZzbEkAPECOfVMST/ADeGBfge2rC4b+k5w0KULJW8awsi3AM80Zdi a25lLdSK0PM/mtXExSAX59tzWizPVu4CxouOB9AamGUQThaWnwS7d4XPbUDuWZ8PzKFKMknx2pw kH/HmhkQc3kke/B5APbSstBM/Rsoz/9EboyRz0MltE/h0feKLv38mfbvrOl2v2BnJ6eCeRWavli ZS3HMgXyfTieIrWksEA+rtbOjOZZ9apKwQKqe53sCOux+LsicchvYRoxe3TPbbPLwmMnW4bZRaR +mbhrAn++Ke9e0DowbhtAXSf5x9bza9Fc/W1MayKlW4pZhXJLUSyXGWy3TGoqFRpl7QQ0MKvICo NI1oiMYpSFhFuYPOpv+lnIg4SRy1u078BHJhA= X-Received: by 2002:a17:903:2bcb:b0:2a1:1074:4199 with SMTP id d9443c01a7336-2a8d9918dafmr92847555ad.32.1769965128369; Sun, 01 Feb 2026 08:58:48 -0800 (PST) Received: from 4aee0dccb4bc ([115.245.213.202]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b4c3afdsm120222755ad.61.2026.02.01.08.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 08:58:46 -0800 (PST) From: Sanjaikumar V S X-Google-Original-From: Sanjaikumar V S To: tudor.ambarus@linaro.org, pratyush@kernel.org, michael.walle@kernel.org Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Sanjaikumar V S , stable@vger.kernel.org Subject: [PATCH 2/2] mtd: spi-nor: core: Fix AAI mode when dirmap is not available Date: Sun, 1 Feb 2026 16:58:17 +0000 Message-ID: <20260201165817.53-3-sanjaikumar.vs@dicortech.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260201165817.53-1-sanjaikumar.vs@dicortech.com> References: <20260201165817.53-1-sanjaikumar.vs@dicortech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the SPI controller does not support direct mapping (nodirmap=3Dtrue), spi_nor_spimem_write_data() calls spi_mem_dirmap_write() which falls back to spi_mem_no_dirmap_write(). This fallback uses the operation template created at probe time with the standard page program opcode. For SST flashes using AAI mode, this fails because the template cannot handle the dynamic opcode and address byte changes required by AAI. Fix by checking nodirmap and using spi_nor_spimem_exec_op() directly, which uses the runtime-built operation with correct AAI configuration. Cc: stable@vger.kernel.org Signed-off-by: Sanjaikumar V S --- drivers/mtd/spi-nor/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index d3f8a78efd3b..7caeb508d628 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -281,7 +281,7 @@ static ssize_t spi_nor_spimem_write_data(struct spi_nor= *nor, loff_t to, if (spi_nor_spimem_bounce(nor, &op)) memcpy(nor->bouncebuf, buf, op.data.nbytes); =20 - if (nor->dirmap.wdesc) { + if (nor->dirmap.wdesc && !nor->dirmap.wdesc->nodirmap) { nbytes =3D spi_mem_dirmap_write(nor->dirmap.wdesc, op.addr.val, op.data.nbytes, op.data.buf.out); } else { --=20 2.43.0