From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AE5334028F for ; Mon, 4 May 2026 08:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777883899; cv=none; b=QYjKCCxOdDUxlB6uJIR5q48OQJwJfa8rFlIowxyHJXKkCfmfN1PorTs9yzTFxNXDDgW+g9CqhwoDh3GI9k+h2t/ptAW1n0rxQVQzqeUPDFMThSzbaiJoYS8Az8b57+pmG7t5QjTvZjrr4XiXkXLZa6+UomvVSgcINFKyPBSSAL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777883899; c=relaxed/simple; bh=TES4ytD2mhOLzOUd/VaAQlMDu3nCWNs46XA11+Oqnjk=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=MIXAaFhQ8g3t1f8V2xl5URH91BsYhrRviGumj1dKNy52ugTAgFk1C1Sw943zIoz44/WKxH+FgebSEJUbaAJjMcvQG0R9oK8E7uHrax/Arbp0kUHi3awll1PYP0K2qi6hPsCrxSb2FNpaA1tqlfD/iz4IbzW8BlheVAd21psP48c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Z70Fmuaj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Z70Fmuaj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 785A4C2BCB8; Mon, 4 May 2026 08:38:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777883898; bh=TES4ytD2mhOLzOUd/VaAQlMDu3nCWNs46XA11+Oqnjk=; h=Subject:To:Cc:From:Date:From; b=Z70Fmuaj5pWRHnA2TeMthPoVjNSeImMP1dw7GWSHOGRfQUQyg3EHfhHgjXDwtoipO d0wgVSZsBnvGEufFKlOmL97t1JaoUASU16tLYasBDh9JEZgR+f7kkU+pcS6raM2Fns XuhneXjsAvudCgGS3sZ66Flb8myjzubRcxips4xE= Subject: FAILED: patch "[PATCH] mtd: spi-nor: sst: Fix write enable before AAI sequence" failed to apply to 5.10-stable tree To: sanjaikumar.vs@dicortech.com,hd@os-cillation.de,pratyush@kernel.org Cc: From: Date: Mon, 04 May 2026 10:38:06 +0200 Message-ID: <2026050406-underrate-pardon-df1c@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x a0f64241d3566a49c0a9b33ba7ae458ae22003a9 # git commit -s git send-email --to '' --in-reply-to '2026050406-underrate-pardon-df1c@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From a0f64241d3566a49c0a9b33ba7ae458ae22003a9 Mon Sep 17 00:00:00 2001 From: Sanjaikumar V S Date: Wed, 11 Mar 2026 10:30:56 +0000 Subject: [PATCH] mtd: spi-nor: sst: Fix write enable before AAI sequence 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 when more data needs to be written. Use a local boolean for clarity. Fixes: b199489d37b2 ("mtd: spi-nor: add the framework for SPI NOR") Cc: stable@vger.kernel.org Signed-off-by: Sanjaikumar V S Tested-by: Hendrik Donner Reviewed-by: Hendrik Donner Signed-off-by: Pratyush Yadav (Google) diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c index 175211fe6a5e..db02c14ba16f 100644 --- a/drivers/mtd/spi-nor/sst.c +++ b/drivers/mtd/spi-nor/sst.c @@ -203,6 +203,8 @@ static int sst_nor_write(struct mtd_info *mtd, loff_t to, size_t len, /* Start write from odd address. */ if (to % 2) { + bool needs_write_enable = (len > 1); + /* write one byte. */ ret = sst_nor_write_data(nor, to, 1, buf); if (ret < 0) @@ -210,6 +212,17 @@ static int sst_nor_write(struct mtd_info *mtd, loff_t to, size_t len, to++; actual++; + + /* + * Byte program clears the write enable latch. If more + * data needs to be written using the AAI sequence, + * re-enable writes. + */ + if (needs_write_enable) { + ret = spi_nor_write_enable(nor); + if (ret) + goto out; + } } /* Write out most of the data here. */