linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: <linux-mtd@lists.infradead.org>,
	Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Richard Weinberger <richard@nod.at>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH] mtd: nand: samsung: warn about un-parseable ECC info
Date: Mon,  1 May 2017 17:04:55 -0700	[thread overview]
Message-ID: <20170502000455.13240-6-computersforpeace@gmail.com> (raw)
In-Reply-To: <20170502000455.13240-1-computersforpeace@gmail.com>

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(+)

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 {
-- 
2.13.0.rc1.294.g07d810a77f-goog

  parent reply	other threads:[~2017-05-02  0:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02  0:04 [PATCH] mtd: nand: don't leak buffers when ->scan_bbt() fails Brian Norris
2017-05-02  0:04 ` [PATCH] mtd: nand: don't make vendor-specific code un-set their data pointer Brian Norris
2017-05-02  7:15   ` Boris Brezillon
2017-05-02  0:04 ` [PATCH] mtd: nand: drop unneeded module.h include Brian Norris
2017-05-02  7:16   ` Boris Brezillon
2017-05-15 20:50   ` Boris Brezillon
2017-05-02  0:04 ` [PATCH] mtd: nand: free vendor-specific resources in init failure paths Brian Norris
2017-05-02  7:52   ` Boris Brezillon
2017-05-02 16:15     ` Boris Brezillon
2017-05-15 20:49   ` Boris Brezillon
2017-05-02  0:04 ` [PATCH] mtd: nand: orion: don't complain for probe deferral Brian Norris
2017-05-02  7:56   ` Boris Brezillon
2017-05-02  8:07   ` Simon Baatz
2017-05-08 17:46     ` Brian Norris
2017-05-02  0:04 ` Brian Norris [this message]
2017-05-02  7:57   ` [PATCH] mtd: nand: samsung: warn about un-parseable ECC info Boris Brezillon
2017-05-15 20:48   ` Boris Brezillon
2017-05-02  0:22 ` [PATCH] mtd: nand: don't leak buffers when ->scan_bbt() fails Ezequiel Garcia
2017-05-02  1:33   ` Brian Norris
2017-05-02  2:21     ` Ezequiel Garcia
2017-05-02  7:17 ` Boris Brezillon
2017-05-15 20:50 ` Boris Brezillon

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=20170502000455.13240-6-computersforpeace@gmail.com \
    --to=computersforpeace@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=hdegoede@redhat.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).