From: Boris Brezillon <boris.brezillon@collabora•com>
To: Miquel Raynal <miquel.raynal@bootlin•com>
Cc: Mark Rutland <mark.rutland@arm•com>,
devicetree@vger•kernel.org, Vignesh Raghavendra <vigneshr@ti•com>,
Tudor Ambarus <Tudor.Ambarus@microchip•com>,
Julien Su <juliensu@mxic•com.tw>,
Richard Weinberger <richard@nod•at>,
Weijie Gao <weijie.gao@mediatek•com>,
Paul Cercueil <paul@crapouillou•net>,
Rob Herring <robh+dt@kernel•org>,
linux-mtd@lists•infradead.org,
Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
Mason Yang <masonccyang@mxic•com.tw>,
Chuanhong Guo <gch981213@gmail•com>,
linux-arm-kernel@lists•infradead.org
Subject: Re: [PATCH v6 14/18] mtd: nand: Add more parameters to the nand_ecc_props structure
Date: Thu, 28 May 2020 16:34:24 +0200 [thread overview]
Message-ID: <20200528163424.6677597c@collabora.com> (raw)
In-Reply-To: <20200528113113.9166-15-miquel.raynal@bootlin.com>
On Thu, 28 May 2020 13:31:09 +0200
Miquel Raynal <miquel.raynal@bootlin•com> wrote:
> Prepare the migration to the generic ECC framework by adding more
> fields to the nand_ecc_props structure which will be used widely to
> describe different kind of ECC properties.
>
> Doing this imposes to move the engine type, ECC placement and
> algorithm enumerations in a shared place: nand.h.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin•com>
> ---
> include/linux/mtd/nand.h | 52 +++++++++++++++++++++++++++++++++++++
> include/linux/mtd/rawnand.h | 44 -------------------------------
> 2 files changed, 52 insertions(+), 44 deletions(-)
>
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 6add464fd18b..2e9af24936cd 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -127,14 +127,66 @@ struct nand_page_io_req {
> int mode;
> };
>
> +/**
> + * enum nand_ecc_engine_type - NAND ECC engine type
> + * @NAND_ECC_ENGINE_TYPE_INVALID: Invalid value
> + * @NAND_ECC_ENGINE_TYPE_NONE: No ECC correction
> + * @NAND_ECC_ENGINE_TYPE_SOFT: Software ECC correction
> + * @NAND_ECC_ENGINE_TYPE_ON_HOST: On host hardware ECC correction
> + * @NAND_ECC_ENGINE_TYPE_ON_DIE: On chip hardware ECC correction
> + */
> +enum nand_ecc_engine_type {
> + NAND_ECC_ENGINE_TYPE_INVALID,
> + NAND_ECC_ENGINE_TYPE_NONE,
> + NAND_ECC_ENGINE_TYPE_SOFT,
> + NAND_ECC_ENGINE_TYPE_ON_HOST,
> + NAND_ECC_ENGINE_TYPE_ON_DIE,
> +};
> +
> +/**
> + * enum nand_ecc_placement - NAND ECC bytes placement
> + * @NAND_ECC_PLACEMENT_UNKNOWN: The actual position of the ECC bytes is unknown
> + * @NAND_ECC_PLACEMENT_OOB: The ECC bytes are located in the OOB area
> + * @NAND_ECC_PLACEMENT_INTERLEAVED: Syndrome layout, there are ECC bytes
> + * interleaved with regular data in the main
> + * area
> + */
> +enum nand_ecc_placement {
> + NAND_ECC_PLACEMENT_UNKNOWN,
> + NAND_ECC_PLACEMENT_OOB,
> + NAND_ECC_PLACEMENT_INTERLEAVED,
> +};
> +
> +/**
> + * enum nand_ecc_algo - NAND ECC algorithm
> + * @NAND_ECC_ALGO_UNKNOWN: Unknown algorithm
> + * @NAND_ECC_ALGO_HAMMING: Hamming algorithm
> + * @NAND_ECC_ALGO_BCH: Bose-Chaudhuri-Hocquenghem algorithm
> + * @NAND_ECC_ALGO_RS: Reed-Solomon algorithm
> + */
> +enum nand_ecc_algo {
> + NAND_ECC_ALGO_UNKNOWN,
> + NAND_ECC_ALGO_HAMMING,
> + NAND_ECC_ALGO_BCH,
> + NAND_ECC_ALGO_RS,
> +};
> +
> /**
> * struct nand_ecc_props - NAND ECC properties
> + * @engine_type: ECC engine type
> + * @placement: OOB placement (if relevant)
> + * @algo: ECC algorithm (if relevant)
> * @strength: ECC strength
> * @step_size: Number of bytes per step
> + * @flags: Misc properties
I'd like to hear more about that one. What is this about? I'd rather
not add a field if it's not needed.
> */
> struct nand_ecc_props {
> + enum nand_ecc_engine_type engine_type;
> + enum nand_ecc_placement placement;
> + enum nand_ecc_algo algo;
> unsigned int strength;
> unsigned int step_size;
> + unsigned int flags;
> };
>
> #define NAND_ECCREQ(str, stp) { .strength = (str), .step_size = (stp) }
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index c3411a08ce61..8f7f1cce3b4b 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -92,50 +92,6 @@ enum nand_ecc_mode {
> NAND_ECC_ON_DIE,
> };
>
> -/**
> - * enum nand_ecc_engine_type - NAND ECC engine type
> - * @NAND_ECC_ENGINE_TYPE_INVALID: Invalid value
> - * @NAND_ECC_ENGINE_TYPE_NONE: No ECC correction
> - * @NAND_ECC_ENGINE_TYPE_SOFT: Software ECC correction
> - * @NAND_ECC_ENGINE_TYPE_ON_HOST: On host hardware ECC correction
> - * @NAND_ECC_ENGINE_TYPE_ON_DIE: On chip hardware ECC correction
> - */
> -enum nand_ecc_engine_type {
> - NAND_ECC_ENGINE_TYPE_INVALID,
> - NAND_ECC_ENGINE_TYPE_NONE,
> - NAND_ECC_ENGINE_TYPE_SOFT,
> - NAND_ECC_ENGINE_TYPE_ON_HOST,
> - NAND_ECC_ENGINE_TYPE_ON_DIE,
> -};
> -
> -/**
> - * enum nand_ecc_placement - NAND ECC bytes placement
> - * @NAND_ECC_PLACEMENT_UNKNOWN: The actual position of the ECC bytes is unknown
> - * @NAND_ECC_PLACEMENT_OOB: The ECC bytes are located in the OOB area
> - * @NAND_ECC_PLACEMENT_INTERLEAVED: Syndrome layout, there are ECC bytes
> - * interleaved with regular data in the main
> - * area
> - */
> -enum nand_ecc_placement {
> - NAND_ECC_PLACEMENT_UNKNOWN,
> - NAND_ECC_PLACEMENT_OOB,
> - NAND_ECC_PLACEMENT_INTERLEAVED,
> -};
> -
> -/**
> - * enum nand_ecc_algo - NAND ECC algorithm
> - * @NAND_ECC_ALGO_UNKNOWN: Unknown algorithm
> - * @NAND_ECC_ALGO_HAMMING: Hamming algorithm
> - * @NAND_ECC_ALGO_BCH: Bose-Chaudhuri-Hocquenghem algorithm
> - * @NAND_ECC_ALGO_RS: Reed-Solomon algorithm
> - */
> -enum nand_ecc_algo {
> - NAND_ECC_ALGO_UNKNOWN,
> - NAND_ECC_ALGO_HAMMING,
> - NAND_ECC_ALGO_BCH,
> - NAND_ECC_ALGO_RS,
> -};
> -
> /*
> * Constants for Hardware ECC
> */
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-05-28 14:34 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-28 11:30 [PATCH v6 00/18] Introduce the generic ECC engine abstraction Miquel Raynal
2020-05-28 11:30 ` [PATCH v6 01/18] dt-bindings: mtd: Document nand-ecc-placement Miquel Raynal
2020-05-28 12:02 ` Boris Brezillon
2020-05-28 11:30 ` [PATCH v6 02/18] mtd: rawnand: Create a new enumeration to describe OOB placement Miquel Raynal
2020-05-28 12:08 ` Boris Brezillon
2020-05-28 14:10 ` Miquel Raynal
2020-05-28 11:30 ` [PATCH v6 03/18] mtd: rawnand: Separate the ECC engine type and the " Miquel Raynal
2020-05-28 14:14 ` Boris Brezillon
2020-05-28 11:30 ` [PATCH v6 04/18] mtd: rawnand: Create a helper to retrieve the ECC placement Miquel Raynal
2020-05-28 14:22 ` Boris Brezillon
2020-05-28 11:31 ` [PATCH v6 05/18] mtd: rawnand: Add a kernel doc to the ECC algorithm enumeration Miquel Raynal
2020-05-28 14:26 ` Boris Brezillon
2020-05-28 11:31 ` [PATCH v6 06/18] mtd: rawnand: Rename the ECC algorithm enumeration items Miquel Raynal
2020-05-28 14:26 ` Boris Brezillon
2020-05-28 11:31 ` [PATCH v6 07/18] mtd: rawnand: Create a new enumeration to describe properly ECC types Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 08/18] mtd: rawnand: Use the new ECC engine type enumeration Miquel Raynal
2020-05-28 14:31 ` Boris Brezillon
2020-05-28 14:45 ` Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 09/18] mtd: nand: Move nand_device forward declaration to the top Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 10/18] mtd: nand: Add an extra level in the Kconfig hierarchy Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 11/18] mtd: nand: Drop useless 'depends on' in Kconfig Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 12/18] mtd: nand: Add a NAND page I/O request type Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 13/18] mtd: nand: Rename a core structure Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 14/18] mtd: nand: Add more parameters to the nand_ecc_props structure Miquel Raynal
2020-05-28 14:34 ` Boris Brezillon [this message]
2020-05-28 14:57 ` Miquel Raynal
2020-05-28 15:00 ` Boris Brezillon
2020-05-28 15:02 ` Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 15/18] mtd: nand: Introduce the ECC engine abstraction Miquel Raynal
2020-05-28 18:52 ` Boris Brezillon
2020-05-28 23:46 ` Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 16/18] mtd: nand: Convert generic NAND bits to use the ECC framework Miquel Raynal
2020-05-28 14:39 ` Boris Brezillon
2020-05-28 14:49 ` Miquel Raynal
2020-05-28 14:52 ` Boris Brezillon
2020-05-28 15:04 ` Miquel Raynal
2020-05-28 16:00 ` Boris Brezillon
2020-05-28 23:48 ` Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 17/18] mtd: rawnand: Write a compatibility layer Miquel Raynal
2020-05-28 14:42 ` Boris Brezillon
2020-05-28 14:53 ` Miquel Raynal
2020-05-28 11:31 ` [PATCH v6 18/18] mtd: rawnand: Move generic bits to the ECC framework Miquel Raynal
2020-05-28 14:45 ` Boris Brezillon
2020-05-28 15:55 ` Boris Brezillon
2020-05-28 15:56 ` Boris Brezillon
2020-05-28 23:55 ` Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200528163424.6677597c@collabora.com \
--to=boris.brezillon@collabora$(echo .)com \
--cc=Tudor.Ambarus@microchip$(echo .)com \
--cc=devicetree@vger$(echo .)kernel.org \
--cc=gch981213@gmail$(echo .)com \
--cc=juliensu@mxic$(echo .)com.tw \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-mtd@lists$(echo .)infradead.org \
--cc=mark.rutland@arm$(echo .)com \
--cc=masonccyang@mxic$(echo .)com.tw \
--cc=miquel.raynal@bootlin$(echo .)com \
--cc=paul@crapouillou$(echo .)net \
--cc=richard@nod$(echo .)at \
--cc=robh+dt@kernel$(echo .)org \
--cc=thomas.petazzoni@bootlin$(echo .)com \
--cc=vigneshr@ti$(echo .)com \
--cc=weijie.gao@mediatek$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox