Re: [PATCH v3 17/22] mtd: spinand: Create direct mapping descriptors for ECC operations

Boris Brezillon
2021-12-07T10:34:57Z

On Tue, 7 Dec 2021 10:34:17 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> /**
> diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
> index 85e2ff7b840d..3be594be24c0 100644
> --- a/include/linux/spi/spi-mem.h
> +++ b/include/linux/spi/spi-mem.h
> @@ -94,6 +94,7 @@ enum spi_mem_data_dir {
> * operation does not involve transferring data
> * @data.buf.in: input buffer (must be DMA-able)
> * @data.buf.out: output buffer (must be DMA-able)
> + * @ecc_en: error correction is required
> */
> struct spi_mem_op {
> struct {
> @@ -126,6 +127,8 @@ struct spi_mem_op {
> const void *out;
> } buf;
> } data;
> +
> + bool ecc_en;
> };

I really think this should be in it's own commit. And you need to make
sure all existing drivers reject operation that have ecc_en set to
true (that shouldn't be too complicated since most of them use generic
helpers to do the check).