[PATCH 2/2] mtd: rawnand: pl353: Add message about ECC mode

Andrea Scian via B4 Relay posted 2 patches 2 weeks, 5 days ago
There is a newer version of this series
[PATCH 2/2] mtd: rawnand: pl353: Add message about ECC mode
Posted by Andrea Scian via B4 Relay 2 weeks, 5 days ago
From: Andrea Scian <andrea.scian@dave.eu>

This just add some information on kernel log about the selected ECC

Signed-off-by: Andrea Scian <andrea.scian@dave.eu>
---
 drivers/mtd/nand/raw/pl35x-nand-controller.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c
index fcb62b9ec947b..4ce4c6f59b827 100644
--- a/drivers/mtd/nand/raw/pl35x-nand-controller.c
+++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c
@@ -970,16 +970,19 @@ static int pl35x_nand_attach_chip(struct nand_chip *chip)
 
 	switch (chip->ecc.engine_type) {
 	case NAND_ECC_ENGINE_TYPE_ON_DIE:
+		dev_info(nfc->dev, "Using on-die ECC\n");
 		/* Keep these legacy BBT descriptors for ON_DIE situations */
 		chip->bbt_td = &bbt_main_descr;
 		chip->bbt_md = &bbt_mirror_descr;
 		fallthrough;
 	case NAND_ECC_ENGINE_TYPE_NONE:
 	case NAND_ECC_ENGINE_TYPE_SOFT:
+		dev_info(nfc->dev, "Using software ECC (Hamming 1-bit/512B)\n");
 		chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
 		chip->ecc.write_page_raw = nand_monolithic_write_page_raw;
 		break;
 	case NAND_ECC_ENGINE_TYPE_ON_HOST:
+		dev_info(nfc->dev, "Using hardware ECC\n");
 		ret = pl35x_nand_init_hw_ecc_controller(nfc, chip);
 		if (ret)
 			return ret;

-- 
2.43.0
Re: [PATCH 2/2] mtd: rawnand: pl353: Add message about ECC mode
Posted by Michal Simek 2 weeks, 3 days ago

On 1/21/26 16:51, Andrea Scian via B4 Relay wrote:
> From: Andrea Scian <andrea.scian@dave.eu>
> 
> This just add some information on kernel log about the selected ECC
> 
> Signed-off-by: Andrea Scian <andrea.scian@dave.eu>
> ---
>   drivers/mtd/nand/raw/pl35x-nand-controller.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mtd/nand/raw/pl35x-nand-controller.c b/drivers/mtd/nand/raw/pl35x-nand-controller.c
> index fcb62b9ec947b..4ce4c6f59b827 100644
> --- a/drivers/mtd/nand/raw/pl35x-nand-controller.c
> +++ b/drivers/mtd/nand/raw/pl35x-nand-controller.c
> @@ -970,16 +970,19 @@ static int pl35x_nand_attach_chip(struct nand_chip *chip)
>   
>   	switch (chip->ecc.engine_type) {
>   	case NAND_ECC_ENGINE_TYPE_ON_DIE:
> +		dev_info(nfc->dev, "Using on-die ECC\n");
>   		/* Keep these legacy BBT descriptors for ON_DIE situations */
>   		chip->bbt_td = &bbt_main_descr;
>   		chip->bbt_md = &bbt_mirror_descr;
>   		fallthrough;
>   	case NAND_ECC_ENGINE_TYPE_NONE:
>   	case NAND_ECC_ENGINE_TYPE_SOFT:
> +		dev_info(nfc->dev, "Using software ECC (Hamming 1-bit/512B)\n");
>   		chip->ecc.algo = NAND_ECC_ALGO_HAMMING;
>   		chip->ecc.write_page_raw = nand_monolithic_write_page_raw;
>   		break;
>   	case NAND_ECC_ENGINE_TYPE_ON_HOST:
> +		dev_info(nfc->dev, "Using hardware ECC\n");
>   		ret = pl35x_nand_init_hw_ecc_controller(nfc, chip);
>   		if (ret)
>   			return ret;
> 

We are going in a way that we want to have less messages not more.
That's why please move it to dev_dbg() instead.

Thanks,
Michal