FAILED: patch "[PATCH] mtd: spi-nor: spansion: preserve CFR2V[7] when writing MEMLAT" failed to apply to 6.5-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.5-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 <[email protected]>.
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-6.5.y
git checkout FETCH_HEAD
git cherry-pick -x 1e611e104b9acb6310b8c684d5acee0e11ca7bd1
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023091658-glare-spinster-90d6@gregkh' --subject-prefix 'PATCH 6.5.y' HEAD^..
Possible dependencies:
1e611e104b9a ("mtd: spi-nor: spansion: preserve CFR2V[7] when writing MEMLAT") d534fd9787d5 ("mtd: spi-nor: spansion: use CLPEF as an alternative to CLSR")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 1e611e104b9acb6310b8c684d5acee0e11ca7bd1 Mon Sep 17 00:00:00 2001
From: Takahiro Kuwano <[email protected]>
Date: Wed, 26 Jul 2023 10:52:48 +0300
Subject: [PATCH] mtd: spi-nor: spansion: preserve CFR2V[7] when writing MEMLAT
CFR2V[7] is assigned to Flash's address mode (3- or 4-ybte) and must not be changed when writing MEMLAT (CFR2V[3:0]). CFR2V shall be used in a read, update, write back fashion.
drivers/mtd/spi-nor/spansion.c +13 -1
@@ -4,6 +4,7 @@* Copyright (C) 2014, Freescale Semiconductor, Inc. */ +#include <linux/bitfield.h> #include <linux/device.h> #include <linux/mtd/spi-nor.h>
@@ -28,6 +29,7 @@#define SPINOR_REG_CYPRESS_CFR2 0x3#define SPINOR_REG_CYPRESS_CFR2V \ (SPINOR_REG_CYPRESS_VREG + SPINOR_REG_CYPRESS_CFR2) +#define SPINOR_REG_CYPRESS_CFR2_MEMLAT_MASK GENMASK(3, 0)#define SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24 0xb#define SPINOR_REG_CYPRESS_CFR2_ADRBYT BIT(7)#define SPINOR_REG_CYPRESS_CFR3 0x4
@@ -161,8 +163,18 @@ static int cypress_nor_octal_dtr_en(struct spi_nor *nor)int ret;u8 addr_mode_nbytes = nor->params->addr_mode_nbytes; + op = (struct spi_mem_op ) +CYPRESS_NOR_RD_ANY_REG_OP (addr_mode_nbytes, +SPINOR_REG_CYPRESS_CFR2V ,0 , buf); + + ret =spi_nor_read_any_reg (nor, &op, nor->reg_proto); +if (ret) +return ret; +/* Use 24 dummy cycles for memory array reads. */ - *buf =SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24 ; + *buf &= ~SPINOR_REG_CYPRESS_CFR2_MEMLAT_MASK ; + *buf |=FIELD_PREP (SPINOR_REG_CYPRESS_CFR2_MEMLAT_MASK , +SPINOR_REG_CYPRESS_CFR2_MEMLAT_11_24 ); op = (struct spi_mem_op )CYPRESS_NOR_WR_ANY_REG_OP (addr_mode_nbytes,SPINOR_REG_CYPRESS_CFR2V ,1 , buf);