Thread (33 messages) 33 messages, 7 authors, 2014-07-09

[PATCH v3 5/9] mtd: nand: add sunxi NAND flash controller support

From: computersforpeace@gmail.com (Brian Norris)
Date: 2014-05-20 18:49:48
Also in: linux-devicetree, lkml

On Fri, May 09, 2014 at 06:47:22PM +0200, Boris BREZILLON wrote:
On 09/05/2014 18:03, Ezequiel Garcia wrote:
quoted
On 12 Mar 07:07 PM, Boris BREZILLON wrote:
quoted
--- /dev/null
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -0,0 +1,1276 @@
...
quoted
quoted
+static int sunxi_nand_ecc_init(struct mtd_info *mtd, struct nand_ecc_ctrl *ecc,
+			       struct device_node *np)
+{
+	struct nand_chip *nand = mtd->priv;
+	int ecc_step_size, ecc_strength;
+	int ret;
+
+	ecc_step_size = of_get_nand_ecc_step_size(np);
+	ecc_strength = of_get_nand_ecc_strength(np);
+	if (ecc_step_size > 0 && ecc_strength > 0) {
+		ecc->size = ecc_step_size;
+		ecc->strength = ecc_strength;
+	} else {
+		ecc->size = nand->ecc_step_ds;
+		ecc->strength = nand->ecc_strength_ds;
+	}
+
Shouldn't you check the devicetree value is not weaker than the ONFI-obtained?
I can definitely do that.
You can do that here, but take a look at the discussion Ezequiel and I
had about this:

  http://thread.gmane.org/gmane.linux.drivers.devicetree/67462

We probably don't want to be doing anything drastic like overriding the
device tree configuration. Instead, we might want to stick a warning
into the core nand_base code that does the proper comparison of the
'*_ds' values with the actual values chosen in
chip->ecc->{size,strength}. The comparison is kind of subtle, actually,
so it'd be good to do it exactly once for everyone.

Brian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help