Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()

2020-06-03 Thread Boris Brezillon
On Wed, 3 Jun 2020 15:58:02 +0200
Miquel Raynal  wrote:

> Boris Brezillon  wrote on Wed,  3 Jun
> 2020 15:49:17 +0200:
> 
> > Replace the of_address_to_resource() + devm_ioremap() calls by
> > platform_get_resource() + devm_ioremap_resource() ones which allows us
> > to get rid of one error message since devm_ioremap_resource() already
> > takes care of that.
> > 
> > Signed-off-by: Boris Brezillon 
> > ---
> >  drivers/mtd/nand/raw/fsl_upm.c | 23 +++
> >  1 file changed, 7 insertions(+), 16 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
> > index a3e3a968891d..54851e9ea784 100644
> > --- a/drivers/mtd/nand/raw/fsl_upm.c
> > +++ b/drivers/mtd/nand/raw/fsl_upm.c
> > @@ -14,7 +14,6 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -197,7 +196,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
> >  static int fun_probe(struct platform_device *ofdev)
> >  {
> > struct fsl_upm_nand *fun;
> > -   struct resource io_res;
> > +   struct resource *io_res;
> > const __be32 *prop;
> > int rnb_gpio;
> > int ret;
> > @@ -208,13 +207,12 @@ static int fun_probe(struct platform_device *ofdev)
> > if (!fun)
> > return -ENOMEM;
> >  
> > -   ret = of_address_to_resource(ofdev->dev.of_node, 0, _res);
> > -   if (ret) {
> > -   dev_err(>dev, "can't get IO base\n");
> > -   return ret;
> > -   }
> > +   io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> > +   fun->io_base = devm_ioremap_resource(>dev, io_res);  
> 
> Why not even using devm_platform_ioremap_resource() resource directly?

Because I need to pass the resource to fsl_upm_find().


Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name

2020-06-03 Thread Boris Brezillon
On Wed, 3 Jun 2020 15:55:31 +0200
Miquel Raynal  wrote:

> Boris Brezillon  wrote on Wed,  3 Jun
> 2020 15:49:16 +0200:
> 
> > This simplifies the init() error path and the remove() handler.
> > 
> > Signed-off-by: Boris Brezillon 
> > ---
> >  drivers/mtd/nand/raw/fsl_upm.c | 8 +++-
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
> > index 9cf79c62ef22..a3e3a968891d 100644
> > --- a/drivers/mtd/nand/raw/fsl_upm.c
> > +++ b/drivers/mtd/nand/raw/fsl_upm.c
> > @@ -176,8 +176,9 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
> > return -ENODEV;
> >  
> > nand_set_flash_node(>chip, flash_np);
> > -   mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%pOFn", (u64)io_res->start,
> > - flash_np);
> > +   mtd->name = devm_kasprintf(fun->dev, GFP_KERNEL, "0x%llx.%pOFn",
> > +  (u64)io_res->start,
> > +  flash_np);  
> 
> Shouldn't we check if mtd->name was not already set by
> nand_set_flash_node() first?
> 

We could, but let's see if we find someone to test those changes first.


[PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags

2020-06-03 Thread Boris Brezillon
Those properties are no longer parsed by the driver which is being passed
those information by the core now. Let's deprecate them.

Signed-off-by: Boris Brezillon 
---
 Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt 
b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
index fce4894f5a98..25f07c1f9e44 100644
--- a/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
@@ -7,14 +7,16 @@ Required properties:
 - fsl,upm-cmd-offset : UPM pattern offset for the command latch.
 
 Optional properties:
-- fsl,upm-wait-flags : add chip-dependent short delays after running the
-   UPM pattern (0x1), after writing a data byte (0x2) or after
-   writing out a buffer (0x4).
 - fsl,upm-addr-line-cs-offsets : address offsets for multi-chip support.
The corresponding address lines are used to select the chip.
 - gpios : may specify optional GPIOs connected to the Ready-Not-Busy pins
(R/B#). For multi-chip devices, "n" GPIO definitions are required
according to the number of chips.
+
+Deprecated properties:
+- fsl,upm-wait-flags : add chip-dependent short delays after running the
+   UPM pattern (0x1), after writing a data byte (0x2) or after
+   writing out a buffer (0x4).
 - chip-delay : chip dependent delay for transferring data from array to
read registers (tR). Required if property "gpios" is not used
(R/B# pins not connected).
@@ -52,8 +54,6 @@ upm@3,0 {
fsl,upm-cmd-offset = <0x08>;
/* Multi-chip NAND device */
fsl,upm-addr-line-cs-offsets = <0x0 0x200>;
-   fsl,upm-wait-flags = <0x5>;
-   chip-delay = <25>; // in micro-seconds
 
nand@0 {
#address-cells = <1>;
-- 
2.25.4



[PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name

2020-06-03 Thread Boris Brezillon
This simplifies the init() error path and the remove() handler.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 9cf79c62ef22..a3e3a968891d 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -176,8 +176,9 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
return -ENODEV;
 
nand_set_flash_node(>chip, flash_np);
-   mtd->name = kasprintf(GFP_KERNEL, "0x%llx.%pOFn", (u64)io_res->start,
- flash_np);
+   mtd->name = devm_kasprintf(fun->dev, GFP_KERNEL, "0x%llx.%pOFn",
+  (u64)io_res->start,
+  flash_np);
if (!mtd->name) {
ret = -ENOMEM;
goto err;
@@ -190,8 +191,6 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
ret = mtd_device_register(mtd, NULL, 0);
 err:
of_node_put(flash_np);
-   if (ret)
-   kfree(mtd->name);
return ret;
 }
 
@@ -318,7 +317,6 @@ static int fun_remove(struct platform_device *ofdev)
ret = mtd_device_unregister(mtd);
WARN_ON(ret);
nand_cleanup(chip);
-   kfree(mtd->name);
 
for (i = 0; i < fun->mchip_count; i++) {
if (fun->rnb_gpio[i] < 0)
-- 
2.25.4



[PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()

2020-06-03 Thread Boris Brezillon
This simplifies the init error patch and remove function.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 6eba2f4a2f5a..9cf79c62ef22 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -205,36 +205,34 @@ static int fun_probe(struct platform_device *ofdev)
int size;
int i;
 
-   fun = kzalloc(sizeof(*fun), GFP_KERNEL);
+   fun = devm_kzalloc(>dev, sizeof(*fun), GFP_KERNEL);
if (!fun)
return -ENOMEM;
 
ret = of_address_to_resource(ofdev->dev.of_node, 0, _res);
if (ret) {
dev_err(>dev, "can't get IO base\n");
-   goto err1;
+   return ret;
}
 
ret = fsl_upm_find(io_res.start, >upm);
if (ret) {
dev_err(>dev, "can't find UPM\n");
-   goto err1;
+   return ret;
}
 
prop = of_get_property(ofdev->dev.of_node, "fsl,upm-addr-offset",
   );
if (!prop || size != sizeof(uint32_t)) {
dev_err(>dev, "can't get UPM address offset\n");
-   ret = -EINVAL;
-   goto err1;
+   return -EINVAL;
}
fun->upm_addr_offset = *prop;
 
prop = of_get_property(ofdev->dev.of_node, "fsl,upm-cmd-offset", );
if (!prop || size != sizeof(uint32_t)) {
dev_err(>dev, "can't get UPM command offset\n");
-   ret = -EINVAL;
-   goto err1;
+   return -EINVAL;
}
fun->upm_cmd_offset = *prop;
 
@@ -244,7 +242,7 @@ static int fun_probe(struct platform_device *ofdev)
fun->mchip_count = size / sizeof(uint32_t);
if (fun->mchip_count >= NAND_MAX_CHIPS) {
dev_err(>dev, "too much multiple chips\n");
-   goto err1;
+   return -EINVAL;
}
for (i = 0; i < fun->mchip_count; i++)
fun->mchip_offsets[i] = be32_to_cpu(prop[i]);
@@ -306,8 +304,6 @@ static int fun_probe(struct platform_device *ofdev)
break;
gpio_free(fun->rnb_gpio[i]);
}
-err1:
-   kfree(fun);
 
return ret;
 }
@@ -330,8 +326,6 @@ static int fun_remove(struct platform_device *ofdev)
gpio_free(fun->rnb_gpio[i]);
}
 
-   kfree(fun);
-
return 0;
 }
 
-- 
2.25.4



[PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()

2020-06-03 Thread Boris Brezillon
Implement exec_op() so we can get rid of the legacy interface
implementation.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 86 ++
 1 file changed, 86 insertions(+)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 9a63e36825d8..03ca20930274 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -194,6 +194,91 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
return ret;
 }
 
+static int func_exec_instr(struct nand_chip *chip,
+  const struct nand_op_instr *instr)
+{
+   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
+   u32 mar, reg_offs = fun->mchip_offsets[fun->mchip_number];
+   unsigned int i;
+   const u8 *out;
+   u8 *in;
+
+   switch (instr->type) {
+   case NAND_OP_CMD_INSTR:
+   fsl_upm_start_pattern(>upm, fun->upm_cmd_offset);
+   mar = (instr->ctx.cmd.opcode << (32 - fun->upm.width)) |
+ reg_offs;
+   fsl_upm_run_pattern(>upm, fun->io_base + reg_offs, mar);
+   fsl_upm_end_pattern(>upm);
+   return 0;
+
+   case NAND_OP_ADDR_INSTR:
+   fsl_upm_start_pattern(>upm, fun->upm_addr_offset);
+   for (i = 0; i < instr->ctx.addr.naddrs; i++) {
+   mar = (instr->ctx.addr.addrs[i] << (32 - 
fun->upm.width)) |
+ reg_offs;
+   fsl_upm_run_pattern(>upm, fun->io_base + reg_offs, 
mar);
+   }
+   fsl_upm_end_pattern(>upm);
+   return 0;
+
+   case NAND_OP_DATA_IN_INSTR:
+   in = instr->ctx.data.buf.in;
+   for (i = 0; i < instr->ctx.data.len; i++)
+   in[i] = in_8(fun->io_base + reg_offs);
+   return 0;
+
+   case NAND_OP_DATA_OUT_INSTR:
+   out = instr->ctx.data.buf.out;
+   for (i = 0; i < instr->ctx.data.len; i++)
+   out_8(fun->io_base + reg_offs, out[i]);
+   return 0;
+
+   case NAND_OP_WAITRDY_INSTR:
+   if (!fun->rnb_gpio[fun->mchip_number])
+   return nand_soft_waitrdy(chip, 
instr->ctx.waitrdy.timeout_ms);
+
+   return nand_gpio_waitrdy(chip, fun->rnb_gpio[fun->mchip_number],
+instr->ctx.waitrdy.timeout_ms);
+
+   default:
+   return -EINVAL;
+   }
+
+   return 0;
+}
+
+static int fun_exec_op(struct nand_chip *chip, const struct nand_operation *op,
+  bool check_only)
+{
+   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
+   unsigned int i;
+   int ret;
+
+   if (op->cs > NAND_MAX_CHIPS)
+   return -EINVAL;
+
+   if (check_only)
+   return 0;
+
+   fun->mchip_number = op->cs;
+
+   for (i = 0; i < op->ninstrs; i++) {
+   ret = func_exec_instr(chip, >instrs[i]);
+   if (ret)
+   return ret;
+
+   if (op->instrs[i].delay_ns)
+   ndelay(op->instrs[i].delay_ns);
+   }
+
+   return 0;
+}
+
+static const struct nand_controller_ops fun_ops = {
+   .exec_op = fun_exec_op,
+};
+
 static int fun_probe(struct platform_device *ofdev)
 {
struct fsl_upm_nand *fun;
@@ -271,6 +356,7 @@ static int fun_probe(struct platform_device *ofdev)
  FSL_UPM_WAIT_WRITE_BYTE;
 
nand_controller_init(>base);
+   fun->base.ops = _ops;
fun->dev = >dev;
fun->last_ctrl = NAND_CLE;
 
-- 
2.25.4



[PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller

2020-06-03 Thread Boris Brezillon
Explicitly inherit from nand_controller instead of relying on the
nand_chip.legacy.dummy_controller field.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 977b7aad419b..9a63e36825d8 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -24,6 +24,7 @@
 #define FSL_UPM_WAIT_WRITE_BUFFER 0x4
 
 struct fsl_upm_nand {
+   struct nand_controller base;
struct device *dev;
struct nand_chip chip;
int last_ctrl;
@@ -167,6 +168,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
if (!fun->rnb_gpio[0])
fun->chip.legacy.dev_ready = fun_chip_ready;
 
+   fun->chip.controller = >base;
mtd->dev.parent = fun->dev;
 
flash_np = of_get_next_child(upm_np, NULL);
@@ -268,6 +270,7 @@ static int fun_probe(struct platform_device *ofdev)
fun->wait_flags = FSL_UPM_WAIT_RUN_PATTERN |
  FSL_UPM_WAIT_WRITE_BYTE;
 
+   nand_controller_init(>base);
fun->dev = >dev;
fun->last_ctrl = NAND_CLE;
 
-- 
2.25.4



[PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var

2020-06-03 Thread Boris Brezillon
The mtd var in fun_wait_rnb() is now unused, let's get rid of it and
fix the warning resulting from this unused var.

Fixes: 50a487e7719c ("mtd: rawnand: Pass a nand_chip object to 
chip->dev_ready()")
Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 627deb26db51..76d1032cd35e 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -62,7 +62,6 @@ static int fun_chip_ready(struct nand_chip *chip)
 static void fun_wait_rnb(struct fsl_upm_nand *fun)
 {
if (fun->rnb_gpio[fun->mchip_number] >= 0) {
-   struct mtd_info *mtd = nand_to_mtd(>chip);
int cnt = 100;
 
while (--cnt && !fun_chip_ready(>chip))
-- 
2.25.4



[PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation

2020-06-03 Thread Boris Brezillon
Now that the driver implements exec_op(), we can get rid of the legacy
interface implementation.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 133 -
 1 file changed, 133 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 03ca20930274..197850aeb261 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -19,15 +19,10 @@
 #include 
 #include 
 
-#define FSL_UPM_WAIT_RUN_PATTERN  0x1
-#define FSL_UPM_WAIT_WRITE_BYTE   0x2
-#define FSL_UPM_WAIT_WRITE_BUFFER 0x4
-
 struct fsl_upm_nand {
struct nand_controller base;
struct device *dev;
struct nand_chip chip;
-   int last_ctrl;
struct fsl_upm upm;
uint8_t upm_addr_offset;
uint8_t upm_cmd_offset;
@@ -36,8 +31,6 @@ struct fsl_upm_nand {
uint32_t mchip_offsets[NAND_MAX_CHIPS];
uint32_t mchip_count;
uint32_t mchip_number;
-   int chip_delay;
-   uint32_t wait_flags;
 };
 
 static inline struct fsl_upm_nand *to_fsl_upm_nand(struct mtd_info *mtdinfo)
@@ -46,105 +39,6 @@ static inline struct fsl_upm_nand *to_fsl_upm_nand(struct 
mtd_info *mtdinfo)
chip);
 }
 
-static int fun_chip_ready(struct nand_chip *chip)
-{
-   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
-
-   if (gpiod_get_value(fun->rnb_gpio[fun->mchip_number]))
-   return 1;
-
-   dev_vdbg(fun->dev, "busy\n");
-   return 0;
-}
-
-static void fun_wait_rnb(struct fsl_upm_nand *fun)
-{
-   if (fun->rnb_gpio[fun->mchip_number] >= 0) {
-   int cnt = 100;
-
-   while (--cnt && !fun_chip_ready(>chip))
-   cpu_relax();
-   if (!cnt)
-   dev_err(fun->dev, "tired waiting for RNB\n");
-   } else {
-   ndelay(100);
-   }
-}
-
-static void fun_cmd_ctrl(struct nand_chip *chip, int cmd, unsigned int ctrl)
-{
-   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
-   u32 mar;
-
-   if (!(ctrl & fun->last_ctrl)) {
-   fsl_upm_end_pattern(>upm);
-
-   if (cmd == NAND_CMD_NONE)
-   return;
-
-   fun->last_ctrl = ctrl & (NAND_ALE | NAND_CLE);
-   }
-
-   if (ctrl & NAND_CTRL_CHANGE) {
-   if (ctrl & NAND_ALE)
-   fsl_upm_start_pattern(>upm, fun->upm_addr_offset);
-   else if (ctrl & NAND_CLE)
-   fsl_upm_start_pattern(>upm, fun->upm_cmd_offset);
-   }
-
-   mar = (cmd << (32 - fun->upm.width)) |
-   fun->mchip_offsets[fun->mchip_number];
-   fsl_upm_run_pattern(>upm, chip->legacy.IO_ADDR_R, mar);
-
-   if (fun->wait_flags & FSL_UPM_WAIT_RUN_PATTERN)
-   fun_wait_rnb(fun);
-}
-
-static void fun_select_chip(struct nand_chip *chip, int mchip_nr)
-{
-   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
-
-   if (mchip_nr == -1) {
-   chip->legacy.cmd_ctrl(chip, NAND_CMD_NONE, 0 | 
NAND_CTRL_CHANGE);
-   } else if (mchip_nr >= 0 && mchip_nr < NAND_MAX_CHIPS) {
-   fun->mchip_number = mchip_nr;
-   chip->legacy.IO_ADDR_R = fun->io_base + 
fun->mchip_offsets[mchip_nr];
-   chip->legacy.IO_ADDR_W = chip->legacy.IO_ADDR_R;
-   } else {
-   BUG();
-   }
-}
-
-static uint8_t fun_read_byte(struct nand_chip *chip)
-{
-   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
-
-   return in_8(fun->chip.legacy.IO_ADDR_R);
-}
-
-static void fun_read_buf(struct nand_chip *chip, uint8_t *buf, int len)
-{
-   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
-   int i;
-
-   for (i = 0; i < len; i++)
-   buf[i] = in_8(fun->chip.legacy.IO_ADDR_R);
-}
-
-static void fun_write_buf(struct nand_chip *chip, const uint8_t *buf, int len)
-{
-   struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
-   int i;
-
-   for (i = 0; i < len; i++) {
-   out_8(fun->chip.legacy.IO_ADDR_W, buf[i]);
-   if (fun->wait_flags & FSL_UPM_WAIT_WRITE_BYTE)
-   fun_wait_rnb(fun);
-   }
-   if (fun->wait_flags & FSL_UPM_WAIT_WRITE_BUFFER)
-   fun_wait_rnb(fun);
-}
-
 static int fun_chip_init(struct fsl_upm_nand *fun,
 const struct device_node *upm_np,
 const struct resource *io_res)
@@ -153,21 +47,8 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
int ret;
struct device_node *flash_np;
 
-   fun->chip.legacy.IO_ADDR_R = fun->io_base;
-   fun->chip.legacy.IO_ADDR_W = fun->io_base;
-   fun->chip.

[PATCH 00/10] mtd: rawnand: fsl_upm: Convert to exec_op() (and more)

2020-06-03 Thread Boris Brezillon
Hello,

A bit of context to explain the motivation behind those conversions
I've been sending for the last few weeks. The raw NAND subsystem
carries a lot of history which makes any rework not only painful, but
also subject to regressions which we only detect when someone dares to
update its kernel on one of those ancient HW. While carrying drivers
for old HW is not a problem per se, carrying ancient and unmaintained
drivers that are not converted to new APIs is a maintenance burden,
hence this massive conversion attempt I'm conducting here.

So here is a series converting the FSM UPM NAND controller driver to
exec_op(), plus a bunch of minor improvements done along the way.
I hope I'll find someone to test those changes, but if there's no one
still having access to this HW or no interest in keeping it supported
in recent kernel versions, we should definitely consider removing the
driver instead.

Regards,

Boris

Boris Brezillon (10):
  mtd: rawnand: fsl_upm: Remove unused mtd var
  mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
  mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using
devm_kzalloc()
  mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
  mtd: rawnand: fsl_upm: Use platform_get_resource() +
devm_ioremap_resource()
  mtd: rawnand: fsl_upm: Use gpio descriptors
  mtd: rawnand: fsl_upm: Inherit from nand_controller
  mtd: rawnand: fsl_upm: Implement exec_op()
  mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation
  dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and
fsl,upm-wait-flags

 .../devicetree/bindings/mtd/fsl-upm-nand.txt  |  10 +-
 drivers/mtd/nand/raw/fsl_upm.c| 311 +++---
 2 files changed, 117 insertions(+), 204 deletions(-)

-- 
2.25.4



[PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field

2020-06-03 Thread Boris Brezillon
fsl_upm_nand.parts is unused, let's get rid of it.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 76d1032cd35e..6eba2f4a2f5a 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -29,7 +29,6 @@ struct fsl_upm_nand {
struct device *dev;
struct nand_chip chip;
int last_ctrl;
-   struct mtd_partition *parts;
struct fsl_upm upm;
uint8_t upm_addr_offset;
uint8_t upm_cmd_offset;
-- 
2.25.4



[PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors

2020-06-03 Thread Boris Brezillon
The integer-based GPIO ids are now deprecated in favor of the GPIO desc
API. The PPC platforms have already been converted to GPIOLIB, so let's
use gpio descs in the NAND driver too.

While at it, we use devm_gpiod_get_index_optional() so we can get rid
of the manual gpio desc release done in the init error path and in the
remove function.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 44 --
 1 file changed, 10 insertions(+), 34 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index 54851e9ea784..977b7aad419b 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -15,7 +15,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -32,7 +31,7 @@ struct fsl_upm_nand {
uint8_t upm_addr_offset;
uint8_t upm_cmd_offset;
void __iomem *io_base;
-   int rnb_gpio[NAND_MAX_CHIPS];
+   struct gpio_desc *rnb_gpio[NAND_MAX_CHIPS];
uint32_t mchip_offsets[NAND_MAX_CHIPS];
uint32_t mchip_count;
uint32_t mchip_number;
@@ -50,7 +49,7 @@ static int fun_chip_ready(struct nand_chip *chip)
 {
struct fsl_upm_nand *fun = to_fsl_upm_nand(nand_to_mtd(chip));
 
-   if (gpio_get_value(fun->rnb_gpio[fun->mchip_number]))
+   if (gpiod_get_value(fun->rnb_gpio[fun->mchip_number]))
return 1;
 
dev_vdbg(fun->dev, "busy\n");
@@ -165,7 +164,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
if (fun->mchip_count > 1)
fun->chip.legacy.select_chip = fun_select_chip;
 
-   if (fun->rnb_gpio[0] >= 0)
+   if (!fun->rnb_gpio[0])
fun->chip.legacy.dev_ready = fun_chip_ready;
 
mtd->dev.parent = fun->dev;
@@ -198,7 +197,6 @@ static int fun_probe(struct platform_device *ofdev)
struct fsl_upm_nand *fun;
struct resource *io_res;
const __be32 *prop;
-   int rnb_gpio;
int ret;
int size;
int i;
@@ -248,20 +246,12 @@ static int fun_probe(struct platform_device *ofdev)
}
 
for (i = 0; i < fun->mchip_count; i++) {
-   fun->rnb_gpio[i] = -1;
-   rnb_gpio = of_get_gpio(ofdev->dev.of_node, i);
-   if (rnb_gpio >= 0) {
-   ret = gpio_request(rnb_gpio, dev_name(>dev));
-   if (ret) {
-   dev_err(>dev,
-   "can't request RNB gpio #%d\n", i);
-   goto err2;
-   }
-   gpio_direction_input(rnb_gpio);
-   fun->rnb_gpio[i] = rnb_gpio;
-   } else if (rnb_gpio == -EINVAL) {
+   fun->rnb_gpio[i] = devm_gpiod_get_index_optional(>dev,
+NULL, i,
+GPIOD_IN);
+   if (IS_ERR(fun->rnb_gpio[i])) {
dev_err(>dev, "RNB gpio #%d is invalid\n", i);
-   goto err2;
+   return PTR_ERR(fun->rnb_gpio[i]);
}
}
 
@@ -283,19 +273,11 @@ static int fun_probe(struct platform_device *ofdev)
 
ret = fun_chip_init(fun, ofdev->dev.of_node, io_res);
if (ret)
-   goto err2;
+   return ret;
 
dev_set_drvdata(>dev, fun);
 
return 0;
-err2:
-   for (i = 0; i < fun->mchip_count; i++) {
-   if (fun->rnb_gpio[i] < 0)
-   break;
-   gpio_free(fun->rnb_gpio[i]);
-   }
-
-   return ret;
 }
 
 static int fun_remove(struct platform_device *ofdev)
@@ -303,18 +285,12 @@ static int fun_remove(struct platform_device *ofdev)
struct fsl_upm_nand *fun = dev_get_drvdata(>dev);
struct nand_chip *chip = >chip;
struct mtd_info *mtd = nand_to_mtd(chip);
-   int ret, i;
+   int ret;
 
ret = mtd_device_unregister(mtd);
WARN_ON(ret);
nand_cleanup(chip);
 
-   for (i = 0; i < fun->mchip_count; i++) {
-   if (fun->rnb_gpio[i] < 0)
-   break;
-   gpio_free(fun->rnb_gpio[i]);
-   }
-
return 0;
 }
 
-- 
2.25.4



[PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()

2020-06-03 Thread Boris Brezillon
Replace the of_address_to_resource() + devm_ioremap() calls by
platform_get_resource() + devm_ioremap_resource() ones which allows us
to get rid of one error message since devm_ioremap_resource() already
takes care of that.

Signed-off-by: Boris Brezillon 
---
 drivers/mtd/nand/raw/fsl_upm.c | 23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index a3e3a968891d..54851e9ea784 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -197,7 +196,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
 static int fun_probe(struct platform_device *ofdev)
 {
struct fsl_upm_nand *fun;
-   struct resource io_res;
+   struct resource *io_res;
const __be32 *prop;
int rnb_gpio;
int ret;
@@ -208,13 +207,12 @@ static int fun_probe(struct platform_device *ofdev)
if (!fun)
return -ENOMEM;
 
-   ret = of_address_to_resource(ofdev->dev.of_node, 0, _res);
-   if (ret) {
-   dev_err(>dev, "can't get IO base\n");
-   return ret;
-   }
+   io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
+   fun->io_base = devm_ioremap_resource(>dev, io_res);
+   if (IS_ERR(fun->io_base))
+   return PTR_ERR(fun->io_base);
 
-   ret = fsl_upm_find(io_res.start, >upm);
+   ret = fsl_upm_find(io_res->start, >upm);
if (ret) {
dev_err(>dev, "can't find UPM\n");
return ret;
@@ -280,17 +278,10 @@ static int fun_probe(struct platform_device *ofdev)
fun->wait_flags = FSL_UPM_WAIT_RUN_PATTERN |
  FSL_UPM_WAIT_WRITE_BYTE;
 
-   fun->io_base = devm_ioremap(>dev, io_res.start,
-   resource_size(_res));
-   if (!fun->io_base) {
-   ret = -ENOMEM;
-   goto err2;
-   }
-
fun->dev = >dev;
fun->last_ctrl = NAND_CLE;
 
-   ret = fun_chip_init(fun, ofdev->dev.of_node, _res);
+   ret = fun_chip_init(fun, ofdev->dev.of_node, io_res);
if (ret)
goto err2;
 
-- 
2.25.4



Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl,upm-wait-flags

2020-06-03 Thread Boris Brezillon
And I forgot to Cc the DT maintainer/ML on this one :-/

On Wed,  3 Jun 2020 15:49:22 +0200
Boris Brezillon  wrote:

> Those properties are no longer parsed by the driver which is being passed
> those information by the core now. Let's deprecate them.
> 
> Signed-off-by: Boris Brezillon 
> ---
>  Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt 
> b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
> index fce4894f5a98..25f07c1f9e44 100644
> --- a/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
> +++ b/Documentation/devicetree/bindings/mtd/fsl-upm-nand.txt
> @@ -7,14 +7,16 @@ Required properties:
>  - fsl,upm-cmd-offset : UPM pattern offset for the command latch.
>  
>  Optional properties:
> -- fsl,upm-wait-flags : add chip-dependent short delays after running the
> - UPM pattern (0x1), after writing a data byte (0x2) or after
> - writing out a buffer (0x4).
>  - fsl,upm-addr-line-cs-offsets : address offsets for multi-chip support.
>   The corresponding address lines are used to select the chip.
>  - gpios : may specify optional GPIOs connected to the Ready-Not-Busy pins
>   (R/B#). For multi-chip devices, "n" GPIO definitions are required
>   according to the number of chips.
> +
> +Deprecated properties:
> +- fsl,upm-wait-flags : add chip-dependent short delays after running the
> + UPM pattern (0x1), after writing a data byte (0x2) or after
> + writing out a buffer (0x4).
>  - chip-delay : chip dependent delay for transferring data from array to
>   read registers (tR). Required if property "gpios" is not used
>   (R/B# pins not connected).
> @@ -52,8 +54,6 @@ upm@3,0 {
>   fsl,upm-cmd-offset = <0x08>;
>   /* Multi-chip NAND device */
>   fsl,upm-addr-line-cs-offsets = <0x0 0x200>;
> - fsl,upm-wait-flags = <0x5>;
> - chip-delay = <25>; // in micro-seconds
>  
>   nand@0 {
>   #address-cells = <1>;



Re: [v3, 1/2] drivers/mtd: Use mtd->name when registering nvmem device

2019-02-14 Thread Boris Brezillon
From: Boris Brezillon 

On Mon, 2019-02-11 at 13:33:37 UTC, "Aneesh Kumar K.V" wrote:
> With this patch, we use the mtd->name instead of concatenating the name with 
> '0'
> 
> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem 
> API")
> Signed-off-by: Aneesh Kumar K.V 

Applied to http://git.infradead.org/linux-mtd.git mtd/fixes, thanks.

Boris


Re: [v3,2/2] drivers/mtd: Fix device registration error

2019-02-14 Thread Boris Brezillon
From: Boris Brezillon 

On Mon, 2019-02-11 at 13:33:38 UTC, "Aneesh Kumar K.V" wrote:
> This change helps me to get multiple mtd device registered. Without this
> I get
> 
> sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
> Call Trace:
> [c000b38e3220] [c0b58fe4] dump_stack+0xe8/0x164 (unreliable)
> [c000b38e3270] [c04cf074] sysfs_warn_dup+0x84/0xb0
> [c000b38e32f0] [c04cf6c4] 
> sysfs_do_create_link_sd.isra.0+0x114/0x150
> [c000b38e3340] [c0726a84] bus_add_device+0x94/0x1e0
> [c000b38e33c0] [c07218f0] device_add+0x4d0/0x830
> [c000b38e3480] [c09d54a8] nvmem_register.part.2+0x1c8/0xb30
> [c000b38e3560] [c0834530] mtd_nvmem_add+0x90/0x120
> [c000b38e3650] [c0835bc8] add_mtd_device+0x198/0x4e0
> [c000b38e36f0] [c083619c] mtd_device_parse_register+0x11c/0x280
> [c000b38e3780] [c0840830] powernv_flash_probe+0x180/0x250
> [c000b38e3820] [c072c120] platform_drv_probe+0x60/0xf0
> [c000b38e38a0] [c07283c8] really_probe+0x138/0x4d0
> [c000b38e3930] [c0728acc] driver_probe_device+0x13c/0x1b0
> [c000b38e39b0] [c0728c7c] __driver_attach+0x13c/0x1c0
> [c000b38e3a30] [c0725130] bus_for_each_dev+0xa0/0x120
> [c000b38e3a90] [c0727b2c] driver_attach+0x2c/0x40
> [c000b38e3ab0] [c07270f8] bus_add_driver+0x228/0x360
> [c000b38e3b40] [c072a2e0] driver_register+0x90/0x1a0
> [c000b38e3bb0] [c072c020] __platform_driver_register+0x50/0x70
> [c000b38e3bd0] [c105c984] powernv_flash_driver_init+0x24/0x38
> [c000b38e3bf0] [c0010904] do_one_initcall+0x84/0x464
> [c000b38e3cd0] [c1004548] kernel_init_freeable+0x530/0x634
> [c000b38e3db0] [c0011154] kernel_init+0x1c/0x168
> [c000b38e3e20] [c000bed4] ret_from_kernel_thread+0x5c/0x68
> mtd mtd1: Failed to register NVMEM device
> 
> With the change we now have
> 
> root@(none):/sys/bus/nvmem/devices# ls -al
> total 0
> drwxr-xr-x 2 root root 0 Feb  6 20:49 .
> drwxr-xr-x 4 root root 0 Feb  6 20:49 ..
> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@0 -> 
> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@1 -> 
> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1
> 
> Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of 
> device_node.name")
> Signed-off-by: Aneesh Kumar K.V 

Applied to http://git.infradead.org/linux-mtd.git mtd/fixes, thanks.

Boris


Re: [PATCH v3 2/2] drivers/mtd: Fix device registration error

2019-02-13 Thread Boris Brezillon
Subject prefix should be "mtd: powernv_flash: "

On Mon, 11 Feb 2019 19:03:38 +0530
"Aneesh Kumar K.V"  wrote:

> This change helps me to get multiple mtd device registered. Without this
> I get
> 
> sysfs: cannot create duplicate filename '/bus/nvmem/devices/flash0'
> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2-00557-g1ef20ef21f22 #13
> Call Trace:
> [c000b38e3220] [c0b58fe4] dump_stack+0xe8/0x164 (unreliable)
> [c000b38e3270] [c04cf074] sysfs_warn_dup+0x84/0xb0
> [c000b38e32f0] [c04cf6c4] 
> sysfs_do_create_link_sd.isra.0+0x114/0x150
> [c000b38e3340] [c0726a84] bus_add_device+0x94/0x1e0
> [c000b38e33c0] [c07218f0] device_add+0x4d0/0x830
> [c000b38e3480] [c09d54a8] nvmem_register.part.2+0x1c8/0xb30
> [c000b38e3560] [c0834530] mtd_nvmem_add+0x90/0x120
> [c000b38e3650] [c0835bc8] add_mtd_device+0x198/0x4e0
> [c000b38e36f0] [c083619c] mtd_device_parse_register+0x11c/0x280
> [c000b38e3780] [c0840830] powernv_flash_probe+0x180/0x250
> [c000b38e3820] [c072c120] platform_drv_probe+0x60/0xf0
> [c000b38e38a0] [c07283c8] really_probe+0x138/0x4d0
> [c000b38e3930] [c0728acc] driver_probe_device+0x13c/0x1b0
> [c000b38e39b0] [c0728c7c] __driver_attach+0x13c/0x1c0
> [c000b38e3a30] [c0725130] bus_for_each_dev+0xa0/0x120
> [c000b38e3a90] [c0727b2c] driver_attach+0x2c/0x40
> [c000b38e3ab0] [c07270f8] bus_add_driver+0x228/0x360
> [c000b38e3b40] [c072a2e0] driver_register+0x90/0x1a0
> [c000b38e3bb0] [c072c020] __platform_driver_register+0x50/0x70
> [c000b38e3bd0] [c105c984] powernv_flash_driver_init+0x24/0x38
> [c000b38e3bf0] [c0010904] do_one_initcall+0x84/0x464
> [c000b38e3cd0] [c1004548] kernel_init_freeable+0x530/0x634
> [c000b38e3db0] [c0011154] kernel_init+0x1c/0x168
> [c000b38e3e20] [c000bed4] ret_from_kernel_thread+0x5c/0x68
> mtd mtd1: Failed to register NVMEM device
> 
> With the change we now have
> 
> root@(none):/sys/bus/nvmem/devices# ls -al
> total 0
> drwxr-xr-x 2 root root 0 Feb  6 20:49 .
> drwxr-xr-x 4 root root 0 Feb  6 20:49 ..
> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@0 -> 
> ../../../devices/platform/ibm,opal:flash@0/mtd/mtd0/flash@0
> lrwxrwxrwx 1 root root 0 Feb  6 20:49 flash@1 -> 
> ../../../devices/platform/ibm,opal:flash@1/mtd/mtd1/flash@1
> 
> Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of 
> device_node.name")

Actually it's not this commit that is at fault as mtd->name was already
given the value of device_node->name before that. I think you're
actually fixing 1cbb4a1c433a ("mtd: powernv: Add powernv flash MTD
abstraction driver").

No need to send a new version, I can fix that when applying, just let
me know if you're okay with the changes I suggested.

> Signed-off-by: Aneesh Kumar K.V 
> ---
>  drivers/mtd/devices/powernv_flash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index 22f753e555ac..83f88b8b5d9f 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -212,7 +212,7 @@ static int powernv_flash_set_driver_info(struct device 
> *dev,
>* Going to have to check what details I need to set and how to
>* get them
>*/
> - mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node);
> + mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
>   mtd->type = MTD_NORFLASH;
>   mtd->flags = MTD_WRITEABLE;
>   mtd->size = size;



Re: [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device

2019-02-11 Thread Boris Brezillon
On Mon, 11 Feb 2019 16:26:38 +0530
"Aneesh Kumar K.V"  wrote:

> On 2/10/19 6:25 PM, Boris Brezillon wrote:
> > Hello Aneesh,
> > 
> > On Fri,  8 Feb 2019 20:44:18 +0530
> > "Aneesh Kumar K.V"  wrote:
> >   
> >> With this patch, we use the mtd->name instead of concatenating the name 
> >> with '0'
> >>
> >> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the 
> >> nvmem API")
> >> Signed-off-by: Aneesh Kumar K.V   
> > 
> > You forgot to Cc the MTD ML and maintainers. Can you please send a new
> > version?
> >   
> 
> linux-mtd list is on CC: Is that not sufficient?

Not in your original email, I added it in my reply.


Re: [PATCH v3 1/2] drivers/mtd: Use mtd->name when registering nvmem device

2019-02-10 Thread Boris Brezillon
Hello Aneesh,

On Fri,  8 Feb 2019 20:44:18 +0530
"Aneesh Kumar K.V"  wrote:

> With this patch, we use the mtd->name instead of concatenating the name with 
> '0'
> 
> Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem 
> API")
> Signed-off-by: Aneesh Kumar K.V 

You forgot to Cc the MTD ML and maintainers. Can you please send a new
version?

Thanks,

Boris

> ---
>  drivers/mtd/mtdcore.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index 999b705769a8..3ef01baef9b6 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -507,6 +507,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
>  {
>   struct nvmem_config config = {};
>  
> + config.id = -1;
>   config.dev = >dev;
>   config.name = mtd->name;
>   config.owner = THIS_MODULE;



Re: [PATCH] mtd: powernv: SPDX and comment fixups

2019-02-07 Thread Boris Brezillon
Hello Joel,

On Wed,  6 Feb 2019 11:06:58 +1030
Joel Stanley  wrote:

> This converts the powernv flash driver to use SPDX, and adds some
> clarifying comments that came out of a discussion on how the mtd driver
> works.

Can you split that in 2 patches, one adding the SPDX header, and the
other one clarifying the driver behavior.

Thanks,

Boris

> 
> Signed-off-by: Joel Stanley 
> ---
>  drivers/mtd/devices/powernv_flash.c | 20 ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index 22f753e555ac..0bf43336c3f7 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -1,17 +1,9 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +
>  /*
>   * OPAL PNOR flash MTD abstraction
>   *
>   * Copyright IBM 2015
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
>   */
>  
>  #include 
> @@ -261,6 +253,14 @@ static int powernv_flash_probe(struct platform_device 
> *pdev)
>* The current flash that skiboot exposes is one contiguous flash chip
>* with an ffs partition at the start, it should prove easier for users
>* to deal with partitions or not as they see fit
> +  *
> +  * When developing the skiboot MTD driver an experiment with FFS
> +  * parsing in the kernel, and exposing a seperate /dev/mtdX for each
> +  * partition (eg BOOTKERNEL, PAYLOAD, NVRAM, etc), was done.
> +  *
> +  * We didn't go with that as it meant users couldn't do a full flash
> +  * re-write, as this can cause a partition to change size, and there
> +  * wasn't a way to tell the MTD layer that a device has shrunk/grown.
>*/
>   return mtd_device_register(>mtd, NULL, 0);
>  }



Re: [PATCH] mtd: powernv_flash: set of_node in mtd's dev

2018-07-18 Thread Boris Brezillon
On Fri, 13 Jul 2018 10:15:59 +0200
Rafał Miłecki  wrote:

> From: Rafał Miłecki 
> 
> This enables some features implemented in mtd subsystem like reading
> label and partitioning info from DT.
> 
> Reported-by: Timothy Pearson 
> Signed-off-by: Rafał Miłecki 

Applied.

Thanks,

Boris

> ---
>  drivers/mtd/devices/powernv_flash.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index c1312b141ae0..33593122e49b 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -223,6 +223,7 @@ static int powernv_flash_set_driver_info(struct device 
> *dev,
>   mtd->_read = powernv_flash_read;
>   mtd->_write = powernv_flash_write;
>   mtd->dev.parent = dev;
> + mtd_set_of_node(mtd, dev->of_node);
>   return 0;
>  }
>  



Re: [PATCH 1/5] mtd: Initialize ->fail_addr early in mtd_erase()

2018-03-18 Thread Boris Brezillon
On Mon, 12 Feb 2018 22:03:07 +0100
Boris Brezillon <boris.brezil...@bootlin.com> wrote:

> mtd_erase() can return an error before ->fail_addr is initialized to
> MTD_FAIL_ADDR_UNKNOWN. Move this initialization at the very beginning
> of the function.

Applied the patchset after addressing Miquel's comments.

> 
> Signed-off-by: Boris Brezillon <boris.brezil...@bootlin.com>
> ---
>  drivers/mtd/mtdcore.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
> index a1c94526fb88..c87859ff338b 100644
> --- a/drivers/mtd/mtdcore.c
> +++ b/drivers/mtd/mtdcore.c
> @@ -953,6 +953,8 @@ EXPORT_SYMBOL_GPL(__put_mtd_device);
>   */
>  int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
>  {
> + instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
> +
>   if (!mtd->erasesize || !mtd->_erase)
>   return -ENOTSUPP;
>  
> @@ -961,7 +963,6 @@ int mtd_erase(struct mtd_info *mtd, struct erase_info 
> *instr)
>   if (!(mtd->flags & MTD_WRITEABLE))
>   return -EROFS;
>  
> - instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
>   if (!instr->len) {
>   instr->state = MTD_ERASE_DONE;
>   mtd_erase_callback(instr);



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


Re: [PATCH 5/5] mtd: Stop updating erase_info->state and calling mtd_erase_callback()

2018-02-13 Thread Boris Brezillon
erase->len, NULL, NULL);  
> 
> Are you sure this is still needed? Maybe this should go away in your
> first patch?

Hm, indeed. This comment should be dropped.

> 
> > -
> > -   if (rc) {
> > +   if (rc)
> > erase->fail_addr = erase->addr;
> > -   erase->state = MTD_ERASE_FAILED;
> > -   } else {
> > -   erase->state = MTD_ERASE_DONE;
> > -   }
> > -   mtd_erase_callback(erase);
> > +
> > return rc;
> >  }
> >  
> > diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
> > index 0ec85f316d24..2f05e1801047 100644
> > --- a/drivers/mtd/devices/slram.c
> > +++ b/drivers/mtd/devices/slram.c
> > @@ -88,8 +88,6 @@ static int slram_erase(struct mtd_info *mtd, struct 
> > erase_info *instr)
> >  * I don't feel at all ashamed. This kind of thing is possible anyway
> >  * with flash, but unlikely.
> >  */  
> 
> Same with this comment.

Actually, I'm not sure I understand that comment, but I guess it's
talking about races between read/write and erase paths, so nothing
related to the changed I'm doing here.

> 
> > -   instr->state = MTD_ERASE_DONE;
> > -   mtd_erase_callback(instr);  
> 
> Space ?
> 
> > return(0);
> >  }
> >
> 
> 
> 
> 



-- 
Boris Brezillon, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com


[PATCH 5/5] mtd: Stop updating erase_info->state and calling mtd_erase_callback()

2018-02-12 Thread Boris Brezillon
MTD users are no longer checking erase_info->state to determine if the
erase operation failed or succeeded. Moreover, mtd_erase_callback() is
now a NOP.

We can safely get rid of all mtd_erase_callback() calls and all
erase_info->state assignments. While at it, get rid of the
erase_info->state field, all MTD_ERASE_XXX definitions and the
mtd_erase_callback() function.

Signed-off-by: Boris Brezillon <boris.brezil...@bootlin.com>
---
 drivers/mtd/chips/cfi_cmdset_0001.c  | 16 ++--
 drivers/mtd/chips/cfi_cmdset_0002.c  | 26 +++---
 drivers/mtd/chips/cfi_cmdset_0020.c  |  3 ---
 drivers/mtd/chips/map_ram.c  |  2 --
 drivers/mtd/devices/bcm47xxsflash.c  |  9 +
 drivers/mtd/devices/block2mtd.c  |  7 +--
 drivers/mtd/devices/docg3.c  | 16 ++--
 drivers/mtd/devices/lart.c   |  4 
 drivers/mtd/devices/mtd_dataflash.c  |  4 
 drivers/mtd/devices/mtdram.c |  2 --
 drivers/mtd/devices/phram.c  |  2 --
 drivers/mtd/devices/pmc551.c |  2 --
 drivers/mtd/devices/powernv_flash.c  | 11 ++-
 drivers/mtd/devices/slram.c  |  2 --
 drivers/mtd/devices/spear_smi.c  |  3 ---
 drivers/mtd/devices/sst25l.c |  3 ---
 drivers/mtd/devices/st_spi_fsm.c |  4 
 drivers/mtd/lpddr/lpddr2_nvm.c   | 10 ++
 drivers/mtd/lpddr/lpddr_cmds.c   |  2 --
 drivers/mtd/mtdconcat.c  |  1 -
 drivers/mtd/mtdcore.c|  6 ++
 drivers/mtd/mtdpart.c|  5 -
 drivers/mtd/nand/nand_base.c | 15 +++
 drivers/mtd/onenand/onenand_base.c   | 17 -
 drivers/mtd/spi-nor/spi-nor.c|  3 ---
 drivers/mtd/ubi/gluebi.c |  3 ---
 drivers/net/ethernet/sfc/falcon/mtd.c| 11 +--
 drivers/net/ethernet/sfc/mtd.c   | 11 +--
 drivers/staging/goldfish/goldfish_nand.c |  3 ---
 include/linux/mtd/mtd.h  |  9 -
 30 files changed, 20 insertions(+), 192 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c 
b/drivers/mtd/chips/cfi_cmdset_0001.c
index 5e1b68cbcd0a..d4c07b85f18e 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -1993,20 +1993,8 @@ static int __xipram do_erase_oneblock(struct map_info 
*map, struct flchip *chip,
 
 static int cfi_intelext_erase_varsize(struct mtd_info *mtd, struct erase_info 
*instr)
 {
-   unsigned long ofs, len;
-   int ret;
-
-   ofs = instr->addr;
-   len = instr->len;
-
-   ret = cfi_varsize_frob(mtd, do_erase_oneblock, ofs, len, NULL);
-   if (ret)
-   return ret;
-
-   instr->state = MTD_ERASE_DONE;
-   mtd_erase_callback(instr);
-
-   return 0;
+   return cfi_varsize_frob(mtd, do_erase_oneblock, instr->addr,
+   instr->len, NULL);
 }
 
 static void cfi_intelext_sync (struct mtd_info *mtd)
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c 
b/drivers/mtd/chips/cfi_cmdset_0002.c
index 56aa6b75213d..668e2cbc155b 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -2415,20 +2415,8 @@ static int __xipram do_erase_oneblock(struct map_info 
*map, struct flchip *chip,
 
 static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info 
*instr)
 {
-   unsigned long ofs, len;
-   int ret;
-
-   ofs = instr->addr;
-   len = instr->len;
-
-   ret = cfi_varsize_frob(mtd, do_erase_oneblock, ofs, len, NULL);
-   if (ret)
-   return ret;
-
-   instr->state = MTD_ERASE_DONE;
-   mtd_erase_callback(instr);
-
-   return 0;
+   return cfi_varsize_frob(mtd, do_erase_oneblock, instr->addr,
+   instr->len, NULL);
 }
 
 
@@ -2436,7 +2424,6 @@ static int cfi_amdstd_erase_chip(struct mtd_info *mtd, 
struct erase_info *instr)
 {
struct map_info *map = mtd->priv;
struct cfi_private *cfi = map->fldrv_priv;
-   int ret = 0;
 
if (instr->addr != 0)
return -EINVAL;
@@ -2444,14 +2431,7 @@ static int cfi_amdstd_erase_chip(struct mtd_info *mtd, 
struct erase_info *instr)
if (instr->len != mtd->size)
return -EINVAL;
 
-   ret = do_erase_chip(map, >chips[0]);
-   if (ret)
-   return ret;
-
-   instr->state = MTD_ERASE_DONE;
-   mtd_erase_callback(instr);
-
-   return 0;
+   return do_erase_chip(map, >chips[0]);
 }
 
 static int do_atmel_lock(struct map_info *map, struct flchip *chip,
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c 
b/drivers/mtd/chips/cfi_cmdset_0020.c
index 7d342965f392..7b7658a05036 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -9

[PATCH 3/5] mtd: Stop assuming mtd_erase() is asynchronous

2018-02-12 Thread Boris Brezillon
None of the mtd->_erase() implementations work in an asynchronous manner,
so let's simplify MTD users that call mtd_erase(). All they need to do
is check the value returned by mtd_erase() and assume that != 0 means
failure.

Signed-off-by: Boris Brezillon <boris.brezil...@bootlin.com>
---
 drivers/mtd/devices/bcm47xxsflash.c |  3 --
 drivers/mtd/ftl.c   | 51 
 drivers/mtd/inftlmount.c|  5 +-
 drivers/mtd/mtdblock.c  | 20 
 drivers/mtd/mtdchar.c   | 33 +
 drivers/mtd/mtdconcat.c | 48 ++-
 drivers/mtd/mtdcore.c   |  8 ++--
 drivers/mtd/mtdoops.c   | 19 
 drivers/mtd/mtdpart.c   |  2 -
 drivers/mtd/mtdswap.c   | 32 -
 drivers/mtd/nftlmount.c |  4 +-
 drivers/mtd/rfd_ftl.c   | 92 +++--
 drivers/mtd/sm_ftl.c| 18 
 drivers/mtd/sm_ftl.h|  4 --
 drivers/mtd/tests/mtd_test.c|  4 --
 drivers/mtd/tests/speedtest.c   |  6 ---
 drivers/mtd/ubi/io.c| 35 --
 fs/jffs2/erase.c| 36 ++-
 include/linux/mtd/mtd.h |  2 -
 19 files changed, 52 insertions(+), 370 deletions(-)

diff --git a/drivers/mtd/devices/bcm47xxsflash.c 
b/drivers/mtd/devices/bcm47xxsflash.c
index e2bd81817df4..6b84947cfbea 100644
--- a/drivers/mtd/devices/bcm47xxsflash.c
+++ b/drivers/mtd/devices/bcm47xxsflash.c
@@ -95,9 +95,6 @@ static int bcm47xxsflash_erase(struct mtd_info *mtd, struct 
erase_info *erase)
else
erase->state = MTD_ERASE_DONE;
 
-   if (erase->callback)
-   erase->callback(erase);
-
return err;
 }
 
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 664d206a4cbe..fcf9907e7987 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -140,12 +140,6 @@ typedef struct partition_t {
 #define XFER_PREPARED  0x03
 #define XFER_FAILED0x04
 
-/**/
-
-
-static void ftl_erase_callback(struct erase_info *done);
-
-
 /*==
 
 Scan_header() checks to see if a memory region contains an FTL
@@ -349,17 +343,19 @@ static int erase_xfer(partition_t *part,
 return -ENOMEM;
 
 erase->mtd = part->mbd.mtd;
-erase->callback = ftl_erase_callback;
 erase->addr = xfer->Offset;
 erase->len = 1 << part->header.EraseUnitSize;
-erase->priv = (u_long)part;
 
 ret = mtd_erase(part->mbd.mtd, erase);
+if (!ret) {
+   xfer->state = XFER_ERASED;
+   xfer->EraseCount++;
+} else {
+   xfer->state = XFER_FAILED;
+   pr_notice("ftl_cs: erase failed: err = %d\n", ret);
+}
 
-if (!ret)
-   xfer->EraseCount++;
-else
-   kfree(erase);
+kfree(erase);
 
 return ret;
 } /* erase_xfer */
@@ -371,37 +367,6 @@ static int erase_xfer(partition_t *part,
 
 ==*/
 
-static void ftl_erase_callback(struct erase_info *erase)
-{
-partition_t *part;
-struct xfer_info_t *xfer;
-int i;
-
-/* Look up the transfer unit */
-part = (partition_t *)(erase->priv);
-
-for (i = 0; i < part->header.NumTransferUnits; i++)
-   if (part->XferInfo[i].Offset == erase->addr) break;
-
-if (i == part->header.NumTransferUnits) {
-   printk(KERN_NOTICE "ftl_cs: internal error: "
-  "erase lookup failed!\n");
-   return;
-}
-
-xfer = >XferInfo[i];
-if (erase->state == MTD_ERASE_DONE)
-   xfer->state = XFER_ERASED;
-else {
-   xfer->state = XFER_FAILED;
-   printk(KERN_NOTICE "ftl_cs: erase failed: state = %d\n",
-  erase->state);
-}
-
-kfree(erase);
-
-} /* ftl_erase_callback */
-
 static int prepare_xfer(partition_t *part, int i)
 {
 erase_unit_header_t header;
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 8d6bb189ea8e..0f47be4834d8 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -393,9 +393,10 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
   mark only the failed block in the bbt. */
for (physblock = 0; physblock < inftl->EraseSize;
 physblock += instr->len, instr->addr += instr->len) {
-   mtd_erase(inftl->mbd.mtd, instr);
+   int ret;
 
-   if (instr->state == MTD_ERASE_FAILED) {
+   ret = mtd_erase(inftl->mbd.mtd, instr);
+   if (ret) {
printk(KERN_WARNING "INFTL: error while formatting 
block %d\n",
block);

[PATCH 4/5] mtd: Unconditionally update ->fail_addr and ->addr in part_erase()

2018-02-12 Thread Boris Brezillon
->fail_addr and ->addr can be updated no matter the result of
parent->_erase(), we just need to remove the code doing the same thing
in mtd_erase_callback() to avoid adjusting those fields twice.

Note that this can be done because all MTD users have been converted to
not pass an erase_info->callback() and are thus only taking the
->addr_fail and ->addr fields into account after part_erase() has
returned.

While we're at it, get rid of the erase_info->mtd field which was only
needed to let mtd_erase_callback() get the partition device back.

Signed-off-by: Boris Brezillon <boris.brezil...@bootlin.com>
---
 drivers/mtd/ftl.c |  1 -
 drivers/mtd/inftlmount.c  |  3 ---
 drivers/mtd/mtdblock.c|  1 -
 drivers/mtd/mtdchar.c |  1 -
 drivers/mtd/mtdconcat.c   |  1 -
 drivers/mtd/mtdoops.c |  1 -
 drivers/mtd/mtdpart.c | 16 
 drivers/mtd/mtdswap.c |  2 --
 drivers/mtd/nand/nand_base.c  |  1 -
 drivers/mtd/nand/nand_bbt.c   |  1 -
 drivers/mtd/nftlmount.c   |  1 -
 drivers/mtd/rfd_ftl.c |  1 -
 drivers/mtd/sm_ftl.c  |  1 -
 drivers/mtd/tests/mtd_test.c  |  1 -
 drivers/mtd/tests/speedtest.c |  1 -
 drivers/mtd/ubi/io.c  |  1 -
 fs/jffs2/erase.c  |  1 -
 include/linux/mtd/mtd.h   |  3 ++-
 18 files changed, 6 insertions(+), 32 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index fcf9907e7987..0a6adfaec7b5 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -342,7 +342,6 @@ static int erase_xfer(partition_t *part,
 if (!erase)
 return -ENOMEM;
 
-erase->mtd = part->mbd.mtd;
 erase->addr = xfer->Offset;
 erase->len = 1 << part->header.EraseUnitSize;
 
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 0f47be4834d8..aab4f68bd36f 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -208,8 +208,6 @@ static int find_boot_record(struct INFTLrecord *inftl)
if (ip->Reserved0 != ip->firstUnit) {
struct erase_info *instr = >instr;
 
-   instr->mtd = inftl->mbd.mtd;
-
/*
 *  Most likely this is using the
 *  undocumented qiuck mount feature.
@@ -385,7 +383,6 @@ int INFTL_formatblock(struct INFTLrecord *inftl, int block)
   _first_? */
 
/* Use async erase interface, test return code */
-   instr->mtd = inftl->mbd.mtd;
instr->addr = block * inftl->EraseSize;
instr->len = inftl->mbd.mtd->erasesize;
/* Erase one physical eraseblock at a time, even though the NAND api
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 7b2b7f651181..a5b1933c0490 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -65,7 +65,6 @@ static int erase_write (struct mtd_info *mtd, unsigned long 
pos,
/*
 * First, let's erase the flash block.
 */
-   erase.mtd = mtd;
erase.addr = pos;
erase.len = len;
 
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 2beb22dd6bbb..c06b33f80e75 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -726,7 +726,6 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, 
u_long arg)
erase->addr = einfo32.start;
erase->len = einfo32.length;
}
-   erase->mtd = mtd;
 
ret = mtd_erase(mtd, erase);
kfree(erase);
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index caa09bf6e572..93c47e56d9d8 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -427,7 +427,6 @@ static int concat_erase(struct mtd_info *mtd, struct 
erase_info *instr)
erase->len = length;
 
length -= erase->len;
-   erase->mtd = subdev;
if ((err = mtd_erase(subdev, erase))) {
/* sanity check: should never happen since
 * block alignment has been checked above */
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 028ded59297b..9f25111fd559 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -94,7 +94,6 @@ static int mtdoops_erase_block(struct mtdoops_context *cxt, 
int offset)
int ret;
int page;
 
-   erase.mtd = mtd;
erase.addr = offset;
erase.len = mtd->erasesize;
 
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index ae1206633d9d..1c07a6f0dfe5 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -205,23 +205,15 @@ static int part_erase(struct mtd_info *mtd, struct 
erase_info *instr)
 
instr->addr += part->offset

[PATCH 0/5] mtd: Simplify erase handling

2018-02-12 Thread Boris Brezillon
Hello,

This series aims at simplifying erase handling both in MTD drivers and
MTD users code.

Historically, the erase operation has been designed to be asynchronous,
which, in theory, is a good thing since erasing a block usually takes
longer that reading/writing to a flash. In practice, all drivers are
implementing ->_erase() in a synchronous manner. Moreover, both drivers
and users are inconsistently updating/checking the erase_info fields.

In order to simplify things, let's assume ->_erase() is and will always
be synchronous. This also make error code checking more consistent and
allows us to get rid of a few hundred lines of code.

Regards,

Boris

Boris Brezillon (5):
  mtd: Initialize ->fail_addr early in mtd_erase()
  mtd: Get rid of unused fields in struct erase_info
  mtd: Stop assuming mtd_erase() is asynchronous
  mtd: Unconditionally update ->fail_addr and ->addr in part_erase()
  mtd: Stop updating erase_info->state and calling mtd_erase_callback()

 drivers/mtd/chips/cfi_cmdset_0001.c  | 16 +-
 drivers/mtd/chips/cfi_cmdset_0002.c  | 26 ++---
 drivers/mtd/chips/cfi_cmdset_0020.c  |  3 --
 drivers/mtd/chips/map_ram.c  |  2 -
 drivers/mtd/devices/bcm47xxsflash.c  | 12 +
 drivers/mtd/devices/block2mtd.c  |  7 +--
 drivers/mtd/devices/docg3.c  | 16 +-
 drivers/mtd/devices/lart.c   |  4 --
 drivers/mtd/devices/mtd_dataflash.c  |  4 --
 drivers/mtd/devices/mtdram.c |  2 -
 drivers/mtd/devices/phram.c  |  2 -
 drivers/mtd/devices/pmc551.c |  2 -
 drivers/mtd/devices/powernv_flash.c  | 11 +---
 drivers/mtd/devices/slram.c  |  2 -
 drivers/mtd/devices/spear_smi.c  |  3 --
 drivers/mtd/devices/sst25l.c |  3 --
 drivers/mtd/devices/st_spi_fsm.c |  4 --
 drivers/mtd/ftl.c| 52 +++---
 drivers/mtd/inftlmount.c |  8 ++-
 drivers/mtd/lpddr/lpddr2_nvm.c   | 10 +---
 drivers/mtd/lpddr/lpddr_cmds.c   |  2 -
 drivers/mtd/mtdblock.c   | 21 
 drivers/mtd/mtdchar.c| 34 +---
 drivers/mtd/mtdconcat.c  | 48 +
 drivers/mtd/mtdcore.c| 17 +++---
 drivers/mtd/mtdoops.c| 20 ---
 drivers/mtd/mtdpart.c| 23 ++--
 drivers/mtd/mtdswap.c| 34 
 drivers/mtd/nand/nand_base.c | 16 ++
 drivers/mtd/nand/nand_bbt.c  |  1 -
 drivers/mtd/nftlmount.c  |  5 +-
 drivers/mtd/onenand/onenand_base.c   | 17 --
 drivers/mtd/rfd_ftl.c| 93 ++--
 drivers/mtd/sm_ftl.c | 19 ---
 drivers/mtd/sm_ftl.h |  4 --
 drivers/mtd/spi-nor/spi-nor.c|  3 --
 drivers/mtd/tests/mtd_test.c |  5 --
 drivers/mtd/tests/speedtest.c|  7 ---
 drivers/mtd/ubi/gluebi.c |  3 --
 drivers/mtd/ubi/io.c | 36 -
 drivers/net/ethernet/sfc/falcon/mtd.c| 11 +---
 drivers/net/ethernet/sfc/mtd.c   | 11 +---
 drivers/staging/goldfish/goldfish_nand.c |  3 --
 fs/jffs2/erase.c | 37 ++---
 include/linux/mtd/mtd.h  | 19 +--
 45 files changed, 79 insertions(+), 599 deletions(-)

-- 
2.14.1



[PATCH 1/5] mtd: Initialize ->fail_addr early in mtd_erase()

2018-02-12 Thread Boris Brezillon
mtd_erase() can return an error before ->fail_addr is initialized to
MTD_FAIL_ADDR_UNKNOWN. Move this initialization at the very beginning
of the function.

Signed-off-by: Boris Brezillon <boris.brezil...@bootlin.com>
---
 drivers/mtd/mtdcore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index a1c94526fb88..c87859ff338b 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -953,6 +953,8 @@ EXPORT_SYMBOL_GPL(__put_mtd_device);
  */
 int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
 {
+   instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
+
if (!mtd->erasesize || !mtd->_erase)
return -ENOTSUPP;
 
@@ -961,7 +963,6 @@ int mtd_erase(struct mtd_info *mtd, struct erase_info 
*instr)
if (!(mtd->flags & MTD_WRITEABLE))
return -EROFS;
 
-   instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
if (!instr->len) {
instr->state = MTD_ERASE_DONE;
mtd_erase_callback(instr);
-- 
2.14.1



[PATCH 2/5] mtd: Get rid of unused fields in struct erase_info

2018-02-12 Thread Boris Brezillon
Some fields are not used by MTD drivers, users or core code. Moreover,
those fields are not documented, so get rid of them to avoid any
confusion.

Signed-off-by: Boris Brezillon <boris.brezil...@bootlin.com>
---
 include/linux/mtd/mtd.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 205ededccc60..2a407dc9beaa 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -48,14 +48,9 @@ struct erase_info {
uint64_t addr;
uint64_t len;
uint64_t fail_addr;
-   u_long time;
-   u_long retries;
-   unsigned dev;
-   unsigned cell;
void (*callback) (struct erase_info *self);
u_long priv;
u_char state;
-   struct erase_info *next;
 };
 
 struct mtd_erase_region_info {
-- 
2.14.1



Re: [PATCH v4 00/10] Allow opal-async waiters to get interrupted

2017-10-30 Thread Boris Brezillon
On Tue, 10 Oct 2017 14:32:52 +1100
Cyril Bur  wrote:

> V4: Rework and rethink.
> 
> To recap:
> Userspace MTD read()s/write()s and erases to powernv_flash become
> calls into the OPAL firmware which subsequently handles flash access.
> Because the read()s, write()s or erases can be large (bounded of
> course my the size of flash) OPAL may take some time to service the
> request, this causes the powernv_flash driver to sit in a wait_event()
> for potentially minutes. This causes two problems, firstly, tools
> appear to hang for the entire time as they cannot be interrupted by
> signals and secondly, this can trigger hung task warnings. The correct
> solution is to use wait_event_interruptible() which my rework (as part
> of this series) of the opal-async infrastructure provides.
> 
> The final patch in this series achieves this. It should eliminate both
> hung tasks and threads locking up.
> 
> Included in this series are other simpler fixes for powernv_flash:
> 
> Don't always return EIO on error. OPAL does mutual exclusion on the
> flash and also knows when the service processor takes control of the
> flash, in both of these cases it will return OPAL_BUSY, translating
> this to EIO is misleading to userspace.
> 
> Handle receiving OPAL_SUCCESS when it expects OPAL_ASYNC_COMPLETION
> and don't treat it as an error. Unfortunately there are too many drivers
> out there with the incorrect behaviour so this means OPAL can never
> return anything but OPAL_ASYNC_COMPLETION, this shouldn't prevent the
> code from being correct.
> 
> Don't return ERESTARTSYS if token acquisition is interrupted as
> powernv_flash can't be sure it hasn't already performed some work, let
> userspace deal with the problem.
> 
> Change the incorrect use of BUG_ON() to WARN_ON() in powernv_flash.
> 
> Not for powernv_flash, a fix from Stewart Smith which fits into this
> series as it relies on my improvements to the opal-async
> infrastructure.
> 
> V3: export opal_error_code() so that powernv_flash can be built=m
> 
> Hello,
> 
> Version one of this series ignored that OPAL may continue to use
> buffers passed to it after Linux kfree()s the buffer. This version
> addresses this, not in a particularly nice way - future work could
> make this better. This version also includes a few cleanups and fixups
> to powernv_flash driver one along the course of this work that I
> thought I would just send.
> 
> The problem we're trying to solve here is that currently all users of
> the opal-async calls must use wait_event(), this may be undesirable
> when there is a userspace process behind the request for the opal
> call, if OPAL takes too long to complete the call then hung task
> warnings will appear.
> 
> In order to solve the problem callers should use
> wait_event_interruptible(), due to the interruptible nature of this
> call the opal-async infrastructure needs to track extra state
> associated with each async token, this is prepared for in patch 6/10.
> 
> While I was working on the opal-async infrastructure improvements
> Stewart fixed another problem and he relies on the corrected behaviour
> of opal-async so I've sent it here.
> 
> Hello MTD folk, traditionally Michael Ellerman takes powernv_flash
> driver patches through the powerpc tree, as always your feedback is
> very welcome.

Just gave my acks on patches 1 to 4 and patch 10 (with minor comments
on patch 3 and 10). Feel free to take the patches directly through the
powerpc tree.

> 
> Thanks,
> 
> Cyril
> 
> Cyril Bur (9):
>   mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()
>   mtd: powernv_flash: Don't treat OPAL_SUCCESS as an error
>   mtd: powernv_flash: Remove pointless goto in driver init
>   mtd: powernv_flash: Don't return -ERESTARTSYS on interrupted token
> acquisition
>   powerpc/opal: Make __opal_async_{get,release}_token() static
>   powerpc/opal: Rework the opal-async interface
>   powerpc/opal: Add opal_async_wait_response_interruptible() to
> opal-async
>   powerpc/powernv: Add OPAL_BUSY to opal_error_code()
>   mtd: powernv_flash: Use opal_async_wait_response_interruptible()
> 
> Stewart Smith (1):
>   powernv/opal-sensor: remove not needed lock
> 
>  arch/powerpc/include/asm/opal.h  |   4 +-
>  arch/powerpc/platforms/powernv/opal-async.c  | 183 
> +++
>  arch/powerpc/platforms/powernv/opal-sensor.c |  17 +--
>  arch/powerpc/platforms/powernv/opal.c|   2 +
>  drivers/mtd/devices/powernv_flash.c  |  83 +++-
>  5 files changed, 194 insertions(+), 95 deletions(-)
> 



Re: [PATCH v4 10/10] mtd: powernv_flash: Use opal_async_wait_response_interruptible()

2017-10-30 Thread Boris Brezillon
On Tue, 10 Oct 2017 14:33:02 +1100
Cyril Bur <cyril...@gmail.com> wrote:

> The OPAL calls performed in this driver shouldn't be using
> opal_async_wait_response() as this performs a wait_event() which, on
> long running OPAL calls could result in hung task warnings. wait_event()
> prevents timely signal delivery which is also undesirable.
> 
> This patch also attempts to quieten down the use of dev_err() when
> errors haven't actually occurred and also to return better information up
> the stack rather than always -EIO.
> 
> Signed-off-by: Cyril Bur <cyril...@gmail.com>

Have some minor comments (see below). Once addressed you can add

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

> ---
>  drivers/mtd/devices/powernv_flash.c | 57 
> +++--
>  1 file changed, 35 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index 3343d4f5c4f3..42383dbca5a6 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -1,7 +1,7 @@
>  /*
>   * OPAL PNOR flash MTD abstraction
>   *
> - * Copyright IBM 2015
> + * Copyright IBM 2015-2017

Not a big deal, but this copyright update is not really related to the
change you describe in your commit message. Maybe this should be done
in a separate commit.

>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License as published by
> @@ -89,33 +89,46 @@ static int powernv_flash_async_op(struct mtd_info *mtd, 
> enum flash_op op,
>   return -EIO;
>   }
>  
> - if (rc == OPAL_SUCCESS)
> - goto out_success;
> + if (rc == OPAL_ASYNC_COMPLETION) {
> + rc = opal_async_wait_response_interruptible(token, );
> + if (rc) {
> + /*
> +  * If we return the mtd core will free the
> +  * buffer we've just passed to OPAL but OPAL
> +  * will continue to read or write from that
> +  * memory.
> +  * It may be tempting to ultimately return 0
> +  * if we're doing a read or a write since we
> +  * are going to end up waiting until OPAL is
> +  * done. However, because the MTD core sends
> +  * us the userspace request in chunks, we need
> +  * to it know we've been interrupted.

   ^ 'it to' ?

> +  */
> + rc = -EINTR;
> + if (opal_async_wait_response(token, ))
> + dev_err(dev, "opal_async_wait_response() 
> failed\n");
> + goto out;
> + }
> + rc = opal_get_async_rc(msg);
> + }
>  
> - if (rc != OPAL_ASYNC_COMPLETION) {
> + /*
> +  * OPAL does mutual exclusion on the flash, it will return
> +  * OPAL_BUSY.
> +  * During firmware updates by the service processor OPAL may
> +  * be (temporarily) prevented from accessing the flash, in
> +  * this case OPAL will also return OPAL_BUSY.
> +  * Both cases aren't errors exactly but the flash could have
> +  * changed, userspace should be informed.
> +  */
> + if (rc != OPAL_SUCCESS && rc != OPAL_BUSY)
>   dev_err(dev, "opal_flash_async_op(op=%d) failed (rc %d)\n",
>   op, rc);
> - rc = -EIO;
> - goto out;
> - }
>  
> - rc = opal_async_wait_response(token, );
> - if (rc) {
> - dev_err(dev, "opal async wait failed (rc %d)\n", rc);
> - rc = -EIO;
> - goto out;
> - }
> -
> - rc = opal_get_async_rc(msg);
> -out_success:
> - if (rc == OPAL_SUCCESS) {
> - rc = 0;
> - if (retlen)
> + if (rc == OPAL_SUCCESS && retlen)
>   *retlen = len;

There's one too many tabs here.

> - } else {
> - rc = -EIO;
> - }
>  
> + rc = opal_error_code(rc);
>  out:
>   opal_async_release_token(token);
>   return rc;



Re: [PATCH v4 04/10] mtd: powernv_flash: Don't return -ERESTARTSYS on interrupted token acquisition

2017-10-30 Thread Boris Brezillon
On Tue, 10 Oct 2017 14:32:56 +1100
Cyril Bur <cyril...@gmail.com> wrote:

> Because the MTD core might split up a read() or write() from userspace
> into several calls to the driver, we may fail to get a token but already
> have done some work, best to return -EINTR back to userspace and have
> them decide what to do.
> 
> Signed-off-by: Cyril Bur <cyril...@gmail.com>

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

> ---
>  drivers/mtd/devices/powernv_flash.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index 4dd3b5d2feb2..3343d4f5c4f3 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -47,6 +47,11 @@ enum flash_op {
>   FLASH_OP_ERASE,
>  };
>  
> +/*
> + * Don't return -ERESTARTSYS if we can't get a token, the MTD core
> + * might have split up the call from userspace and called into the
> + * driver more than once, we'll already have done some amount of work.
> + */
>  static int powernv_flash_async_op(struct mtd_info *mtd, enum flash_op op,
>   loff_t offset, size_t len, size_t *retlen, u_char *buf)
>  {
> @@ -63,6 +68,8 @@ static int powernv_flash_async_op(struct mtd_info *mtd, 
> enum flash_op op,
>   if (token < 0) {
>   if (token != -ERESTARTSYS)
>   dev_err(dev, "Failed to get an async token\n");
> + else
> + token = -EINTR;
>   return token;
>   }
>  



Re: [PATCH v4 03/10] mtd: powernv_flash: Remove pointless goto in driver init

2017-10-30 Thread Boris Brezillon
On Tue, 10 Oct 2017 14:32:55 +1100
Cyril Bur <cyril...@gmail.com> wrote:

Can you please add a short description here?

Once done you can add

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

> Signed-off-by: Cyril Bur <cyril...@gmail.com>
> ---
>  drivers/mtd/devices/powernv_flash.c | 16 ++--
>  1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index ca3ca6adf71e..4dd3b5d2feb2 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -227,21 +227,20 @@ static int powernv_flash_probe(struct platform_device 
> *pdev)
>   int ret;
>  
>   data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
> - if (!data) {
> - ret = -ENOMEM;
> - goto out;
> - }
> + if (!data)
> + return -ENOMEM;
> +
>   data->mtd.priv = data;
>  
>   ret = of_property_read_u32(dev->of_node, "ibm,opal-id", &(data->id));
>   if (ret) {
>   dev_err(dev, "no device property 'ibm,opal-id'\n");
> - goto out;
> + return ret;
>   }
>  
>   ret = powernv_flash_set_driver_info(dev, >mtd);
>   if (ret)
> - goto out;
> + return ret;
>  
>   dev_set_drvdata(dev, data);
>  
> @@ -250,10 +249,7 @@ static int powernv_flash_probe(struct platform_device 
> *pdev)
>* with an ffs partition at the start, it should prove easier for users
>* to deal with partitions or not as they see fit
>*/
> - ret = mtd_device_register(>mtd, NULL, 0);
> -
> -out:
> - return ret;
> + return mtd_device_register(>mtd, NULL, 0);
>  }
>  
>  /**



Re: [PATCH v4 02/10] mtd: powernv_flash: Don't treat OPAL_SUCCESS as an error

2017-10-30 Thread Boris Brezillon
On Tue, 10 Oct 2017 14:32:54 +1100
Cyril Bur <cyril...@gmail.com> wrote:

> While this driver expects to interact asynchronously, OPAL is well
> within its rights to return OPAL_SUCCESS to indicate that the operation
> completed without the need for a callback. We shouldn't treat
> OPAL_SUCCESS as an error rather we should wrap up and return promptly to
> the caller.
> 
> Signed-off-by: Cyril Bur <cyril...@gmail.com>

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

> ---
> I'll note here that currently no OPAL exists that will return
> OPAL_SUCCESS so there isn't the possibility of a bug today.
> ---
>  drivers/mtd/devices/powernv_flash.c | 15 ++-
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index f9ec38281ff2..ca3ca6adf71e 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -63,7 +63,6 @@ static int powernv_flash_async_op(struct mtd_info *mtd, 
> enum flash_op op,
>   if (token < 0) {
>   if (token != -ERESTARTSYS)
>   dev_err(dev, "Failed to get an async token\n");
> -
>   return token;
>   }
>  
> @@ -83,21 +82,25 @@ static int powernv_flash_async_op(struct mtd_info *mtd, 
> enum flash_op op,
>   return -EIO;
>   }
>  
> + if (rc == OPAL_SUCCESS)
> + goto out_success;
> +
>   if (rc != OPAL_ASYNC_COMPLETION) {
>   dev_err(dev, "opal_flash_async_op(op=%d) failed (rc %d)\n",
>   op, rc);
> - opal_async_release_token(token);
> - return -EIO;
> + rc = -EIO;
> + goto out;
>   }
>  
>   rc = opal_async_wait_response(token, );
> - opal_async_release_token(token);
>   if (rc) {
>   dev_err(dev, "opal async wait failed (rc %d)\n", rc);
> - return -EIO;
> + rc = -EIO;
> + goto out;
>   }
>  
>   rc = opal_get_async_rc(msg);
> +out_success:
>   if (rc == OPAL_SUCCESS) {
>   rc = 0;
>   if (retlen)
> @@ -106,6 +109,8 @@ static int powernv_flash_async_op(struct mtd_info *mtd, 
> enum flash_op op,
>   rc = -EIO;
>   }
>  
> +out:
> + opal_async_release_token(token);
>   return rc;
>  }
>  



Re: [PATCH v4 01/10] mtd: powernv_flash: Use WARN_ON_ONCE() rather than BUG_ON()

2017-10-30 Thread Boris Brezillon
On Tue, 10 Oct 2017 14:32:53 +1100
Cyril Bur <cyril...@gmail.com> wrote:

> BUG_ON() should be reserved in situations where we can not longer
> guarantee the integrity of the system. In the case where
> powernv_flash_async_op() receives an impossible op, we can still
> guarantee the integrity of the system.
> 
> Signed-off-by: Cyril Bur <cyril...@gmail.com>

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

> ---
>  drivers/mtd/devices/powernv_flash.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/devices/powernv_flash.c 
> b/drivers/mtd/devices/powernv_flash.c
> index f5396f26ddb4..f9ec38281ff2 100644
> --- a/drivers/mtd/devices/powernv_flash.c
> +++ b/drivers/mtd/devices/powernv_flash.c
> @@ -78,7 +78,9 @@ static int powernv_flash_async_op(struct mtd_info *mtd, 
> enum flash_op op,
>   rc = opal_flash_erase(info->id, offset, len, token);
>   break;
>   default:
> - BUG_ON(1);
> + WARN_ON_ONCE(1);
> + opal_async_release_token(token);
> + return -EIO;
>   }
>  
>   if (rc != OPAL_ASYNC_COMPLETION) {



Re: [PATCH] mtd: nand: Rename nand.h into rawnand.h

2017-08-21 Thread Boris Brezillon
Le Fri,  4 Aug 2017 17:29:09 +0200,
Boris Brezillon <boris.brezil...@free-electrons.com> a écrit :

> We are planning to share more code between different NAND based
> devices (SPI NAND, OneNAND and raw NANDs), but before doing that
> we need to move the existing include/linux/mtd/nand.h file into
> include/linux/mtd/rawnand.h so we can later create a nand.h header
> containing all common structure and function prototypes.
> 
> Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
> Signed-off-by: Peter Pan <peterpand...@micron.com>
> Cc: Jonathan Corbet <cor...@lwn.net>
> Cc: Sekhar Nori <nsek...@ti.com>
> Cc: Kevin Hilman <khil...@kernel.org>
> Cc: Jason Cooper <ja...@lakedaemon.net>
> Cc: Andrew Lunn <and...@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselba...@gmail.com>
> Cc: Gregory Clement <gregory.clem...@free-electrons.com>
> Cc: Hartley Sweeten <hswee...@visionengravers.com>
> Cc: Alexander Sverdlin <alexander.sverd...@gmail.com>
> Cc: Shawn Guo <shawn...@kernel.org>
> Cc: Sascha Hauer <ker...@pengutronix.de>
> Cc: Fabio Estevam <fabio.este...@nxp.com>
> Cc: Imre Kaloz <ka...@openwrt.org>
> Cc: Krzysztof Halasa <khal...@piap.pl>
> Cc: Eric Miao <eric.y.m...@gmail.com>
> Cc: Haojian Zhuang <haojian.zhu...@gmail.com>
> Cc: Aaro Koskinen <aaro.koski...@iki.fi>
> Cc: Tony Lindgren <t...@atomide.com>
> Cc: Alexander Clouter <a...@digriz.org.uk>
> Cc: Daniel Mack <dan...@zonque.org>
> Cc: Robert Jarzmik <robert.jarz...@free.fr>
> Cc: Marek Vasut <marek.va...@gmail.com>
> Cc: Kukjin Kim <kg...@kernel.org>
> Cc: Krzysztof Kozlowski <k...@kernel.org>
> Cc: Simtec Linux Team <li...@simtec.co.uk>
> Cc: Steven Miao <real...@gmail.com>
> Cc: Mikael Starvik <star...@axis.com>
> Cc: Jesper Nilsson <jesper.nils...@axis.com>
> Cc: Ralf Baechle <r...@linux-mips.org>
> Cc: Yoshinori Sato <ys...@users.sourceforge.jp>
> Cc: Rich Felker <dal...@libc.org>
> Cc: Wenyou Yang <wenyou.y...@atmel.com>
> Cc: Josh Wu <rainyfeel...@outlook.com>
> Cc: Kamal Dasu <kdasu.k...@gmail.com>
> Cc: Masahiro Yamada <yamada.masah...@socionext.com>
> Cc: Han Xu <han...@nxp.com>
> Cc: Harvey Hunt <harveyhuntne...@gmail.com>
> Cc: Vladimir Zapolskiy <v...@mleia.com>
> Cc: Sylvain Lemieux <slemieux.t...@gmail.com>
> Cc: Matthias Brugger <matthias@gmail.com>
> Cc: Wan ZongShun <mcuos@gmail.com>
> Cc: Neil Armstrong <narmstr...@baylibre.com>
> Cc: Ezequiel Garcia <ezequiel.gar...@free-electrons.com>
> Cc: Maxim Levitsky <maximlevit...@gmail.com>
> Cc: Marc Gonzalez <marc_gonza...@sigmadesigns.com>
> Cc: Stefan Agner <ste...@agner.ch>
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> Cc: Mauro Carvalho Chehab <mche...@kernel.org>
> Cc: linux-...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linux-o...@vger.kernel.org
> Cc: linux-samsung-...@vger.kernel.org
> Cc: adi-buildroot-de...@lists.sourceforge.net
> Cc: linux-cris-ker...@axis.com
> Cc: linux-m...@linux-mips.org
> Cc: linux...@vger.kernel.org
> Cc: bcm-kernel-feedback-l...@broadcom.com
> Cc: linux-media...@lists.infradead.org
> Cc: linux-ox...@lists.tuxfamily.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: de...@driverdev.osuosl.org

Created the nand/rename-header-file immutable branch which I then
merged in nand/next.

This way, anyone can pull the nand/rename-header-file branch in case a
conflict arise on one of the file modified by this patch.

The following changes since commit 5771a8c08880cdca3bfb4a3fc6d309d6bba20877:

  Linux v4.13-rc1 (2017-07-15 15:22:10 -0700)

are available in the git repository at:

  git://git.infradead.org/l2-mtd.git nand/rename-header-file

for you to fetch changes up to d4092d76a4a4e57b65910899948a83cc8646c5a5:

  mtd: nand: Rename nand.h into rawnand.h (2017-08-13 10:11:49 +0200)


Boris Brezillon (1):
  mtd: nand: Rename nand.h into rawnand.h

 Documentation/driver-api/mtdnand.rst| 8 
 MAINTAINERS | 2 +-
 arch/arm/mach-davinci/board-da850-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c | 2 +-
 arch/arm/mach-davinci/board-dm365-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c| 2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c| 2 +-
 arch/arm/mach-davinci/board-sffsdr.c| 2 +-
 arch/arm/mach-dove/dove-db-setup.c  | 2 +-
 arch/arm/mach-ep93xx/snappe

[PATCH] mtd: nand: Rename nand.h into rawnand.h

2017-08-04 Thread Boris Brezillon
We are planning to share more code between different NAND based
devices (SPI NAND, OneNAND and raw NANDs), but before doing that
we need to move the existing include/linux/mtd/nand.h file into
include/linux/mtd/rawnand.h so we can later create a nand.h header
containing all common structure and function prototypes.

Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
Signed-off-by: Peter Pan <peterpand...@micron.com>
Cc: Jonathan Corbet <cor...@lwn.net>
Cc: Sekhar Nori <nsek...@ti.com>
Cc: Kevin Hilman <khil...@kernel.org>
Cc: Jason Cooper <ja...@lakedaemon.net>
Cc: Andrew Lunn <and...@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselba...@gmail.com>
Cc: Gregory Clement <gregory.clem...@free-electrons.com>
Cc: Hartley Sweeten <hswee...@visionengravers.com>
Cc: Alexander Sverdlin <alexander.sverd...@gmail.com>
Cc: Shawn Guo <shawn...@kernel.org>
Cc: Sascha Hauer <ker...@pengutronix.de>
Cc: Fabio Estevam <fabio.este...@nxp.com>
Cc: Imre Kaloz <ka...@openwrt.org>
Cc: Krzysztof Halasa <khal...@piap.pl>
Cc: Eric Miao <eric.y.m...@gmail.com>
Cc: Haojian Zhuang <haojian.zhu...@gmail.com>
Cc: Aaro Koskinen <aaro.koski...@iki.fi>
Cc: Tony Lindgren <t...@atomide.com>
Cc: Alexander Clouter <a...@digriz.org.uk>
Cc: Daniel Mack <dan...@zonque.org>
Cc: Robert Jarzmik <robert.jarz...@free.fr>
Cc: Marek Vasut <marek.va...@gmail.com>
Cc: Kukjin Kim <kg...@kernel.org>
Cc: Krzysztof Kozlowski <k...@kernel.org>
Cc: Simtec Linux Team <li...@simtec.co.uk>
Cc: Steven Miao <real...@gmail.com>
Cc: Mikael Starvik <star...@axis.com>
Cc: Jesper Nilsson <jesper.nils...@axis.com>
Cc: Ralf Baechle <r...@linux-mips.org>
Cc: Yoshinori Sato <ys...@users.sourceforge.jp>
Cc: Rich Felker <dal...@libc.org>
Cc: Wenyou Yang <wenyou.y...@atmel.com>
Cc: Josh Wu <rainyfeel...@outlook.com>
Cc: Kamal Dasu <kdasu.k...@gmail.com>
Cc: Masahiro Yamada <yamada.masah...@socionext.com>
Cc: Han Xu <han...@nxp.com>
Cc: Harvey Hunt <harveyhuntne...@gmail.com>
Cc: Vladimir Zapolskiy <v...@mleia.com>
Cc: Sylvain Lemieux <slemieux.t...@gmail.com>
Cc: Matthias Brugger <matthias@gmail.com>
Cc: Wan ZongShun <mcuos@gmail.com>
Cc: Neil Armstrong <narmstr...@baylibre.com>
Cc: Ezequiel Garcia <ezequiel.gar...@free-electrons.com>
Cc: Maxim Levitsky <maximlevit...@gmail.com>
Cc: Marc Gonzalez <marc_gonza...@sigmadesigns.com>
Cc: Stefan Agner <ste...@agner.ch>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Mauro Carvalho Chehab <mche...@kernel.org>
Cc: linux-...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-o...@vger.kernel.org
Cc: linux-samsung-...@vger.kernel.org
Cc: adi-buildroot-de...@lists.sourceforge.net
Cc: linux-cris-ker...@axis.com
Cc: linux-m...@linux-mips.org
Cc: linux...@vger.kernel.org
Cc: bcm-kernel-feedback-l...@broadcom.com
Cc: linux-media...@lists.infradead.org
Cc: linux-ox...@lists.tuxfamily.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: de...@driverdev.osuosl.org
---
Hi All,

Sorry for the huge Cc list, but I'd like to collect as much acks as
possible for this patch which is actually part of a bigger series [1].

Note that there's nothing complicated here, it's just a mechanical
s/nand\.h/rawnand\.h/ replacement, but it impacts several architectures,
the doc and staging directories.

Regards,

Boris

[1]https://lwn.net/Articles/723694/
---
 Documentation/driver-api/mtdnand.rst| 8 
 MAINTAINERS | 2 +-
 arch/arm/mach-davinci/board-da850-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c | 2 +-
 arch/arm/mach-davinci/board-dm365-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c| 2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c| 2 +-
 arch/arm/mach-davinci/board-sffsdr.c| 2 +-
 arch/arm/mach-dove/dove-db-setup.c  | 2 +-
 arch/arm/mach-ep93xx/snappercl15.c  | 2 +-
 arch/arm/mach-ep93xx/ts72xx.c   | 2 +-
 arch/arm/mach-imx/mach-qong.c   | 2 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c| 2 +-
 arch/arm/mach-mmp/aspenite.c| 2 +-
 arch/arm/mach-omap1/board-fsample.c | 2 +-
 arch/arm/mach-omap1/board-h2.c  | 2 +-
 arch/arm/mach-omap1/board-h3.c  | 2 +-
 arch/arm/mach-omap1/board-nand.c| 2 +-
 arch/arm/mach-omap1/board-perseus2.c| 2 +-
 arch/arm/mach-orion5x/db88f5281-setup.c | 2 +-
 arch/arm/mach-orion5x/kurobox_pro-setup.c   | 2 +-
 arch/arm/mach-orion5x/ts209-setup.c | 2 +-
 arch/arm/mach-orion5x/ts78xx-setup.c| 2 +-
 arch/arm/mach-pxa/balloon3.c

[PATCH] mtd: nand: Rename nand.h into rawnand.h

2017-08-04 Thread Boris Brezillon
We are planning to share more code between different NAND based
devices (SPI NAND, OneNAND and raw NANDs), but before doing that
we need to move the existing include/linux/mtd/nand.h file into
include/linux/mtd/rawnand.h so we can later create a nand.h header
containing all common structure and function prototypes.

Signed-off-by: Boris Brezillon <boris.brezil...@free-electrons.com>
Signed-off-by: Peter Pan <peterpand...@micron.com>
Cc: Jonathan Corbet <cor...@lwn.net>
Cc: Sekhar Nori <nsek...@ti.com>
Cc: Kevin Hilman <khil...@kernel.org>
Cc: Jason Cooper <ja...@lakedaemon.net>
Cc: Andrew Lunn <and...@lunn.ch>
Cc: Sebastian Hesselbarth <sebastian.hesselba...@gmail.com>
Cc: Gregory Clement <gregory.clem...@free-electrons.com>
Cc: Hartley Sweeten <hswee...@visionengravers.com>
Cc: Alexander Sverdlin <alexander.sverd...@gmail.com>
Cc: Shawn Guo <shawn...@kernel.org>
Cc: Sascha Hauer <ker...@pengutronix.de>
Cc: Fabio Estevam <fabio.este...@nxp.com>
Cc: Imre Kaloz <ka...@openwrt.org>
Cc: Krzysztof Halasa <khal...@piap.pl>
Cc: Eric Miao <eric.y.m...@gmail.com>
Cc: Haojian Zhuang <haojian.zhu...@gmail.com>
Cc: Aaro Koskinen <aaro.koski...@iki.fi>
Cc: Tony Lindgren <t...@atomide.com>
Cc: Alexander Clouter <a...@digriz.org.uk>
Cc: Daniel Mack <dan...@zonque.org>
Cc: Robert Jarzmik <robert.jarz...@free.fr>
Cc: Marek Vasut <marek.va...@gmail.com>
Cc: Kukjin Kim <kg...@kernel.org>
Cc: Krzysztof Kozlowski <k...@kernel.org>
Cc: Simtec Linux Team <li...@simtec.co.uk>
Cc: Steven Miao <real...@gmail.com>
Cc: Mikael Starvik <star...@axis.com>
Cc: Jesper Nilsson <jesper.nils...@axis.com>
Cc: Ralf Baechle <r...@linux-mips.org>
Cc: Yoshinori Sato <ys...@users.sourceforge.jp>
Cc: Rich Felker <dal...@libc.org>
Cc: Wenyou Yang <wenyou.y...@atmel.com>
Cc: Josh Wu <rainyfeel...@outlook.com>
Cc: Kamal Dasu <kdasu.k...@gmail.com>
Cc: Masahiro Yamada <yamada.masah...@socionext.com>
Cc: Han Xu <han...@nxp.com>
Cc: Harvey Hunt <harveyhuntne...@gmail.com>
Cc: Vladimir Zapolskiy <v...@mleia.com>
Cc: Sylvain Lemieux <slemieux.t...@gmail.com>
Cc: Matthias Brugger <matthias@gmail.com>
Cc: Wan ZongShun <mcuos@gmail.com>
Cc: Neil Armstrong <narmstr...@baylibre.com>
Cc: Ezequiel Garcia <ezequiel.gar...@free-electrons.com>
Cc: Maxim Levitsky <maximlevit...@gmail.com>
Cc: Marc Gonzalez <marc_gonza...@sigmadesigns.com>
Cc: Stefan Agner <ste...@agner.ch>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Mauro Carvalho Chehab <mche...@kernel.org>
Cc: linux-...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-o...@vger.kernel.org
Cc: linux-samsung-...@vger.kernel.org
Cc: adi-buildroot-de...@lists.sourceforge.net
Cc: linux-cris-ker...@axis.com
Cc: linux-m...@linux-mips.org
Cc: linux...@vger.kernel.org
Cc: bcm-kernel-feedback-l...@broadcom.com
Cc: linux-media...@lists.infradead.org
Cc: linux-ox...@lists.tuxfamily.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: de...@driverdev.osuosl.org
---
Hi All,

Sorry for the huge Cc list, but I'd like to collect as much acks as
possible for this patch which is actually part of a bigger series [1].

Note that there's nothing complicated here, it's just a mechanical
s/nand\.h/rawnand\.h/ replacement, but it impacts several architectures,
the doc and staging directories.

Regards,

Boris

[1]https://lwn.net/Articles/723694/
---
 Documentation/driver-api/mtdnand.rst| 8 
 MAINTAINERS | 2 +-
 arch/arm/mach-davinci/board-da850-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c | 2 +-
 arch/arm/mach-davinci/board-dm365-evm.c | 2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c| 2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c| 2 +-
 arch/arm/mach-davinci/board-sffsdr.c| 2 +-
 arch/arm/mach-dove/dove-db-setup.c  | 2 +-
 arch/arm/mach-ep93xx/snappercl15.c  | 2 +-
 arch/arm/mach-ep93xx/ts72xx.c   | 2 +-
 arch/arm/mach-imx/mach-qong.c   | 2 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c| 2 +-
 arch/arm/mach-mmp/aspenite.c| 2 +-
 arch/arm/mach-omap1/board-fsample.c | 2 +-
 arch/arm/mach-omap1/board-h2.c  | 2 +-
 arch/arm/mach-omap1/board-h3.c  | 2 +-
 arch/arm/mach-omap1/board-nand.c| 2 +-
 arch/arm/mach-omap1/board-perseus2.c| 2 +-
 arch/arm/mach-orion5x/db88f5281-setup.c | 2 +-
 arch/arm/mach-orion5x/kurobox_pro-setup.c   | 2 +-
 arch/arm/mach-orion5x/ts209-setup.c | 2 +-
 arch/arm/mach-orion5x/ts78xx-setup.c| 2 +-
 arch/arm/mach-pxa/balloon3.c

Re: [PATCH V2] mtd/ifc: Fix location of eccstat registers for IFC V1.0

2017-02-06 Thread Boris Brezillon
On Thu, 26 Jan 2017 16:18:27 +0100
 wrote:

> From: Mark Marshall 
> 
> The commit 7a654172161c ("mtd/ifc: Add support for IFC controller
> version 2.0") added support for version 2.0 of the IFC controller.
> The version 2.0 controller has the ECC status registers at a different
> location to the previous versions.
> 
> Correct the fsl_ifc_nand structure so that the ECC status can be read
> from the correct location for both version 1.0 and 2.0 of the controller.
> 
> Cc: sta...@vger.kernel.org
> Fixes: 7a654172161c ("mtd/ifc: Add support for IFC controller version 2.0")
> Signed-off-by: Mark Marshall 

Applied after fixing the subject prefix: s/mtd\/ifc/mtd: nand: ifc:/.
Next time, please make sure to add 'nand' in the prefix, I don't care
if it's mtd/nand/ or mtd: nand: xxx or mtd: nand/xxx, as long as
mtd and nand keywords are present ;-).

> ---
> 
> Changes since v1:
> 
> - simplified the reading of the registers.
> 
>  drivers/mtd/nand/fsl_ifc_nand.c | 8 +++-
>  include/linux/fsl_ifc.h | 8 ++--
>  2 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index 0a177b1..d1570f5 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -258,9 +258,15 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)
>   int bufnum = nctrl->page & priv->bufnum_mask;
>   int sector = bufnum * chip->ecc.steps;
>   int sector_end = sector + chip->ecc.steps - 1;
> + __be32 *eccstat_regs;
> +
> + if (ctrl->version >= FSL_IFC_VERSION_2_0_0)
> + eccstat_regs = ifc->ifc_nand.v2_nand_eccstat;
> + else
> + eccstat_regs = ifc->ifc_nand.v1_nand_eccstat;
>  
>   for (i = sector / 4; i <= sector_end / 4; i++)
> - eccstat[i] = ifc_in32(>ifc_nand.nand_eccstat[i]);
> + eccstat[i] = ifc_in32(_regs[i]);
>  
>   for (i = sector; i <= sector_end; i++) {
>   errors = check_read_ecc(mtd, ctrl, eccstat, i);
> diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
> index 3f9778c..c332f0a 100644
> --- a/include/linux/fsl_ifc.h
> +++ b/include/linux/fsl_ifc.h
> @@ -733,8 +733,12 @@ struct fsl_ifc_nand {
>   __be32 nand_erattr1;
>   u32 res19[0x10];
>   __be32 nand_fsr;
> - u32 res20[0x3];
> - __be32 nand_eccstat[6];
> + u32 res20;
> + /* The V1 nand_eccstat is actually 4 words that overlaps the
> +  * V2 nand_eccstat.
> +  */
> + __be32 v1_nand_eccstat[2];
> + __be32 v2_nand_eccstat[6];
>   u32 res21[0x1c];
>   __be32 nanndcr;
>   u32 res22[0x2];



Re: [PATCH] mtd/ifc: Fix location of eccstat registers for IFC V1.0

2017-01-24 Thread Boris Brezillon
On Tue, 24 Jan 2017 12:01:22 +0100
 wrote:

> From: Mark Marshall 
> 
> The commit 7a654172161c ("mtd/ifc: Add support for IFC controller
> version 2.0") added support for version 2.0 of the IFC controller.
> The version 2.0 controller has the ECC status registers at a different
> location to the previous versions.  This broke the code for IFC all
> versions less than 2.0.
> 
> Correct the fsl_ifc_nand structure so that the ECC status can be read
> from the correct location for both version 1.0 and 2.0 of the controller.
> 
> Cc: sta...@vger.kernel.org

Fixes: 7a654172161c ("mtd/ifc: Add support for IFC controller version 2.0")

> Signed-off-by: Mark Marshall 
> ---
>  drivers/mtd/nand/fsl_ifc_nand.c | 5 -
>  include/linux/fsl_ifc.h | 8 ++--
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index 0a177b1..123c0f8 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -260,7 +260,10 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)
>   int sector_end = sector + chip->ecc.steps - 1;
>  
>   for (i = sector / 4; i <= sector_end / 4; i++)
> - eccstat[i] = ifc_in32(>ifc_nand.nand_eccstat[i]);
> + eccstat[i] = ifc_in32(
> + (ctrl->version >= FSL_IFC_VERSION_2_0_0) ?
> + >ifc_nand.v2_nand_eccstat[i] :
> + >ifc_nand.v1_nand_eccstat[i]);

I'm nitpicking, but how about doing the following to improve
readability:

__be32 *eccstat_regs;

if (ctrl->version >= FSL_IFC_VERSION_2_0_0)
eccstat_regs = >ifc_nand.v2_nand_eccstat;
else
eccstat_regs = >ifc_nand.v1_nand_eccstat;

for (i = sector / 4; i <= sector_end / 4; i++)
eccstat[i] = ifc_in32(_regs[i]);

>  
>   for (i = sector; i <= sector_end; i++) {
>   errors = check_read_ecc(mtd, ctrl, eccstat, i);
> diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
> index 3f9778c..c332f0a 100644
> --- a/include/linux/fsl_ifc.h
> +++ b/include/linux/fsl_ifc.h
> @@ -733,8 +733,12 @@ struct fsl_ifc_nand {
>   __be32 nand_erattr1;
>   u32 res19[0x10];
>   __be32 nand_fsr;
> - u32 res20[0x3];
> - __be32 nand_eccstat[6];
> + u32 res20;
> + /* The V1 nand_eccstat is actually 4 words that overlaps the
> +  * V2 nand_eccstat.
> +  */
> + __be32 v1_nand_eccstat[2];
> + __be32 v2_nand_eccstat[6];
>   u32 res21[0x1c];
>   __be32 nanndcr;
>   u32 res22[0x2];



Re: ubi_io_read: error -74 (ECC error)

2017-01-06 Thread Boris Brezillon
Hi Raghavan,

On Fri, 6 Jan 2017 10:07:29 +
"Anurag Raghavan (RBEI/ETW11)"  wrote:

> Hi All,
> 
> My appdata partition could not be mounted or where the partition was not able 
> to be used. Anyone can help me to find out the root cause of this. What are 
> the possibilities of this ubifs corruption. Any patched are available to fix 
> this issue.

Can you please stop sending over and over the same message in the hope
that someone will magically solve the problem for you. Pinging
maintainers is accepted but not 3 times in 2 days.

> 
> I am using the kernel version-30.3.5

It's not even a valid kernel version (probably a kerne, and we'll need a
lot more than the 10 lines of log you provided to help you debug your
driver, like the boot logs, a reference to the kernel sources you're
using, after how much time this problem occurred...

> Any kernel patches are available to solve this issue...??

What's your NAND controller? It seems related to a NAND driver issue.

Regards,

Boris

> 
> Error logs:
> 
> [1.797141] UBI error: ubi_io_read: error -74 (ECC error) while reading 
> 253952 bytes from PEB 445:8192, read 253952 bytes
> [1.808274] UBIFS error (pid 491): ubifs_scan: corrupt empty space at LEB 
> 489:233760
> [1.816037] UBIFS error (pid 491): ubifs_scanned_corruption: corruption at 
> LEB 489:233760
> [1.828660] UBIFS error (pid 491): ubifs_scan: LEB 489 scanning failed
> [1.835215] UBIFS warning (pid 491): ubifs_ro_mode: switched to read-only 
> mode, error -117
> [1.843502] UBIFS error (pid 491): make_reservation: cannot reserve 58 
> bytes in jhead 2, error -117
> [1.852569] UBIFS error (pid 491): do_writepage: cannot write page 0 of 
> inode 76584, error -117
> dpkg: error: unable to sync new file '/var/lib/dpkg/arch-new': Structure 
> needs cleaning
> 
> Best regards
> 
> Raghavan Anurag
> RBEI/ETW1  
> 
> Tel. +91(422)667-4001 | Mobil 9986968950
> 
> __
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/



Re: [PATCH 00/22] mtd: nand: return error code of nand_scan(_ident,_tail) on error

2016-11-06 Thread Boris Brezillon
On Fri,  4 Nov 2016 19:42:48 +0900
Masahiro Yamada  wrote:

> nand_scan(), nand_scan_ident(), nand_scan_tail() return
> an appropriate negative value on error.
> 
> Most of drivers return the value from them on error,
> but some of them return the fixed error code -ENXIO
> (and a few return -ENODEV).
> 
> This series make those drivers return more precise error code.

Applied and fixed the bug I found in patch 13.

Thanks,

Boris

> 
> 
> Masahiro Yamada (22):
>   mtd: nand: ams-delta: return error code of nand_scan() on error
>   mtd: nand: cmx270: return error code of nand_scan() on error
>   mtd: nand: cs553x: return error code of nand_scan() on error
>   mtd: nand: gpio: return error code of nand_scan() on error
>   mtd: nand: mpc5121: return error code of nand_scan() on error
>   mtd: nand: tmio: return error code of nand_scan() on error
>   mtd: nand: orion: return error code of nand_scan() on error
>   mtd: nand: pasemi: return error code of nand_scan() on error
>   mtd: nand: plat_nand: return error code of nand_scan() on error
>   mtd: nand: atmel: return error code of nand_scan_ident/tail() on error
>   mtd: nand: brcmnand: return error code of nand_scan_ident/tail() on
> error
>   mtd: nand: fsmc: return error code of nand_scan_ident/tail() on error
>   mtd: nand: lpc32xx: return error code of nand_scan_ident/tail() on
> error
>   mtd: nand: mediatek: return error code of nand_scan_ident/tail() on
> error
>   mtd: nand: mxc: return error code of nand_scan_ident/tail() on error
>   mtd: nand: omap2: return error code of nand_scan_ident/tail() on error
>   mtd: nand: vf610: return error code of nand_scan_ident/tail() on error
>   mtd: nand: cafe: return error code of nand_scan_ident() on error
>   mtd: nand: hisi504: return error code of nand_scan_ident() on error
>   mtd: nand: pxa3xx: return error code of nand_scan_ident() on error
>   mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()
>   mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() combo
> 
>  drivers/mtd/nand/ams-delta.c |  5 ++---
>  drivers/mtd/nand/atmel_nand.c| 10 --
>  drivers/mtd/nand/brcmnand/brcmnand.c | 10 ++
>  drivers/mtd/nand/cafe_nand.c |  5 ++---
>  drivers/mtd/nand/cmx270_nand.c   |  4 ++--
>  drivers/mtd/nand/cs553x_nand.c   |  5 ++---
>  drivers/mtd/nand/fsmc_nand.c |  9 -
>  drivers/mtd/nand/gpio.c  |  5 ++---
>  drivers/mtd/nand/hisi504_nand.c  |  4 +---
>  drivers/mtd/nand/lpc32xx_mlc.c   | 10 --
>  drivers/mtd/nand/lpc32xx_slc.c   |  9 +++--
>  drivers/mtd/nand/mpc5121_nfc.c   |  4 ++--
>  drivers/mtd/nand/mtk_nand.c  |  4 ++--
>  drivers/mtd/nand/mxc_nand.c  | 10 --
>  drivers/mtd/nand/nandsim.c   |  4 
>  drivers/mtd/nand/omap2.c |  9 -
>  drivers/mtd/nand/orion_nand.c|  5 ++---
>  drivers/mtd/nand/pasemi_nand.c   |  5 ++---
>  drivers/mtd/nand/plat_nand.c |  5 ++---
>  drivers/mtd/nand/pxa3xx_nand.c   |  5 +++--
>  drivers/mtd/nand/socrates_nand.c | 12 ++--
>  drivers/mtd/nand/tmio_nand.c |  6 +++---
>  drivers/mtd/nand/vf610_nfc.c | 10 --
>  23 files changed, 62 insertions(+), 93 deletions(-)
> 



Re: [PATCH][v2] driver/memory: Update dependency of IFC for Layerscape

2016-07-04 Thread Boris Brezillon
+PPC maintainers.

Hi Raghav,

Since you're touching powerpc drivers, the least you could do is add
ppc maintainers in Cc, so that they can ack/review your patch...

On Fri, 1 Jul 2016 21:32:30 +0530
Raghav Dogra  wrote:

> This patch enables IFC NAND support on ARM layerscape platform.
> It fixes the dependency to enable NAND. The include files are being modified
> to ensure complilation for both PowerPC and ARM architectures.

Still think this could be separated in 2 commits:
- the first one getting rid of the asm/prom.h inclusion
- the second one changing the Kconfig dependency

> 
> Signed-off-by: Raghav Dogra 
> ---
> Applicable to git://git.infradead.org/l2-mtd.git
> 
> Changes for v2: updated commit description
> 
>  drivers/memory/Kconfig   | 2 +-
>  drivers/memory/fsl_ifc.c | 4 +++-
>  drivers/mtd/nand/Kconfig | 2 +-
>  3 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 81ddb17..5645705 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -104,7 +104,7 @@ config FSL_CORENET_CF
>  
>  config FSL_IFC
>   bool
> - depends on FSL_SOC
> + depends on FSL_SOC || ARCH_LAYERSCAPE
>  
>  config JZ4780_NEMC
>   bool "Ingenic JZ4780 SoC NEMC driver"
> diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
> index 904b4af..1b182b1 100644
> --- a/drivers/memory/fsl_ifc.c
> +++ b/drivers/memory/fsl_ifc.c
> @@ -31,7 +31,9 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
> +#include 
> +#include 
>  
>  struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
>  EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
> index f05e0e9..eace3ef 100644
> --- a/drivers/mtd/nand/Kconfig
> +++ b/drivers/mtd/nand/Kconfig
> @@ -438,7 +438,7 @@ config MTD_NAND_FSL_ELBC
>  
>  config MTD_NAND_FSL_IFC
>   tristate "NAND support for Freescale IFC controller"
> - depends on MTD_NAND && FSL_SOC
> + depends on MTD_NAND && (FSL_SOC || ARCH_LAYERSCAPE)
>   select FSL_IFC
>   select MEMORY
>   help

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH][v3] mtd/ifc: Add support for IFC controller version 2.0

2016-05-27 Thread Boris Brezillon
On Fri, 27 May 2016 14:12:47 -0700
Brian Norris <computersforpe...@gmail.com> wrote:
> 
> > Anyway, Brian, can you take it into your tree and make it appear in
> > -rc1 (or earlier if it's still possible)?  
> 
> Not sure how I could get it any "earlier"? It's not making -rc1 at this
> point.

I meant -rc2 :)


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH][v3] mtd/ifc: Add support for IFC controller version 2.0

2016-05-27 Thread Boris Brezillon
Hi Leo,

On Fri, 27 May 2016 15:15:00 -0500
Leo Li <pku@gmail.com> wrote:

> On Wed, May 25, 2016 at 3:34 PM, Boris Brezillon
> <boris.brezil...@free-electrons.com> wrote:
> > On Wed, 25 May 2016 14:18:43 -0500
> > Leo Li <pku@gmail.com> wrote:
> >  
> >> On Thu, Apr 7, 2016 at 7:45 PM, Boris Brezillon
> >> <boris.brezil...@free-electrons.com> wrote:  
> >> > On Wed, 6 Apr 2016 18:53:39 +
> >> > Yang-Leo Li <leoyang...@nxp.com> wrote:
> >> >  
> >> >>
> >> >>  
> >> >> > -Original Message-
> >> >> > From: Brian Norris [mailto:computersforpe...@gmail.com]
> >> >> > Sent: Wednesday, April 06, 2016 12:53 PM
> >> >> > To: Li Yang <le...@freescale.com>
> >> >> > Cc: Scott Wood <o...@buserror.net>; Raghav Dogra 
> >> >> > <raghav.do...@nxp.com>;
> >> >> > linux-...@lists.infradead.org; linuxppc-dev 
> >> >> > <linuxppc-dev@lists.ozlabs.org>;
> >> >> > Prabhakar Kushwaha <prabhakar.kushw...@nxp.com>; Raghav Dogra
> >> >> > <rag...@freescale.com>; Jaiprakash Singh <b44...@freescale.com>; Boris
> >> >> > Brezillon <boris.brezil...@free-electrons.com>
> >> >> > Subject: Re: [PATCH][v3] mtd/ifc: Add support for IFC controller 
> >> >> > version 2.0
> >> >> >
> >> >> > Hi,
> >> >> >
> >> >> > On Wed, Mar 30, 2016 at 03:43:40PM -0500, Li Yang wrote:  
> >> >> > > Hi Brian,
> >> >> > >
> >> >> > > Could you help to review and pull in this patch and the Kconfig 
> >> >> > > update
> >> >> > > after this patch(https://patchwork.ozlabs.org/patch/557389/)?  It  
> >> >> >
> >> >> > It's probably best for Boris to apply this now.  
> >> >>
> >> >> Thanks Brian.  I see Boris is taking over the maintenance of NAND 
> >> >> recently, we will follow up with him.
> >> >>
> >> >> Hi Boris,
> >> >>
> >> >> Can you consider to pull in this patch and then Kconfig patch 
> >> >> (https://patchwork.ozlabs.org/patch/557389/)?  
> >> >
> >> > Applied.
> >> >
> >> > Thanks,
> >> >
> >> > Boris  
> >>
> >> Hi Boris,
> >>
> >> It seems that the patch at https://patchwork.ozlabs.org/patch/557389/
> >> mentioned above was not in tree for 4.7.  Can you review and apply
> >> that patch too?  
> >
> > I see it in the PR Brian sent 2 days ago [1], so it should appear in
> > Linus tree soon.
> >
> > Regards,
> >
> > Boris
> >
> > [1]https://lkml.org/lkml/2016/5/24/9  
> 
> 
> The pull request does have patch "mtd/ifc: Add support for IFC
> controller version 2.0", but it doesn't have another patch
> "driver/memory: Update dependency of IFC for
> Layerscape"(https://patchwork.ozlabs.org/patch/557389/) needed to make
> the driver selectable on new hardware.

Sorry, I overlooked that part in your different emails (even though you
clearly stated that you needed both patches).

For my defense, I haven't followed the patch series from the beginning,
and only took the patch because Brian suggested to do so (and the
changes seemed ok).
It would have been clearer if the different patches were part of the
same series.

Anyway, Brian, can you take it into your tree and make it appear in
-rc1 (or earlier if it's still possible)?

BTW, in the patch description you say you're only modifying a Kconfig
dependency, but you're actually doing more than that: you're removing
an asm header inclusion and manually include several other headers
(which I guess were previously included by asm/prom.h).

Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH][v3] mtd/ifc: Add support for IFC controller version 2.0

2016-05-25 Thread Boris Brezillon
On Wed, 25 May 2016 14:18:43 -0500
Leo Li <pku@gmail.com> wrote:

> On Thu, Apr 7, 2016 at 7:45 PM, Boris Brezillon
> <boris.brezil...@free-electrons.com> wrote:
> > On Wed, 6 Apr 2016 18:53:39 +
> > Yang-Leo Li <leoyang...@nxp.com> wrote:
> >  
> >>
> >>  
> >> > -Original Message-
> >> > From: Brian Norris [mailto:computersforpe...@gmail.com]
> >> > Sent: Wednesday, April 06, 2016 12:53 PM
> >> > To: Li Yang <le...@freescale.com>
> >> > Cc: Scott Wood <o...@buserror.net>; Raghav Dogra <raghav.do...@nxp.com>;
> >> > linux-...@lists.infradead.org; linuxppc-dev 
> >> > <linuxppc-dev@lists.ozlabs.org>;
> >> > Prabhakar Kushwaha <prabhakar.kushw...@nxp.com>; Raghav Dogra
> >> > <rag...@freescale.com>; Jaiprakash Singh <b44...@freescale.com>; Boris
> >> > Brezillon <boris.brezil...@free-electrons.com>
> >> > Subject: Re: [PATCH][v3] mtd/ifc: Add support for IFC controller version 
> >> > 2.0
> >> >
> >> > Hi,
> >> >
> >> > On Wed, Mar 30, 2016 at 03:43:40PM -0500, Li Yang wrote:  
> >> > > Hi Brian,
> >> > >
> >> > > Could you help to review and pull in this patch and the Kconfig update
> >> > > after this patch(https://patchwork.ozlabs.org/patch/557389/)?  It  
> >> >
> >> > It's probably best for Boris to apply this now.  
> >>
> >> Thanks Brian.  I see Boris is taking over the maintenance of NAND 
> >> recently, we will follow up with him.
> >>
> >> Hi Boris,
> >>
> >> Can you consider to pull in this patch and then Kconfig patch 
> >> (https://patchwork.ozlabs.org/patch/557389/)?  
> >
> > Applied.
> >
> > Thanks,
> >
> > Boris  
> 
> Hi Boris,
> 
> It seems that the patch at https://patchwork.ozlabs.org/patch/557389/
> mentioned above was not in tree for 4.7.  Can you review and apply
> that patch too?

I see it in the PR Brian sent 2 days ago [1], so it should appear in
Linus tree soon.

Regards,

Boris

[1]https://lkml.org/lkml/2016/5/24/9

> 
> Regards,
> Leo



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V3] mtd: nand: pasemi: switch to dev_* printing functions

2016-04-13 Thread Boris Brezillon
On Wed, 13 Apr 2016 11:48:05 +0200
Rafał Miłecki <zaj...@gmail.com> wrote:

> It also contains some minor related changes:
> 1) Don't warn if kzalloc fails as it dumps stack on its own
> 2) Use %pR format for displaying whole resource to avoid:
> warning: format ‘%08llx’ expects type ‘long long unsigned int’, but argument 
> 2 has type ‘resource_size_t’
> 
> Signed-off-by: Rafał Miłecki <zaj...@gmail.com>

Applied with a slightly different commit message to avoid "Possible
unwrapped commit description" checkpatch warning.

Thanks,

Boris

> ---
> V3: Switch to dev_* instead of pr_*
> ---
>  drivers/mtd/nand/pasemi_nand.c | 15 +++
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
> index 63fcb8c..5de7591 100644
> --- a/drivers/mtd/nand/pasemi_nand.c
> +++ b/drivers/mtd/nand/pasemi_nand.c
> @@ -92,8 +92,9 @@ int pasemi_device_ready(struct mtd_info *mtd)
>  
>  static int pasemi_nand_probe(struct platform_device *ofdev)
>  {
> + struct device *dev = >dev;
>   struct pci_dev *pdev;
> - struct device_node *np = ofdev->dev.of_node;
> + struct device_node *np = dev->of_node;
>   struct resource res;
>   struct nand_chip *chip;
>   int err = 0;
> @@ -107,13 +108,11 @@ static int pasemi_nand_probe(struct platform_device 
> *ofdev)
>   if (pasemi_nand_mtd)
>   return -ENODEV;
>  
> - pr_debug("pasemi_nand at %pR\n", );
> + dev_dbg(dev, "pasemi_nand at %pR\n", );
>  
>   /* Allocate memory for MTD device structure and private data */
>   chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
>   if (!chip) {
> - printk(KERN_WARNING
> -"Unable to allocate PASEMI NAND MTD device structure\n");
>   err = -ENOMEM;
>   goto out;
>   }
> @@ -121,7 +120,7 @@ static int pasemi_nand_probe(struct platform_device 
> *ofdev)
>   pasemi_nand_mtd = nand_to_mtd(chip);
>  
>   /* Link the private data with the MTD structure */
> - pasemi_nand_mtd->dev.parent = >dev;
> + pasemi_nand_mtd->dev.parent = dev;
>  
>   chip->IO_ADDR_R = of_iomap(np, 0);
>   chip->IO_ADDR_W = chip->IO_ADDR_R;
> @@ -163,13 +162,13 @@ static int pasemi_nand_probe(struct platform_device 
> *ofdev)
>   }
>  
>   if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
> - printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
> + dev_err(dev, "Unable to register MTD device\n");
>   err = -ENODEV;
>   goto out_lpc;
>   }
>  
> - printk(KERN_INFO "PA Semi NAND flash at %08llx, control at I/O %x\n",
> -res.start, lpcctl);
> + dev_info(dev, "PA Semi NAND flash at %pR, control at I/O %x\n", ,
> +  lpcctl);
>  
>   return 0;
>  



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V2] mtd: nand: pasemi: switch to pr_* functions

2016-04-13 Thread Boris Brezillon
Hi,

On Sat, 9 Apr 2016 12:50:35 +0300
Andy Shevchenko <andy.shevche...@gmail.com> wrote:

> On Fri, Apr 8, 2016 at 2:13 PM, Rafał Miłecki <zaj...@gmail.com> wrote:
> > 1) Use pr_fmt to keep messages consistent
> > 2) Don't warn if kzalloc fails as it dumps stack on its own
> > 3) Use %pR format for displaying whole resource to avoid:
> > warning: format ‘%08llx’ expects type ‘long long unsigned int’, but 
> > argument 2 has type ‘resource_size_t’
> >
> > Signed-off-by: Rafał Miłecki <zaj...@gmail.com>
> > ---
> >  drivers/mtd/nand/pasemi_nand.c | 9 -
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
> > index 63fcb8c..e8372b4 100644
> > --- a/drivers/mtd/nand/pasemi_nand.c
> > +++ b/drivers/mtd/nand/pasemi_nand.c
> > @@ -22,6 +22,8 @@
> >
> >  #undef DEBUG
> >
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > +
> >  #include 
> >  #include 
> >  #include 
> > @@ -112,8 +114,6 @@ static int pasemi_nand_probe(struct platform_device 
> > *ofdev)
> > /* Allocate memory for MTD device structure and private data */
> > chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
> > if (!chip) {
> > -   printk(KERN_WARNING
> > -  "Unable to allocate PASEMI NAND MTD device 
> > structure\n");
> > err = -ENOMEM;
> > goto out;
> > }
> > @@ -163,13 +163,12 @@ static int pasemi_nand_probe(struct platform_device 
> > *ofdev)
> > }
> >
> > if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
> > -   printk(KERN_ERR "pasemi_nand: Unable to register MTD 
> > device\n");
> > +   pr_err("Unable to register MTD device\n");
> 
> And why not to use dev_err(>dev, …); ?

Yep, I think it's better to use dev_err().

Best Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH][v3] mtd/ifc: Add support for IFC controller version 2.0

2016-04-07 Thread Boris Brezillon
On Wed, 6 Apr 2016 18:53:39 +
Yang-Leo Li <leoyang...@nxp.com> wrote:

> 
> 
> > -Original Message-
> > From: Brian Norris [mailto:computersforpe...@gmail.com]
> > Sent: Wednesday, April 06, 2016 12:53 PM
> > To: Li Yang <le...@freescale.com>
> > Cc: Scott Wood <o...@buserror.net>; Raghav Dogra <raghav.do...@nxp.com>;
> > linux-...@lists.infradead.org; linuxppc-dev <linuxppc-dev@lists.ozlabs.org>;
> > Prabhakar Kushwaha <prabhakar.kushw...@nxp.com>; Raghav Dogra
> > <rag...@freescale.com>; Jaiprakash Singh <b44...@freescale.com>; Boris
> > Brezillon <boris.brezil...@free-electrons.com>
> > Subject: Re: [PATCH][v3] mtd/ifc: Add support for IFC controller version 2.0
> > 
> > Hi,
> > 
> > On Wed, Mar 30, 2016 at 03:43:40PM -0500, Li Yang wrote:
> > > Hi Brian,
> > >
> > > Could you help to review and pull in this patch and the Kconfig update
> > > after this patch(https://patchwork.ozlabs.org/patch/557389/)?  It
> > 
> > It's probably best for Boris to apply this now.
> 
> Thanks Brian.  I see Boris is taking over the maintenance of NAND recently, 
> we will follow up with him.
> 
> Hi Boris,
> 
> Can you consider to pull in this patch and then Kconfig patch 
> (https://patchwork.ozlabs.org/patch/557389/)?

Applied.

Thanks,

Boris


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v5 3/6] clk: Move all drivers to use internal API

2014-08-13 Thread Boris BREZILLON
Hi Tomeu,

On Wed,  6 Aug 2014 15:57:48 +0200
Tomeu Vizoso tomeu.viz...@collabora.com wrote:

 In preparation to change the public API to return a per-user clk structure,
 remove any usage of this public API from the clock implementations.
 
 The reason for having this in a separate commit from the one that introduces
 the implementation of the new functions is to separate the changes generated
 with Coccinelle from the rest, and keep the patches' size reasonable.
 

You can add my:

Tested-by: Boris Brezillon boris.brezil...@free-electrons.com

and

Acked-by: Boris Brezillon boris.brezil...@free-electrons.com

for the at91 part.

 Signed-off-by: Tomeu Vizoso tomeu.viz...@collabora.com

Best Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev