mtd: rawnand: micron: don't error out if internal ECC is set
Subsystems (2)
PATCH 1/1 mtd: rawnand: micron: don't error out if internal ECC is set
From: Zak Hays <[email protected]>
Recent changes to the driver require use of on-die correction if the internal ECC enable bit is set. On some Micron parts, this bit is enabled by default and there is no method for disabling it.
This is a false assumption though as that bit being enabled does not necessarily mean that the on-die ECC *has* to be used. It has been verified with a Micron FAE that other methods of error correction are still valid even if this bit is set.
HW ECC offers generally higher performance than on-die so it is preferred in some situations. This also allows multiple NAND parts to be supported on the same PCB as some parts may not support on-die error correction.
With that in mind, only throw a warning that the on-die bit is set and allow the init to continue.
--- drivers/mtd/nand/raw/nand_micron.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/nand/raw/nand_micron.c +1 -3
@@ -455,9 +455,7 @@ static int micron_nand_init(struct nand_chip *chip)if (ondie ==MICRON_ON_DIE_MANDATORY && chip->ecc.mode !=NAND_ECC_ON_DIE ) { -pr_err ("On-die ECC forcefully enabled, not supported\n" ); - ret = -EINVAL ; - goto err_free_manuf_data; +pr_warn ("WARNING: On-die ECC forcefully enabled, use caution with other methods\n" ); }if (chip->ecc.mode ==NAND_ECC_ON_DIE ) {
Signature · 1 line
2.17.1
Miquel Raynal
maintainerHi Zak,
[email protected] wrote on Fri, 10 Jan 2020 11:25:01 -0500:
Quoted 11 lines
From: Zak Hays <[email protected]>
Recent changes to the driver require use of on-die correction if the internal ECC enable bit is set. On some Micron parts, this bit is enabled by default and there is no method for disabling it.
This is a false assumption though as that bit being enabled does not necessarily mean that the on-die ECC *has* to be used. It has been verified with a Micron FAE that other methods of error correction are still valid even if this bit is set.
Quoted 7 lines
HW ECC offers generally higher performance than on-die so it is preferred in some situations. This also allows multiple NAND parts to be supported on the same PCB as some parts may not support on-die error correction.
With that in mind, only throw a warning that the on-die bit is set and allow the init to continue.
I don't think I can take this patch as-is. We must find a reliable way to discriminate Micron parts features. If we cannot (I think we can't before of the endless list of bugs they have introduced without documenting them), the best way is to build a static table.
Quoted 11 lines
Signed-off-by Zak Hays <[email protected]>--- drivers/mtd/nand/raw/nand_micron.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/nand/raw/nand_micron.c +0
-0
drivers/mtd/nand/raw/nand_micron.c static int micron_nand_init(struct nand_chip *chip) · line 461
Quoted 10 lines
drivers/mtd/nand/raw/nand_micron.c +1
-3@@ -455,9 +455,7 @@ static int micron_nand_init(struct nand_chip *chip)if (ondie ==MICRON_ON_DIE_MANDATORY && chip->ecc.mode !=NAND_ECC_ON_DIE ) { -pr_err ("On-die ECC forcefully enabled, not supported\n" ); - ret = -EINVAL ; - goto err_free_manuf_data; +pr_warn ("WARNING: On-die ECC forcefully enabled, use caution with other methods\n" ); }if (chip->ecc.mode ==NAND_ECC_ON_DIE ) {
Thanks,
Miquèl
Hi Zak, Miquel,
Quoted 9 lines · Miquel Raynal
Hi Zak,
[email protected] wrote on Fri, 10 Jan 2020 11:25:01 -0500:
Quoted 5 lines
From: Zak Hays <[email protected]>
Recent changes to the driver require use of on-die correction if the internal ECC enable bit is set. On some Micron parts, this bit is enabled by default and there is no method for disabling it.
Which changes did you mean here?
Quoted 4 lines
Quoted 4 lines
This is a false assumption though as that bit being enabled does not necessarily mean that the on-die ECC *has* to be used. It has been verified with a Micron FAE that other methods of error correction are still valid even if this bit is set.
It would be cool if a micron FAE can provide a document with all the quirks and how those quirks can be handled.
Quoted 4 lines
Quoted 4 lines
HW ECC offers generally higher performance than on-die so it is preferred in some situations. This also allows multiple NAND parts to be supported on the same PCB as some parts may not support on-die error correction.
By HW ECC you mean the host ecc controller?
Quoted 7 lines
Quoted 2 lines
With that in mind, only throw a warning that the on-die bit is set and allow the init to continue.
I don't think I can take this patch as-is. We must find a reliable way to discriminate Micron parts features. If we cannot (I think we can't before of the endless list of bugs they have introduced without documenting them), the best way is to build a static table.
+1 for 'find a reliable way to discriminate Micron parts features'
Regards,
Marco
Quoted 25 lines
Quoted 11 lines
Signed-off-by Zak Hays <[email protected]>--- drivers/mtd/nand/raw/nand_micron.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/nand/raw/nand_micron.c +0
-0drivers/mtd/nand/raw/nand_micron.c static int micron_nand_init(struct nand_chip *chip) · line 461
Quoted 10 lines
drivers/mtd/nand/raw/nand_micron.c +1
-3@@ -455,9 +455,7 @@ static int micron_nand_init(struct nand_chip *chip)if (ondie ==MICRON_ON_DIE_MANDATORY && chip->ecc.mode !=NAND_ECC_ON_DIE ) { -pr_err ("On-die ECC forcefully enabled, not supported\n" ); - ret = -EINVAL ; - goto err_free_manuf_data; +pr_warn ("WARNING: On-die ECC forcefully enabled, use caution with other methods\n" ); }if (chip->ecc.mode ==NAND_ECC_ON_DIE ) {Thanks,
Miquèl
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
A message that is not in the archive (sent off-list or not yet received): CANZat+hHJy0H17xGmOP003_M1yWesJ2BjoPmW3hr7CS=HuQR+g@mail.gmail.com
Hi Marco & Miquel,
Quoted 8 lines · Marco Felsch
Hi Zak, Miquel,
Quoted 4 lines · Miquel Raynal
Hi Zak,
[email protected] wrote on Fri, 10 Jan 2020 11:25:01 -0500:
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
From: Zak Hays <[email protected]>
Recent changes to the driver require use of on-die correction if the internal ECC enable bit is set. On some Micron parts, this bit is enabled by default and there is no method for disabling it.
Which changes did you mean here?
I was referring to the combination of these two patches:
9748e1d87573 Thomas Petazzoni mtd: nand: add support for Micron on-die ECC cb2bf403a462 Chris Packham mtd: rawnand: micron: allow forced on-die ECC
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
This is a false assumption though as that bit being enabled does not necessarily mean that the on-die ECC *has* to be used. It has been verified with a Micron FAE that other methods of error correction are still valid even if this bit is set.
It would be cool if a micron FAE can provide a document with all the quirks and how those quirks can be handled.
Agreed. I'll ask my contact at Micron if such a document exists and if they would be willing to share it.
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
HW ECC offers generally higher performance than on-die so it is preferred in some situations. This also allows multiple NAND parts to be supported on the same PCB as some parts may not support on-die error correction.
By HW ECC you mean the host ecc controller?
Yes. I used the term HW ECC as that is how it is referenced in the device tree (nand-ecc-mode = "hw") and the driver (NAND_ECC_HW).
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
With that in mind, only throw a warning that the on-die bit is set and allow the init to continue.
I don't think I can take this patch as-is. We must find a reliable way to discriminate Micron parts features. If we cannot (I think we can't before of the endless list of bugs they have introduced without documenting them), the best way is to build a static table.
That's understandable. I'll look into this a little more and see if it's feasible to implement a static table to handle this.
Thanks,
Zak
Quoted 63 lines · Zak Hays
Hi Marco & Miquel,
Quoted 8 lines · Marco Felsch
Hi Zak, Miquel,
Quoted 4 lines · Miquel Raynal
Hi Zak,
[email protected] wrote on Fri, 10 Jan 2020 11:25:01 -0500:
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
From: Zak Hays <[email protected]>
Recent changes to the driver require use of on-die correction if the internal ECC enable bit is set. On some Micron parts, this bit is enabled by default and there is no method for disabling it.
Which changes did you mean here?
I was referring to the combination of these two patches:
9748e1d87573Thomas Petazzoni mtd: nand: add support for Micron on-die ECCcb2bf403a462Chris Packham mtd: rawnand: micron: allow forced on-die ECCQuoted 9 lines
Quoted 5 lines
Quoted 5 lines
This is a false assumption though as that bit being enabled does not necessarily mean that the on-die ECC *has* to be used. It has been verified with a Micron FAE that other methods of error correction are still valid even if this bit is set.
It would be cool if a micron FAE can provide a document with all the quirks and how those quirks can be handled.
Agreed. I'll ask my contact at Micron if such a document exists and if they would be willing to share it.
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
HW ECC offers generally higher performance than on-die so it is preferred in some situations. This also allows multiple NAND parts to be supported on the same PCB as some parts may not support on-die error correction.
By HW ECC you mean the host ecc controller?
Yes. I used the term HW ECC as that is how it is referenced in the device tree (nand-ecc-mode = "hw") and the driver (
NAND_ECC_HW).Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
With that in mind, only throw a warning that the on-die bit is set and allow the init to continue.
I don't think I can take this patch as-is. We must find a reliable way to discriminate Micron parts features. If we cannot (I think we can't before of the endless list of bugs they have introduced without documenting them), the best way is to build a static table.
That's understandable. I'll look into this a little more and see if it's feasible to implement a static table to handle this.
Thanks,
Zak