From nobody Sun Feb 8 04:11:31 2026 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.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 67445225415 for ; Sun, 1 Feb 2026 16:58:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769965122; cv=none; b=kB7eFwrH8MH/61Yq12oAM3JXoGcdz+aNQkQYCVwEAstr8pi5Fco6bIGxWZcOz5FDKgWGyMHWc/JQndpd9xgR2+TjM1rWu2+zmeULRugrlsuo5ykixj4s42xuYCX4WLvVMeGAd5UjYo/xUOP061PNYK4QCWkNZA4kvaE5HiDfEiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769965122; c=relaxed/simple; bh=OdAaEFSJaukpevDaQonyqArjBFZiudEKmBCRz2iW6Vw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G6uNpbfl8j+15Q3PZOcIeBJ01y1BMdk9On2BbZOfQsvwnBQbelLOFmhg6FrpW+jg1RO3OLWF/HUrscidmhtOigQvLOAOhQi/MVaD3Kd6w1e+CiARO2CYAyiWbQBiwGJ+CMNbxx+uv2h+wh4hT9Tnxh4NSAL2ysqdMey/YvtVUI4= 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=aZx5HsPk; arc=none smtp.client-ip=209.85.214.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="aZx5HsPk" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2a8fc56a9b2so8264185ad.0 for ; Sun, 01 Feb 2026 08:58:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769965121; x=1770569921; 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=yBfv8eejZu+05bJxMtDkYGwkiaLBdKZ0g8Il/kPgKWI=; b=aZx5HsPk9jqJI7pkLm4FIRfkVQsHdY8divUGDNdWSSuf0npIStYpEvuY+6TqjhLl9Y WMJcm7pyGG3g6uD/SKA95M8v5F2Plb6LQ0OUGd6Z3knOz5E0L/CNtHMvi20hiwK8QA7X Y5uEI/3VVNmOhk5vKcEQQ6gMGC16W6ZrARYO4mnjhL/MMC1UHLFG0hN8+YRlg8lVC9+G 3EQJXClEWuEwLHBJq0WeJ9Z29sUi7eSA1JS92Q+2WoGSQ5sgPBtHeeEIDJ9irUj1Ap52 7TmMeupvy6LgPZQ+JoUBG0PGFJuq+KXDuvryOQIe45JZmPthIH9zR8Dd5uY7hdJMXe6W xYtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769965121; x=1770569921; 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=yBfv8eejZu+05bJxMtDkYGwkiaLBdKZ0g8Il/kPgKWI=; b=qnnsMuwxRCM4iKgbsiokZC2S69/BvgbCkaIaHyzaokejtwUJ54wmOHh4QXKAwGZ8Sb 6SI6ICpkVfhHhhJiryb/QvLGcpt7/C4YJhg5ksi5eS4b2xrLwAHtmKiaTUnuFI6kIFTL fM5G2Y85qkWFWBWeMZGQeLEde96NPlLxZSQPEe0LMPYr5YDhxWuDHFyajKddqXl0KabQ K724qqFbCrxm4dvgZaHr1+3cguhR4NQiSzWlkie4BhfJ60w5dqlpEjveZBO5yUjUcYpM izni7+DmLTy21Kwr9c6sqPSYSqALAkCoKPk8WFiZsU8Ju/I7w72ZJ9jU0odJQVy/W3F9 dg1A== X-Forwarded-Encrypted: i=1; AJvYcCWRJun0kGKt1f/Rwfk6IvYLcM+XMZtDysD0Qxj3vvPWyY7Vb57nUIz34YMpgFSWq3pO41efKnaiElMXE/g=@vger.kernel.org X-Gm-Message-State: AOJu0Yy38C/ohUZdYD6jbiw5Gl4b5aP2M0Yjy99FCUy4UX0N4KjEBl3N ivlf06Ddzin4RLH9MYVR4eS4Pbdah5WK5GFKGU9F+pbu0ROPfTuHaKZ0 X-Gm-Gg: AZuq6aI3fB0LNCtvl4xHmZRD9jLsTUdZokM2mrs0qAxoH3mFw2l3hgL1WGGBXW5bMSO iZ3KgZEw1T3IDu4ritIQZs8dsSwmV1AmUYA96WyLf+3KWDnFnWtaDaIthTB9e25Qxrl4alJ/178 DjSDOy/7531Sp4rfDOkpftlhK0qUrxVuJZcqCea58M/3I7NgBizAvaCdFhyYMqCQYF6HRWs+Xhe I7IugT7buIe97zu4k4AoWx8tr6u9QUHmZAWaX11b3N3Gwfy0Sckz46LgcwyF9xFa/NelReq2brN LQ+4zcpQwpYP+JOpIM9eLo3IYnW2SuUqAxVjQe4QU0GXPCWmvc0XRlKvPjS9M9BQH7talE9zCe1 bHHQfkIM6gvEQCuqv85btSOxeyfJ6SqYfa9m9cbzZ249GhnRwYedOzElwJWSYLXlUns1R12fsWz BEEmLOF/SJD845NUyvKdpZxMRY X-Received: by 2002:a17:903:2389:b0:29e:e925:1abb with SMTP id d9443c01a7336-2a8d96e3de3mr95621095ad.27.1769965120650; Sun, 01 Feb 2026 08:58:40 -0800 (PST) Received: from 4aee0dccb4bc ([115.245.213.202]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a88b4c3afdsm120222755ad.61.2026.02.01.08.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Feb 2026 08:58:39 -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 1/2] mtd: spi-nor: sst: Fix write enable before AAI sequence Date: Sun, 1 Feb 2026 16:58:16 +0000 Message-ID: <20260201165817.53-2-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 writing to SST flash starting at an odd address, a single byte is first programmed using the byte program (BP) command. After this operation completes, the flash hardware automatically clears the Write Enable Latch (WEL) bit. If an AAI (Auto Address Increment) word program sequence follows, it requires WEL to be set. Without re-enabling writes, the AAI sequence fails. Add spi_nor_write_enable() after the odd-address byte program, but only when an AAI sequence will follow (len > 2 bytes remaining). Cc: stable@vger.kernel.org Signed-off-by: Sanjaikumar V S --- drivers/mtd/spi-nor/sst.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c index 175211fe6a5e..fe714e6d0914 100644 --- a/drivers/mtd/spi-nor/sst.c +++ b/drivers/mtd/spi-nor/sst.c @@ -210,6 +210,13 @@ static int sst_nor_write(struct mtd_info *mtd, loff_t = to, size_t len, =20 to++; actual++; + + /* BP clears WEL, re-enable if AAI sequence follows */ + if (actual < len - 1) { + ret =3D spi_nor_write_enable(nor); + if (ret) + goto out; + } } =20 /* Write out most of the data here. */ --=20 2.43.0