diff mbox

mtd: nand: samsung: warn about un-parseable ECC info

Message ID 20170502000455.13240-6-computersforpeace@gmail.com
State Accepted
Commit d24197907454b902908e025bce4b8bc677d3ba6b
Delegated to: Brian Norris
Headers show

Commit Message

Brian Norris May 2, 2017, 12:04 a.m. UTC
We don't handle cases larger than 7. We probably shouldn't pretend we
know the ECC step size in this case, and it's probably also good to
WARN() like we do in many other similar cases.

Cc: Hans de Goede <hdegoede@redhat.com>
Fixes: 8fc82d456e40 ("mtd: nand: samsung: Retrieve ECC requirements from extended ID")
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
Compile tested only

 drivers/mtd/nand/nand_samsung.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Boris Brezillon May 2, 2017, 7:57 a.m. UTC | #1
On Mon,  1 May 2017 17:04:55 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> We don't handle cases larger than 7. We probably shouldn't pretend we
> know the ECC step size in this case, and it's probably also good to
> WARN() like we do in many other similar cases.
> 
> Cc: Hans de Goede <hdegoede@redhat.com>
> Fixes: 8fc82d456e40 ("mtd: nand: samsung: Retrieve ECC requirements from extended ID")
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
> Compile tested only
> 
>  drivers/mtd/nand/nand_samsung.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mtd/nand/nand_samsung.c b/drivers/mtd/nand/nand_samsung.c
> index 9cfc4035a420..1e0755997762 100644
> --- a/drivers/mtd/nand/nand_samsung.c
> +++ b/drivers/mtd/nand/nand_samsung.c
> @@ -84,6 +84,9 @@ static void samsung_nand_decode_id(struct nand_chip *chip)
>  			case 7:
>  				chip->ecc_strength_ds = 60;
>  				break;
> +			default:
> +				WARN(1, "Could not decode ECC info");
> +				chip->ecc_step_ds = 0;
>  			}
>  		}
>  	} else {
Boris Brezillon May 15, 2017, 8:48 p.m. UTC | #2
On Mon,  1 May 2017 17:04:55 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> We don't handle cases larger than 7. We probably shouldn't pretend we
> know the ECC step size in this case, and it's probably also good to
> WARN() like we do in many other similar cases.
> 
> Cc: Hans de Goede <hdegoede@redhat.com>
> Fixes: 8fc82d456e40 ("mtd: nand: samsung: Retrieve ECC requirements from extended ID")
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>

Applied to nand/fixes.

Thanks,

Boris

> ---
> Compile tested only
> 
>  drivers/mtd/nand/nand_samsung.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mtd/nand/nand_samsung.c b/drivers/mtd/nand/nand_samsung.c
> index 9cfc4035a420..1e0755997762 100644
> --- a/drivers/mtd/nand/nand_samsung.c
> +++ b/drivers/mtd/nand/nand_samsung.c
> @@ -84,6 +84,9 @@ static void samsung_nand_decode_id(struct nand_chip *chip)
>  			case 7:
>  				chip->ecc_strength_ds = 60;
>  				break;
> +			default:
> +				WARN(1, "Could not decode ECC info");
> +				chip->ecc_step_ds = 0;
>  			}
>  		}
>  	} else {
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_samsung.c b/drivers/mtd/nand/nand_samsung.c
index 9cfc4035a420..1e0755997762 100644
--- a/drivers/mtd/nand/nand_samsung.c
+++ b/drivers/mtd/nand/nand_samsung.c
@@ -84,6 +84,9 @@  static void samsung_nand_decode_id(struct nand_chip *chip)
 			case 7:
 				chip->ecc_strength_ds = 60;
 				break;
+			default:
+				WARN(1, "Could not decode ECC info");
+				chip->ecc_step_ds = 0;
 			}
 		}
 	} else {