From nobody Thu Apr 2 15:35:47 2026 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 015473CEBA8 for ; Wed, 11 Mar 2026 10:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773225094; cv=none; b=Q5NFuVr7XKYT8ARrUbQfu9OGIm5kfhp55doM8Hzbpm855eJijlZj61MyRsY8dl6d92fqJTp1sFIEns4z67fNsiQXth4m2liyaEQO0rrxwk3/fSns6dCenhYzyR+7jzObrPaqfALDYkOS75JqNp7BgmfR7NV8qFhap/EM2FdKTfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773225094; c=relaxed/simple; bh=A7pliAaFlvjBgnccGAmiRGQibD/JUX9gqF8ur5uKKVQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U/Ng0ozURXtNn+poLd4M2R8/jOMGtk1s6M/dq8tLVOWcYCS9Wzga8nmXGDCp3IZvXUMVsI/9QoP1NNs8mwPDJF5sG9+Wy0fs8XMrkoihBuh2XRfaqIdMG3qTTCpeHisMliqKevl3KsM+GNZEO/T3RjKtlPs525Rr0fa6sBsz0gc= 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=fnPMmio+; arc=none smtp.client-ip=209.85.210.179 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="fnPMmio+" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8296dabef74so7233354b3a.1 for ; Wed, 11 Mar 2026 03:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773225092; x=1773829892; 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=CmNvd1PHGKe/+jOkhZ60vdpiKJgn6ANHvZ8AjwmtkSQ=; b=fnPMmio+MA1tlV1zjpaE7ExMsz8F9feTxxU/hCgu7Am4FqN4AH1agDKaqTp7/UPktu iGApLmaUtn988tfPGjHyUec6zjOs0nNyzl3FaxqCJTBhAMs0jfy4x/PEPOi4cr7mTvYQ rTqxXEvBieHeziOaB/PFxWINGo62BbG9puUCxasDBJwdBlhOkE1AJCWoCusaJoR0DRYw s2Z97QQUMYnm6hWLyaQ2+GAvoj9m6tw4M0DmDYkX8SU/eJDOjiU35XzdgCWqM+hBwEGf J7cAJB070oIqTMtkQC8RByGK+d/WlaWfqsT9E0aGAvRvcmiTtqaFRCqf8He+q5MuJyeO cFdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773225092; x=1773829892; 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=CmNvd1PHGKe/+jOkhZ60vdpiKJgn6ANHvZ8AjwmtkSQ=; b=eMi5GXk4hX7pSTHUNbCw+XciElFP+gy7FaRg6cpa7YT2FN44AmRsWKrW2fIPPtUNxF pThiK0UtId+POdCxX0XAPzj4hLyqcX3cnrF/OLzUQn/ioFYETl8fhk0x2+O7jf32Hyu8 a/LCVSrjqb65TnUqP257LiIAKOjOlub2svqI40pFoZNnX5133Pup2zrgpM+d1NsqYMaE 8fvJ2ATX1FEywNJIN7DMWOiTndmf74781QLnCcz+fhjc6jS/IRNo3L0WVIB6tKarwH/R ESMa+0oJkJhGRDrikDjnzM/yQCQ0OYhXhUaw33dhcdMS1q/dTA1xA++Ts0Z1hIb70OmG xKyw== X-Gm-Message-State: AOJu0YyPdXy7RoGzOZyV+gQJ4PGEirGL5Gb6dUszA0y++gTDOQmD/8uW jfJe0/cgcEJGcSAg0Tg/yTKBoQPL98jwtFaJmONUqx+EZGGRx1/X/J1X X-Gm-Gg: ATEYQzyCpxz+ouo2tWhhCV6woLkC4e4ODUTuTUXA8IskEapES8xmPGL81U753zmn3th W/H2ldOMilnNupdsuaJwBMSJIFDW5hNei8LxhqTC/XWAATuKf0UYaNUjYrOrJzI+wjtybD43CoT DutOSvlc2/iWZlMy7Zd5j1m6pqoF8kuKTR22trEXPzAzmXoOKqrS5bNmhC9+nEwFjx/XQ3X2dzr xoCi/+sZumLj+QzkiZy0RXhrA70Kc3pz+hMdvbQCv8pDNh/eEqHfSrBPSn2mw0UhjpeO5fa75EO LwlfjMBRjj0PxKVpIJ/+H382dDjBgE3Ce4vkMAzo4ZNY/QwTQVHMCYm1UgK7Uu0B1/jUp4hCH84 zcBGEnuZ//61BumSilsCDnVtxQ0PK5/Uy0V2oJ7kgSpcVsMCcXip737kcZrd5jmAhsywsPonWHH +XjXHx38uShVu9354R47MKsRlQp5FVmA== X-Received: by 2002:a05:6a00:ac0f:b0:827:2d0f:1ed3 with SMTP id d2e1a72fcca58-829f7199380mr2087752b3a.56.1773225092254; Wed, 11 Mar 2026 03:31:32 -0700 (PDT) Received: from 1f3ae71dd79f ([115.245.213.202]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829f6eebf57sm2052558b3a.38.2026.03.11.03.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 03:31:31 -0700 (PDT) From: Sanjaikumar V S To: mwalle@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, pratyush@kernel.org, richard@nod.at, sanjaikumar.vs@dicortech.com, sanjaikumarvs@gmail.com, stable@vger.kernel.org, tudor.ambarus@linaro.org, vigneshr@ti.com Subject: [PATCH v4 2/2] mtd: spi-nor: core: Fix AAI mode when dirmap is not available Date: Wed, 11 Mar 2026 10:30:57 +0000 Message-ID: <20260311103057.29-3-sanjaikumarvs@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260311103057.29-1-sanjaikumarvs@gmail.com> References: <20260311103057.29-1-sanjaikumarvs@gmail.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" From: Sanjaikumar V S When the SPI controller lacks direct mapping support, the fallback path in spi_nor_spimem_write_data() uses nor->write_proto based operation template. However, this template uses the standard page program opcode set during probe, not the AAI opcode required for SST flash. Add check for nodirmap flag to ensure the code falls through to spi_nor_spimem_exec_op() path which builds the operation at runtime with the correct program_opcode set by sst_nor_write_data(). Fixes: df5c21002cf4 ("mtd: spi-nor: use spi-mem dirmap API") Cc: stable@vger.kernel.org Signed-off-by: Sanjaikumar V S Reviewed-by: Hendrik Donner Tested-by: Hendrik Donner --- 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 8ffeb41c3e08..cb7f4d447156 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