All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] mtd: rawnand: fsl_upm: Convert to exec_op() (and more)
@ 2020-06-03 13:49 ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

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


^ permalink raw reply	[flat|nested] 65+ messages in thread

* [PATCH 00/10] mtd: rawnand: fsl_upm: Convert to exec_op() (and more)
@ 2020-06-03 13:49 ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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(&fun->chip);
 		int cnt = 1000000;
 
 		while (--cnt && !fun_chip_ready(&fun->chip))
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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(&fun->chip);
 		int cnt = 1000000;
 
 		while (--cnt && !fun_chip_ready(&fun->chip))
-- 
2.25.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

fsl_upm_nand.parts is unused, let's get rid of it.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

fsl_upm_nand.parts is unused, let's get rid of it.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

This simplifies the init error patch and remove function.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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(&ofdev->dev, sizeof(*fun), GFP_KERNEL);
 	if (!fun)
 		return -ENOMEM;
 
 	ret = of_address_to_resource(ofdev->dev.of_node, 0, &io_res);
 	if (ret) {
 		dev_err(&ofdev->dev, "can't get IO base\n");
-		goto err1;
+		return ret;
 	}
 
 	ret = fsl_upm_find(io_res.start, &fun->upm);
 	if (ret) {
 		dev_err(&ofdev->dev, "can't find UPM\n");
-		goto err1;
+		return ret;
 	}
 
 	prop = of_get_property(ofdev->dev.of_node, "fsl,upm-addr-offset",
 			       &size);
 	if (!prop || size != sizeof(uint32_t)) {
 		dev_err(&ofdev->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", &size);
 	if (!prop || size != sizeof(uint32_t)) {
 		dev_err(&ofdev->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(&ofdev->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


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

This simplifies the init error patch and remove function.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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(&ofdev->dev, sizeof(*fun), GFP_KERNEL);
 	if (!fun)
 		return -ENOMEM;
 
 	ret = of_address_to_resource(ofdev->dev.of_node, 0, &io_res);
 	if (ret) {
 		dev_err(&ofdev->dev, "can't get IO base\n");
-		goto err1;
+		return ret;
 	}
 
 	ret = fsl_upm_find(io_res.start, &fun->upm);
 	if (ret) {
 		dev_err(&ofdev->dev, "can't find UPM\n");
-		goto err1;
+		return ret;
 	}
 
 	prop = of_get_property(ofdev->dev.of_node, "fsl,upm-addr-offset",
 			       &size);
 	if (!prop || size != sizeof(uint32_t)) {
 		dev_err(&ofdev->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", &size);
 	if (!prop || size != sizeof(uint32_t)) {
 		dev_err(&ofdev->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(&ofdev->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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

This simplifies the init() error path and the remove() handler.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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(&fun->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


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

This simplifies the init() error path and the remove() handler.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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(&fun->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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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 <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/mtd.h>
-#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/io.h>
@@ -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, &io_res);
-	if (ret) {
-		dev_err(&ofdev->dev, "can't get IO base\n");
-		return ret;
-	}
+	io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
+	fun->io_base = devm_ioremap_resource(&ofdev->dev, io_res);
+	if (IS_ERR(fun->io_base))
+		return PTR_ERR(fun->io_base);
 
-	ret = fsl_upm_find(io_res.start, &fun->upm);
+	ret = fsl_upm_find(io_res->start, &fun->upm);
 	if (ret) {
 		dev_err(&ofdev->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(&ofdev->dev, io_res.start,
-					    resource_size(&io_res));
-	if (!fun->io_base) {
-		ret = -ENOMEM;
-		goto err2;
-	}
-
 	fun->dev = &ofdev->dev;
 	fun->last_ctrl = NAND_CLE;
 
-	ret = fun_chip_init(fun, ofdev->dev.of_node, &io_res);
+	ret = fun_chip_init(fun, ofdev->dev.of_node, io_res);
 	if (ret)
 		goto err2;
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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 <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/mtd.h>
-#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
 #include <linux/io.h>
@@ -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, &io_res);
-	if (ret) {
-		dev_err(&ofdev->dev, "can't get IO base\n");
-		return ret;
-	}
+	io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
+	fun->io_base = devm_ioremap_resource(&ofdev->dev, io_res);
+	if (IS_ERR(fun->io_base))
+		return PTR_ERR(fun->io_base);
 
-	ret = fsl_upm_find(io_res.start, &fun->upm);
+	ret = fsl_upm_find(io_res->start, &fun->upm);
 	if (ret) {
 		dev_err(&ofdev->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(&ofdev->dev, io_res.start,
-					    resource_size(&io_res));
-	if (!fun->io_base) {
-		ret = -ENOMEM;
-		goto err2;
-	}
-
 	fun->dev = &ofdev->dev;
 	fun->last_ctrl = NAND_CLE;
 
-	ret = fun_chip_init(fun, ofdev->dev.of_node, &io_res);
+	ret = fun_chip_init(fun, ofdev->dev.of_node, io_res);
 	if (ret)
 		goto err2;
 
-- 
2.25.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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 <linux/mtd/partitions.h>
 #include <linux/mtd/mtd.h>
 #include <linux/of_platform.h>
-#include <linux/of_gpio.h>
 #include <linux/io.h>
 #include <linux/slab.h>
 #include <asm/fsl_lbc.h>
@@ -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(&ofdev->dev));
-			if (ret) {
-				dev_err(&ofdev->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(&ofdev->dev,
+								 NULL, i,
+								 GPIOD_IN);
+		if (IS_ERR(fun->rnb_gpio[i])) {
 			dev_err(&ofdev->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(&ofdev->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(&ofdev->dev);
 	struct nand_chip *chip = &fun->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


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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 <linux/mtd/partitions.h>
 #include <linux/mtd/mtd.h>
 #include <linux/of_platform.h>
-#include <linux/of_gpio.h>
 #include <linux/io.h>
 #include <linux/slab.h>
 #include <asm/fsl_lbc.h>
@@ -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(&ofdev->dev));
-			if (ret) {
-				dev_err(&ofdev->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(&ofdev->dev,
+								 NULL, i,
+								 GPIOD_IN);
+		if (IS_ERR(fun->rnb_gpio[i])) {
 			dev_err(&ofdev->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(&ofdev->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(&ofdev->dev);
 	struct nand_chip *chip = &fun->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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

Explicitly inherit from nand_controller instead of relying on the
nand_chip.legacy.dummy_controller field.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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 = &fun->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(&fun->base);
 	fun->dev = &ofdev->dev;
 	fun->last_ctrl = NAND_CLE;
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

Explicitly inherit from nand_controller instead of relying on the
nand_chip.legacy.dummy_controller field.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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 = &fun->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(&fun->base);
 	fun->dev = &ofdev->dev;
 	fun->last_ctrl = NAND_CLE;
 
-- 
2.25.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

Implement exec_op() so we can get rid of the legacy interface
implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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(&fun->upm, fun->upm_cmd_offset);
+		mar = (instr->ctx.cmd.opcode << (32 - fun->upm.width)) |
+		      reg_offs;
+		fsl_upm_run_pattern(&fun->upm, fun->io_base + reg_offs, mar);
+		fsl_upm_end_pattern(&fun->upm);
+		return 0;
+
+	case NAND_OP_ADDR_INSTR:
+		fsl_upm_start_pattern(&fun->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(&fun->upm, fun->io_base + reg_offs, mar);
+		}
+		fsl_upm_end_pattern(&fun->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, &op->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(&fun->base);
+	fun->base.ops = &fun_ops;
 	fun->dev = &ofdev->dev;
 	fun->last_ctrl = NAND_CLE;
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

Implement exec_op() so we can get rid of the legacy interface
implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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(&fun->upm, fun->upm_cmd_offset);
+		mar = (instr->ctx.cmd.opcode << (32 - fun->upm.width)) |
+		      reg_offs;
+		fsl_upm_run_pattern(&fun->upm, fun->io_base + reg_offs, mar);
+		fsl_upm_end_pattern(&fun->upm);
+		return 0;
+
+	case NAND_OP_ADDR_INSTR:
+		fsl_upm_start_pattern(&fun->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(&fun->upm, fun->io_base + reg_offs, mar);
+		}
+		fsl_upm_end_pattern(&fun->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, &op->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(&fun->base);
+	fun->base.ops = &fun_ops;
 	fun->dev = &ofdev->dev;
 	fun->last_ctrl = NAND_CLE;
 
-- 
2.25.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

Now that the driver implements exec_op(), we can get rid of the legacy
interface implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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 <linux/slab.h>
 #include <asm/fsl_lbc.h>
 
-#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 = 1000000;
-
-		while (--cnt && !fun_chip_ready(&fun->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(&fun->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(&fun->upm, fun->upm_addr_offset);
-		else if (ctrl & NAND_CLE)
-			fsl_upm_start_pattern(&fun->upm, fun->upm_cmd_offset);
-	}
-
-	mar = (cmd << (32 - fun->upm.width)) |
-		fun->mchip_offsets[fun->mchip_number];
-	fsl_upm_run_pattern(&fun->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.legacy.cmd_ctrl = fun_cmd_ctrl;
-	fun->chip.legacy.chip_delay = fun->chip_delay;
-	fun->chip.legacy.read_byte = fun_read_byte;
-	fun->chip.legacy.read_buf = fun_read_buf;
-	fun->chip.legacy.write_buf = fun_write_buf;
 	fun->chip.ecc.mode = NAND_ECC_SOFT;
 	fun->chip.ecc.algo = NAND_ECC_HAMMING;
-	if (fun->mchip_count > 1)
-		fun->chip.legacy.select_chip = fun_select_chip;
-
-	if (!fun->rnb_gpio[0])
-		fun->chip.legacy.dev_ready = fun_chip_ready;
-
 	fun->chip.controller = &fun->base;
 	mtd->dev.parent = fun->dev;
 
@@ -342,23 +223,9 @@ static int fun_probe(struct platform_device *ofdev)
 		}
 	}
 
-	prop = of_get_property(ofdev->dev.of_node, "chip-delay", NULL);
-	if (prop)
-		fun->chip_delay = be32_to_cpup(prop);
-	else
-		fun->chip_delay = 50;
-
-	prop = of_get_property(ofdev->dev.of_node, "fsl,upm-wait-flags", &size);
-	if (prop && size == sizeof(uint32_t))
-		fun->wait_flags = be32_to_cpup(prop);
-	else
-		fun->wait_flags = FSL_UPM_WAIT_RUN_PATTERN |
-				  FSL_UPM_WAIT_WRITE_BYTE;
-
 	nand_controller_init(&fun->base);
 	fun->base.ops = &fun_ops;
 	fun->dev = &ofdev->dev;
-	fun->last_ctrl = NAND_CLE;
 
 	ret = fun_chip_init(fun, ofdev->dev.of_node, io_res);
 	if (ret)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

Now that the driver implements exec_op(), we can get rid of the legacy
interface implementation.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 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 <linux/slab.h>
 #include <asm/fsl_lbc.h>
 
-#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 = 1000000;
-
-		while (--cnt && !fun_chip_ready(&fun->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(&fun->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(&fun->upm, fun->upm_addr_offset);
-		else if (ctrl & NAND_CLE)
-			fsl_upm_start_pattern(&fun->upm, fun->upm_cmd_offset);
-	}
-
-	mar = (cmd << (32 - fun->upm.width)) |
-		fun->mchip_offsets[fun->mchip_number];
-	fsl_upm_run_pattern(&fun->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.legacy.cmd_ctrl = fun_cmd_ctrl;
-	fun->chip.legacy.chip_delay = fun->chip_delay;
-	fun->chip.legacy.read_byte = fun_read_byte;
-	fun->chip.legacy.read_buf = fun_read_buf;
-	fun->chip.legacy.write_buf = fun_write_buf;
 	fun->chip.ecc.mode = NAND_ECC_SOFT;
 	fun->chip.ecc.algo = NAND_ECC_HAMMING;
-	if (fun->mchip_count > 1)
-		fun->chip.legacy.select_chip = fun_select_chip;
-
-	if (!fun->rnb_gpio[0])
-		fun->chip.legacy.dev_ready = fun_chip_ready;
-
 	fun->chip.controller = &fun->base;
 	mtd->dev.parent = fun->dev;
 
@@ -342,23 +223,9 @@ static int fun_probe(struct platform_device *ofdev)
 		}
 	}
 
-	prop = of_get_property(ofdev->dev.of_node, "chip-delay", NULL);
-	if (prop)
-		fun->chip_delay = be32_to_cpup(prop);
-	else
-		fun->chip_delay = 50;
-
-	prop = of_get_property(ofdev->dev.of_node, "fsl,upm-wait-flags", &size);
-	if (prop && size == sizeof(uint32_t))
-		fun->wait_flags = be32_to_cpup(prop);
-	else
-		fun->wait_flags = FSL_UPM_WAIT_RUN_PATTERN |
-				  FSL_UPM_WAIT_WRITE_BYTE;
-
 	nand_controller_init(&fun->base);
 	fun->base.ops = &fun_ops;
 	fun->dev = &ofdev->dev;
-	fun->last_ctrl = NAND_CLE;
 
 	ret = fun_chip_init(fun, ofdev->dev.of_node, io_res);
 	if (ret)
-- 
2.25.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags
  2020-06-03 13:49 ` Boris Brezillon
@ 2020-06-03 13:49   ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Boris Brezillon, Paul Mackerras, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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


^ permalink raw reply related	[flat|nested] 65+ messages in thread

* [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags
@ 2020-06-03 13:49   ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:49 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Benjamin Herrenschmidt, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Boris Brezillon, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

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 <boris.brezillon@collabora.com>
---
 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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 65+ messages in thread

* Re: [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 13:50     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:50 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:13 +0200:

> 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 <boris.brezillon@collabora.com>
> ---
>  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(&fun->chip);
>  		int cnt = 1000000;
>  
>  		while (--cnt && !fun_chip_ready(&fun->chip))

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var
@ 2020-06-03 13:50     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:50 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:13 +0200:

> 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 <boris.brezillon@collabora.com>
> ---
>  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(&fun->chip);
>  		int cnt = 1000000;
>  
>  		while (--cnt && !fun_chip_ready(&fun->chip))

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 13:50     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:50 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:14 +0200:

> fsl_upm_nand.parts is unused, let's get rid of it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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;

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
@ 2020-06-03 13:50     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:50 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:14 +0200:

> fsl_upm_nand.parts is unused, let's get rid of it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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;

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl,upm-wait-flags
  2020-06-03 13:49   ` Boris Brezillon
  (?)
@ 2020-06-03 13:52     ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:52 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, Rob Herring, devicetree

And I forgot to Cc the DT maintainer/ML on this one :-/

On Wed,  3 Jun 2020 15:49:22 +0200
Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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>;


^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl,upm-wait-flags
@ 2020-06-03 13:52     ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:52 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: devicetree, Vignesh Raghavendra, Tudor Ambarus,
	Richard Weinberger, Rob Herring, Paul Mackerras, linuxppc-dev

And I forgot to Cc the DT maintainer/ML on this one :-/

On Wed,  3 Jun 2020 15:49:22 +0200
Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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>;


^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl,upm-wait-flags
@ 2020-06-03 13:52     ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:52 UTC (permalink / raw)
  To: Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: devicetree, Benjamin Herrenschmidt, Vignesh Raghavendra,
	Tudor Ambarus, Richard Weinberger, Rob Herring, Paul Mackerras,
	Michael Ellerman, linuxppc-dev

And I forgot to Cc the DT maintainer/ML on this one :-/

On Wed,  3 Jun 2020 15:49:22 +0200
Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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>;


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 13:52     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:52 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:15 +0200:

> This simplifies the init error patch and remove function.

                                 path?

Otherwise:

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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(&ofdev->dev, sizeof(*fun), GFP_KERNEL);
>  	if (!fun)
>  		return -ENOMEM;
>  
>  	ret = of_address_to_resource(ofdev->dev.of_node, 0, &io_res);
>  	if (ret) {
>  		dev_err(&ofdev->dev, "can't get IO base\n");
> -		goto err1;
> +		return ret;
>  	}
>  
>  	ret = fsl_upm_find(io_res.start, &fun->upm);
>  	if (ret) {
>  		dev_err(&ofdev->dev, "can't find UPM\n");
> -		goto err1;
> +		return ret;
>  	}
>  
>  	prop = of_get_property(ofdev->dev.of_node, "fsl,upm-addr-offset",
>  			       &size);
>  	if (!prop || size != sizeof(uint32_t)) {
>  		dev_err(&ofdev->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", &size);
>  	if (!prop || size != sizeof(uint32_t)) {
>  		dev_err(&ofdev->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(&ofdev->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;
>  }
>  

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()
@ 2020-06-03 13:52     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:52 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:15 +0200:

> This simplifies the init error patch and remove function.

                                 path?

Otherwise:

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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(&ofdev->dev, sizeof(*fun), GFP_KERNEL);
>  	if (!fun)
>  		return -ENOMEM;
>  
>  	ret = of_address_to_resource(ofdev->dev.of_node, 0, &io_res);
>  	if (ret) {
>  		dev_err(&ofdev->dev, "can't get IO base\n");
> -		goto err1;
> +		return ret;
>  	}
>  
>  	ret = fsl_upm_find(io_res.start, &fun->upm);
>  	if (ret) {
>  		dev_err(&ofdev->dev, "can't find UPM\n");
> -		goto err1;
> +		return ret;
>  	}
>  
>  	prop = of_get_property(ofdev->dev.of_node, "fsl,upm-addr-offset",
>  			       &size);
>  	if (!prop || size != sizeof(uint32_t)) {
>  		dev_err(&ofdev->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", &size);
>  	if (!prop || size != sizeof(uint32_t)) {
>  		dev_err(&ofdev->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(&ofdev->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;
>  }
>  

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 13:55     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:55 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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(&fun->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?


^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
@ 2020-06-03 13:55     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:55 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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(&fun->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?


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 13:58     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:58 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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 <linux/mtd/nand_ecc.h>
>  #include <linux/mtd/partitions.h>
>  #include <linux/mtd/mtd.h>
> -#include <linux/of_address.h>
>  #include <linux/of_platform.h>
>  #include <linux/of_gpio.h>
>  #include <linux/io.h>
> @@ -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, &io_res);
> -	if (ret) {
> -		dev_err(&ofdev->dev, "can't get IO base\n");
> -		return ret;
> -	}
> +	io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> +	fun->io_base = devm_ioremap_resource(&ofdev->dev, io_res);

Why not even using devm_platform_ioremap_resource() resource directly?

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
@ 2020-06-03 13:58     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:58 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> ---
>  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 <linux/mtd/nand_ecc.h>
>  #include <linux/mtd/partitions.h>
>  #include <linux/mtd/mtd.h>
> -#include <linux/of_address.h>
>  #include <linux/of_platform.h>
>  #include <linux/of_gpio.h>
>  #include <linux/io.h>
> @@ -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, &io_res);
> -	if (ret) {
> -		dev_err(&ofdev->dev, "can't get IO base\n");
> -		return ret;
> -	}
> +	io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> +	fun->io_base = devm_ioremap_resource(&ofdev->dev, io_res);

Why not even using devm_platform_ioremap_resource() resource directly?

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 13:59     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:59 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:18 +0200:

> 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 <boris.brezillon@collabora.com>
> ---
>  drivers/mtd/nand/raw/fsl_upm.c | 44 ++++++++--------------------------
>  1 file changed, 10 insertions(+), 34 deletions(-)
> 


Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors
@ 2020-06-03 13:59     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 13:59 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:18 +0200:

> 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 <boris.brezillon@collabora.com>
> ---
>  drivers/mtd/nand/raw/fsl_upm.c | 44 ++++++++--------------------------
>  1 file changed, 10 insertions(+), 34 deletions(-)
> 


Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
  2020-06-03 13:55     ` Miquel Raynal
@ 2020-06-03 13:59       ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:59 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev

On Wed, 3 Jun 2020 15:55:31 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> > ---
> >  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(&fun->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.

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
@ 2020-06-03 13:59       ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 13:59 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

On Wed, 3 Jun 2020 15:55:31 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> > ---
> >  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(&fun->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.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
  2020-06-03 13:58     ` Miquel Raynal
@ 2020-06-03 14:00       ` Boris Brezillon
  -1 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 14:00 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev

On Wed, 3 Jun 2020 15:58:02 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> > ---
> >  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 <linux/mtd/nand_ecc.h>
> >  #include <linux/mtd/partitions.h>
> >  #include <linux/mtd/mtd.h>
> > -#include <linux/of_address.h>
> >  #include <linux/of_platform.h>
> >  #include <linux/of_gpio.h>
> >  #include <linux/io.h>
> > @@ -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, &io_res);
> > -	if (ret) {
> > -		dev_err(&ofdev->dev, "can't get IO base\n");
> > -		return ret;
> > -	}
> > +	io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> > +	fun->io_base = devm_ioremap_resource(&ofdev->dev, io_res);  
> 
> Why not even using devm_platform_ioremap_resource() resource directly?

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

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
@ 2020-06-03 14:00       ` Boris Brezillon
  0 siblings, 0 replies; 65+ messages in thread
From: Boris Brezillon @ 2020-06-03 14:00 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

On Wed, 3 Jun 2020 15:58:02 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Boris Brezillon <boris.brezillon@collabora.com> 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 <boris.brezillon@collabora.com>
> > ---
> >  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 <linux/mtd/nand_ecc.h>
> >  #include <linux/mtd/partitions.h>
> >  #include <linux/mtd/mtd.h>
> > -#include <linux/of_address.h>
> >  #include <linux/of_platform.h>
> >  #include <linux/of_gpio.h>
> >  #include <linux/io.h>
> > @@ -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, &io_res);
> > -	if (ret) {
> > -		dev_err(&ofdev->dev, "can't get IO base\n");
> > -		return ret;
> > -	}
> > +	io_res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> > +	fun->io_base = devm_ioremap_resource(&ofdev->dev, io_res);  
> 
> Why not even using devm_platform_ioremap_resource() resource directly?

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

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 14:01     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 14:01 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:19 +0200:

> Explicitly inherit from nand_controller instead of relying on the
> nand_chip.legacy.dummy_controller field.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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 = &fun->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(&fun->base);
>  	fun->dev = &ofdev->dev;
>  	fun->last_ctrl = NAND_CLE;
>  

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller
@ 2020-06-03 14:01     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 14:01 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:19 +0200:

> Explicitly inherit from nand_controller instead of relying on the
> nand_chip.legacy.dummy_controller field.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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 = &fun->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(&fun->base);
>  	fun->dev = &ofdev->dev;
>  	fun->last_ctrl = NAND_CLE;
>  

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-03 14:08     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 14:08 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Anton Vorontsov,
	Richard Weinberger, linux-mtd, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:20 +0200:

> Implement exec_op() so we can get rid of the legacy interface
> implementation.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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(&fun->upm, fun->upm_cmd_offset);
> +		mar = (instr->ctx.cmd.opcode << (32 - fun->upm.width)) |
> +		      reg_offs;
> +		fsl_upm_run_pattern(&fun->upm, fun->io_base + reg_offs, mar);
> +		fsl_upm_end_pattern(&fun->upm);
> +		return 0;
> +
> +	case NAND_OP_ADDR_INSTR:
> +		fsl_upm_start_pattern(&fun->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(&fun->upm, fun->io_base + reg_offs, mar);
> +		}
> +		fsl_upm_end_pattern(&fun->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, &op->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(&fun->base);
> +	fun->base.ops = &fun_ops;
>  	fun->dev = &ofdev->dev;
>  	fun->last_ctrl = NAND_CLE;
>  


Looks fine!

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()
@ 2020-06-03 14:08     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-03 14:08 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Vignesh Raghavendra, Tudor Ambarus, Michael Ellerman,
	Anton Vorontsov, Richard Weinberger, linux-mtd,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev


Boris Brezillon <boris.brezillon@collabora.com> wrote on Wed,  3 Jun
2020 15:49:20 +0200:

> Implement exec_op() so we can get rid of the legacy interface
> implementation.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  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(&fun->upm, fun->upm_cmd_offset);
> +		mar = (instr->ctx.cmd.opcode << (32 - fun->upm.width)) |
> +		      reg_offs;
> +		fsl_upm_run_pattern(&fun->upm, fun->io_base + reg_offs, mar);
> +		fsl_upm_end_pattern(&fun->upm);
> +		return 0;
> +
> +	case NAND_OP_ADDR_INSTR:
> +		fsl_upm_start_pattern(&fun->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(&fun->upm, fun->io_base + reg_offs, mar);
> +		}
> +		fsl_upm_end_pattern(&fun->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, &op->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(&fun->base);
> +	fun->base.ops = &fun_ops;
>  	fun->dev = &ofdev->dev;
>  	fun->last_ctrl = NAND_CLE;
>  


Looks fine!

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:01     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:21 UTC, Boris Brezillon wrote:
> Now that the driver implements exec_op(), we can get rid of the legacy
> interface implementation.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation
@ 2020-06-15  9:01     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:21 UTC, Boris Brezillon wrote:
> Now that the driver implements exec_op(), we can get rid of the legacy
> interface implementation.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:01     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:20 UTC, Boris Brezillon wrote:
> Implement exec_op() so we can get rid of the legacy interface
> implementation.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op()
@ 2020-06-15  9:01     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:20 UTC, Boris Brezillon wrote:
> Implement exec_op() so we can get rid of the legacy interface
> implementation.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:01     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:19 UTC, Boris Brezillon wrote:
> Explicitly inherit from nand_controller instead of relying on the
> nand_chip.legacy.dummy_controller field.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller
@ 2020-06-15  9:01     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:19 UTC, Boris Brezillon wrote:
> Explicitly inherit from nand_controller instead of relying on the
> nand_chip.legacy.dummy_controller field.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:01     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:18 UTC, Boris Brezillon wrote:
> 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 <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors
@ 2020-06-15  9:01     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:18 UTC, Boris Brezillon wrote:
> 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 <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:01     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:17 UTC, Boris Brezillon wrote:
> 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 <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource()
@ 2020-06-15  9:01     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:01 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:17 UTC, Boris Brezillon wrote:
> 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 <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:02     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:16 UTC, Boris Brezillon wrote:
> This simplifies the init() error path and the remove() handler.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name
@ 2020-06-15  9:02     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:16 UTC, Boris Brezillon wrote:
> This simplifies the init() error path and the remove() handler.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:02     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:15 UTC, Boris Brezillon wrote:
> This simplifies the init error patch and remove function.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc()
@ 2020-06-15  9:02     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:15 UTC, Boris Brezillon wrote:
> This simplifies the init error patch and remove function.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:02     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:14 UTC, Boris Brezillon wrote:
> fsl_upm_nand.parts is unused, let's get rid of it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field
@ 2020-06-15  9:02     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:14 UTC, Boris Brezillon wrote:
> fsl_upm_nand.parts is unused, let's get rid of it.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-06-15  9:02     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:13 UTC, Boris Brezillon wrote:
> 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 <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var
@ 2020-06-15  9:02     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-06-15  9:02 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:13 UTC, Boris Brezillon wrote:
> 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 <boris.brezillon@collabora.com>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags
  2020-06-03 13:49   ` Boris Brezillon
@ 2020-07-07 19:04     ` Miquel Raynal
  -1 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-07-07 19:04 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, linuxppc-dev

On Wed, 2020-06-03 at 13:49:22 UTC, 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 <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 65+ messages in thread

* Re: [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags
@ 2020-07-07 19:04     ` Miquel Raynal
  0 siblings, 0 replies; 65+ messages in thread
From: Miquel Raynal @ 2020-07-07 19:04 UTC (permalink / raw)
  To: Boris Brezillon, Anton Vorontsov, Miquel Raynal, linux-mtd
  Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	linuxppc-dev

On Wed, 2020-06-03 at 13:49:22 UTC, 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 <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2020-07-07 19:07 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 13:49 [PATCH 00/10] mtd: rawnand: fsl_upm: Convert to exec_op() (and more) Boris Brezillon
2020-06-03 13:49 ` Boris Brezillon
2020-06-03 13:49 ` [PATCH 01/10] mtd: rawnand: fsl_upm: Remove unused mtd var Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:50   ` Miquel Raynal
2020-06-03 13:50     ` Miquel Raynal
2020-06-15  9:02   ` Miquel Raynal
2020-06-15  9:02     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 02/10] mtd: rawnand: fsl_upm: Get rid of the unused fsl_upm_nand.parts field Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:50   ` Miquel Raynal
2020-06-03 13:50     ` Miquel Raynal
2020-06-15  9:02   ` Miquel Raynal
2020-06-15  9:02     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 03/10] mtd: rawnand: fsl_upm: Allocate the fsl_upm_nand object using devm_kzalloc() Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:52   ` Miquel Raynal
2020-06-03 13:52     ` Miquel Raynal
2020-06-15  9:02   ` Miquel Raynal
2020-06-15  9:02     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 04/10] mtd: rawnand: fsl_upm: Use devm_kasprintf() to allocate the MTD name Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:55   ` Miquel Raynal
2020-06-03 13:55     ` Miquel Raynal
2020-06-03 13:59     ` Boris Brezillon
2020-06-03 13:59       ` Boris Brezillon
2020-06-15  9:02   ` Miquel Raynal
2020-06-15  9:02     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 05/10] mtd: rawnand: fsl_upm: Use platform_get_resource() + devm_ioremap_resource() Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:58   ` Miquel Raynal
2020-06-03 13:58     ` Miquel Raynal
2020-06-03 14:00     ` Boris Brezillon
2020-06-03 14:00       ` Boris Brezillon
2020-06-15  9:01   ` Miquel Raynal
2020-06-15  9:01     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 06/10] mtd: rawnand: fsl_upm: Use gpio descriptors Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:59   ` Miquel Raynal
2020-06-03 13:59     ` Miquel Raynal
2020-06-15  9:01   ` Miquel Raynal
2020-06-15  9:01     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 07/10] mtd: rawnand: fsl_upm: Inherit from nand_controller Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 14:01   ` Miquel Raynal
2020-06-03 14:01     ` Miquel Raynal
2020-06-15  9:01   ` Miquel Raynal
2020-06-15  9:01     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 08/10] mtd: rawnand: fsl_upm: Implement exec_op() Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 14:08   ` Miquel Raynal
2020-06-03 14:08     ` Miquel Raynal
2020-06-15  9:01   ` Miquel Raynal
2020-06-15  9:01     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 09/10] mtd: rawnand: fsl_upm: Get rid of the legacy interface implementation Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-15  9:01   ` Miquel Raynal
2020-06-15  9:01     ` Miquel Raynal
2020-06-03 13:49 ` [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags Boris Brezillon
2020-06-03 13:49   ` Boris Brezillon
2020-06-03 13:52   ` [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl,upm-wait-flags Boris Brezillon
2020-06-03 13:52     ` Boris Brezillon
2020-06-03 13:52     ` Boris Brezillon
2020-07-07 19:04   ` [PATCH 10/10] dt-bindings: mtd: fsl-upm-nand: Deprecate chip-delay and fsl, upm-wait-flags Miquel Raynal
2020-07-07 19:04     ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.