Re: [PATCH 4/5] mtd: spi-nor Favor the BFPT-parsed Quad Enable method

From: Tudor.Ambarus
Date: Wed Mar 09 2022 - 09:22:40 EST


On 3/9/22 16:17, Tudor Ambarus wrote:
> JESD216 SFDP defines in the BFPT standard methods to enable Quad Mode. The
> flash parameters and settings that are retrieved from SFDP have higher
> precedence than the static initialized ones, because they should be more
> accurate and less error prone than those initialized statically. Favor the
> BFPT-parsed Quad Enable method and use the generic core methods where
> possible.
> This patch may introduce regressions in case BFPT contains wrong data. The
> fix is to introduce a post_bfpt() fixup hook and update the wrong BFPT
> data.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
> ---
> drivers/mtd/spi-nor/core.c | 5 +++--
> drivers/mtd/spi-nor/issi.c | 4 ++--
> drivers/mtd/spi-nor/macronix.c | 14 ++++++--------
> 3 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 5de46a786cc5..9a5299a7b212 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -2427,9 +2427,11 @@ static void spi_nor_late_init_params(struct spi_nor *nor)
> if (nor->info->fixups && nor->info->fixups->late_init)
> nor->info->fixups->late_init(nor);
>
> - /* Default method kept for backward compatibility. */
> + /* Default methods kept for backward compatibility. */
> if (!params->set_4byte_addr_mode)
> params->set_4byte_addr_mode = spi_nor_set_4byte_addr_mode_brwr;
> + if (!params->quad_enable)
> + params->quad_enable = spi_nor_sr2_bit1_quad_enable;
>

oops, this will break micron-st since they explicitly clear the quad_enable
method. Let me respin this patch.