All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Misc Marvell NAND controller driver changes
@ 2020-04-24 16:44 Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code Miquel Raynal
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:44 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Here are a few cleanups/fixes for the Marvell NAND controller
driver. While working on another driver, I figured some
mistakes/unclear names that I wanted to change.

Cheers,
Miquèl

Changes in v2:
* Added Boris' Reviewed-by.
* Used a goto statement to handle the error path in "Fix probe error
  path".

Miquel Raynal (6):
  mtd: rawnand: marvell: Fix the condition on a return code
  mtd: rawnand: marvell: Use devm_platform_ioremap_res()
  mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet
    registered
  mtd: rawnand: marvell: Fix probe error path
  mtd: rawnand: marvell: Rename a function to clarify
  mtd: rawnand: marvell: Rename the ->correct() function

 drivers/mtd/nand/raw/marvell_nand.c | 56 +++++++++++++++--------------
 1 file changed, 29 insertions(+), 27 deletions(-)

-- 
2.20.1


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

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

* [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code
  2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
@ 2020-04-24 16:44 ` Miquel Raynal
  2020-05-10 20:06   ` Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res() Miquel Raynal
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:44 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

In a previous fix, I changed the condition on which the timeout of an
IRQ is reached from:

    if (!ret)

into:

    if (ret && !pending)

While having a non-zero return code is usual in the Linux kernel, here
ret comes from a wait_for_completion_timeout() which returns 0 when
the waiting period is too long.

Hence, the revised condition should be:

    if (!ret && !pending)

The faulty patch did not produce any error because of the !pending
condition so this change is finally purely cosmetic and does not
change the actual driver behavior.

Fixes: cafb56dd741e ("mtd: rawnand: marvell: prevent timeouts on a loaded machine")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 179f0ca585f8..f2bf88336326 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -707,7 +707,7 @@ static int marvell_nfc_wait_op(struct nand_chip *chip, unsigned int timeout_ms)
 	 * In case the interrupt was not served in the required time frame,
 	 * check if the ISR was not served or if something went actually wrong.
 	 */
-	if (ret && !pending) {
+	if (!ret && !pending) {
 		dev_err(nfc->dev, "Timeout waiting for RB signal\n");
 		return -ETIMEDOUT;
 	}
-- 
2.20.1


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

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

* [PATCH v2 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res()
  2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code Miquel Raynal
@ 2020-04-24 16:44 ` Miquel Raynal
  2020-05-10 20:06   ` Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered Miquel Raynal
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:44 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Switch from the old platform_get_resource()/devm_ioremap_resource()
couple to the newer devm_platform_ioremap_resource() helper.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index f2bf88336326..7906bd3fc8cb 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2854,7 +2854,6 @@ static int marvell_nfc_init(struct marvell_nfc *nfc)
 static int marvell_nfc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct resource *r;
 	struct marvell_nfc *nfc;
 	int ret;
 	int irq;
@@ -2869,8 +2868,7 @@ static int marvell_nfc_probe(struct platform_device *pdev)
 	nfc->controller.ops = &marvell_nand_controller_ops;
 	INIT_LIST_HEAD(&nfc->chips);
 
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	nfc->regs = devm_ioremap_resource(dev, r);
+	nfc->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(nfc->regs))
 		return PTR_ERR(nfc->regs);
 
-- 
2.20.1


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

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

* [PATCH v2 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered
  2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res() Miquel Raynal
@ 2020-04-24 16:44 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-24 16:44 ` [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path Miquel Raynal
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:44 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Do not call nand_release() while the MTD device has not been
registered, use nand_cleanup() instead.

Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 7906bd3fc8cb..350949b34eee 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2664,7 +2664,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 		ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
 		dev_err(dev, "failed to register mtd device: %d\n", ret);
-		nand_release(chip);
+		nand_cleanup(chip);
 		return ret;
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path
  2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
                   ` (2 preceding siblings ...)
  2020-04-24 16:44 ` [PATCH v2 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered Miquel Raynal
@ 2020-04-24 16:44 ` Miquel Raynal
  2020-04-25  8:29   ` Boris Brezillon
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-24 16:45 ` [PATCH v2 5/6] mtd: rawnand: marvell: Rename a function to clarify Miquel Raynal
  2020-04-24 16:45 ` [PATCH v2 6/6] mtd: rawnand: marvell: Rename the ->correct() function Miquel Raynal
  5 siblings, 2 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:44 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Ensure all chips are deregistered and cleaned in case of error during
the probe.

Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 350949b34eee..10b7f43d28e6 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2673,6 +2673,16 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 	return 0;
 }
 
+static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc)
+{
+	struct marvell_nand_chip *entry, *temp;
+
+	list_for_each_entry_safe(entry, temp, &nfc->chips, node) {
+		nand_release(&entry->chip);
+		list_del(&entry->node);
+	}
+}
+
 static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc *nfc)
 {
 	struct device_node *np = dev->of_node;
@@ -2707,21 +2717,16 @@ static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc *nfc)
 		ret = marvell_nand_chip_init(dev, nfc, nand_np);
 		if (ret) {
 			of_node_put(nand_np);
-			return ret;
+			goto cleanup_chips;
 		}
 	}
 
 	return 0;
-}
 
-static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc)
-{
-	struct marvell_nand_chip *entry, *temp;
+cleanup_chips:
+	marvell_nand_chips_cleanup(nfc);
 
-	list_for_each_entry_safe(entry, temp, &nfc->chips, node) {
-		nand_release(&entry->chip);
-		list_del(&entry->node);
-	}
+	return ret;
 }
 
 static int marvell_nfc_init_dma(struct marvell_nfc *nfc)
-- 
2.20.1


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

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

* [PATCH v2 5/6] mtd: rawnand: marvell: Rename a function to clarify
  2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
                   ` (3 preceding siblings ...)
  2020-04-24 16:44 ` [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path Miquel Raynal
@ 2020-04-24 16:45 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  2020-04-24 16:45 ` [PATCH v2 6/6] mtd: rawnand: marvell: Rename the ->correct() function Miquel Raynal
  5 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:45 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

Cosmetic change to clarify the purpose of the function.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 10b7f43d28e6..d6b978234933 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2166,8 +2166,8 @@ static const struct mtd_ooblayout_ops marvell_nand_ooblayout_ops = {
 	.free = marvell_nand_ooblayout_free,
 };
 
-static int marvell_nand_hw_ecc_ctrl_init(struct mtd_info *mtd,
-					 struct nand_ecc_ctrl *ecc)
+static int marvell_nand_hw_ecc_controller_init(struct mtd_info *mtd,
+					       struct nand_ecc_ctrl *ecc)
 {
 	struct nand_chip *chip = mtd_to_nand(mtd);
 	struct marvell_nfc *nfc = to_marvell_nfc(chip->controller);
@@ -2261,7 +2261,7 @@ static int marvell_nand_ecc_init(struct mtd_info *mtd,
 
 	switch (ecc->mode) {
 	case NAND_ECC_HW:
-		ret = marvell_nand_hw_ecc_ctrl_init(mtd, ecc);
+		ret = marvell_nand_hw_ecc_controller_init(mtd, ecc);
 		if (ret)
 			return ret;
 		break;
-- 
2.20.1


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

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

* [PATCH v2 6/6] mtd: rawnand: marvell: Rename the ->correct() function
  2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
                   ` (4 preceding siblings ...)
  2020-04-24 16:45 ` [PATCH v2 5/6] mtd: rawnand: marvell: Rename a function to clarify Miquel Raynal
@ 2020-04-24 16:45 ` Miquel Raynal
  2020-05-10 20:05   ` Miquel Raynal
  5 siblings, 1 reply; 14+ messages in thread
From: Miquel Raynal @ 2020-04-24 16:45 UTC (permalink / raw)
  To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni, Miquel Raynal

There is no correction involved at this point, it is just a matter of
reading registers and checking whether bitflips have occurred or
not. Rename the function to clarify it.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index d6b978234933..1781754523e4 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -932,14 +932,14 @@ static void marvell_nfc_check_empty_chunk(struct nand_chip *chip,
 }
 
 /*
- * Check a chunk is correct or not according to hardware ECC engine.
+ * Check if a chunk is correct or not according to the hardware ECC engine.
  * mtd->ecc_stats.corrected is updated, as well as max_bitflips, however
  * mtd->ecc_stats.failure is not, the function will instead return a non-zero
  * value indicating that a check on the emptyness of the subpage must be
- * performed before declaring the subpage corrupted.
+ * performed before actually declaring the subpage as "corrupted".
  */
-static int marvell_nfc_hw_ecc_correct(struct nand_chip *chip,
-				      unsigned int *max_bitflips)
+static int marvell_nfc_hw_ecc_check_bitflips(struct nand_chip *chip,
+					     unsigned int *max_bitflips)
 {
 	struct mtd_info *mtd = nand_to_mtd(chip);
 	struct marvell_nfc *nfc = to_marvell_nfc(chip->controller);
@@ -1053,7 +1053,7 @@ static int marvell_nfc_hw_ecc_hmg_read_page(struct nand_chip *chip, u8 *buf,
 	marvell_nfc_enable_hw_ecc(chip);
 	marvell_nfc_hw_ecc_hmg_do_read_page(chip, buf, chip->oob_poi, false,
 					    page);
-	ret = marvell_nfc_hw_ecc_correct(chip, &max_bitflips);
+	ret = marvell_nfc_hw_ecc_check_bitflips(chip, &max_bitflips);
 	marvell_nfc_disable_hw_ecc(chip);
 
 	if (!ret)
@@ -1336,7 +1336,7 @@ static int marvell_nfc_hw_ecc_bch_read_page(struct nand_chip *chip,
 		/* Read the chunk and detect number of bitflips */
 		marvell_nfc_hw_ecc_bch_read_chunk(chip, chunk, data, data_len,
 						  spare, spare_len, page);
-		ret = marvell_nfc_hw_ecc_correct(chip, &max_bitflips);
+		ret = marvell_nfc_hw_ecc_check_bitflips(chip, &max_bitflips);
 		if (ret)
 			failure_mask |= BIT(chunk);
 
@@ -1358,10 +1358,9 @@ static int marvell_nfc_hw_ecc_bch_read_page(struct nand_chip *chip,
 	 */
 
 	/*
-	 * In case there is any subpage read error reported by ->correct(), we
-	 * usually re-read only ECC bytes in raw mode and check if the whole
-	 * page is empty. In this case, it is normal that the ECC check failed
-	 * and we just ignore the error.
+	 * In case there is any subpage read error, we usually re-read only ECC
+	 * bytes in raw mode and check if the whole page is empty. In this case,
+	 * it is normal that the ECC check failed and we just ignore the error.
 	 *
 	 * However, it has been empirically observed that for some layouts (e.g
 	 * 2k page, 8b strength per 512B chunk), the controller tries to correct
-- 
2.20.1


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

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

* Re: [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path
  2020-04-24 16:44 ` [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path Miquel Raynal
@ 2020-04-25  8:29   ` Boris Brezillon
  2020-05-10 20:05   ` Miquel Raynal
  1 sibling, 0 replies; 14+ messages in thread
From: Boris Brezillon @ 2020-04-25  8:29 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, linux-mtd, Vignesh Raghavendra,
	Thomas Petazzoni, Tudor Ambarus

On Fri, 24 Apr 2020 18:44:59 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Ensure all chips are deregistered and cleaned in case of error during
> the probe.
> 
> Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> ---
>  drivers/mtd/nand/raw/marvell_nand.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 350949b34eee..10b7f43d28e6 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -2673,6 +2673,16 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
>  	return 0;
>  }
>  
> +static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc)
> +{
> +	struct marvell_nand_chip *entry, *temp;
> +
> +	list_for_each_entry_safe(entry, temp, &nfc->chips, node) {
> +		nand_release(&entry->chip);
> +		list_del(&entry->node);
> +	}
> +}
> +
>  static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc *nfc)
>  {
>  	struct device_node *np = dev->of_node;
> @@ -2707,21 +2717,16 @@ static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc *nfc)
>  		ret = marvell_nand_chip_init(dev, nfc, nand_np);
>  		if (ret) {
>  			of_node_put(nand_np);
> -			return ret;
> +			goto cleanup_chips;
>  		}
>  	}
>  
>  	return 0;
> -}
>  
> -static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc)
> -{
> -	struct marvell_nand_chip *entry, *temp;
> +cleanup_chips:
> +	marvell_nand_chips_cleanup(nfc);
>  
> -	list_for_each_entry_safe(entry, temp, &nfc->chips, node) {
> -		nand_release(&entry->chip);
> -		list_del(&entry->node);
> -	}
> +	return ret;
>  }
>  
>  static int marvell_nfc_init_dma(struct marvell_nfc *nfc)


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

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

* Re: [PATCH v2 6/6] mtd: rawnand: marvell: Rename the ->correct() function
  2020-04-24 16:45 ` [PATCH v2 6/6] mtd: rawnand: marvell: Rename the ->correct() function Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Fri, 2020-04-24 at 16:45:01 UTC, Miquel Raynal wrote:
> There is no correction involved at this point, it is just a matter of
> reading registers and checking whether bitflips have occurred or
> not. Rename the function to clarify it.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

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

Miquel

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

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

* Re: [PATCH v2 5/6] mtd: rawnand: marvell: Rename a function to clarify
  2020-04-24 16:45 ` [PATCH v2 5/6] mtd: rawnand: marvell: Rename a function to clarify Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Fri, 2020-04-24 at 16:45:00 UTC, Miquel Raynal wrote:
> Cosmetic change to clarify the purpose of the function.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

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

Miquel

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

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

* Re: [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path
  2020-04-24 16:44 ` [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path Miquel Raynal
  2020-04-25  8:29   ` Boris Brezillon
@ 2020-05-10 20:05   ` Miquel Raynal
  1 sibling, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Fri, 2020-04-24 at 16:44:59 UTC, Miquel Raynal wrote:
> Ensure all chips are deregistered and cleaned in case of error during
> the probe.
> 
> Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

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

Miquel

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

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

* Re: [PATCH v2 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered
  2020-04-24 16:44 ` [PATCH v2 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered Miquel Raynal
@ 2020-05-10 20:05   ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:05 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Fri, 2020-04-24 at 16:44:58 UTC, Miquel Raynal wrote:
> Do not call nand_release() while the MTD device has not been
> registered, use nand_cleanup() instead.
> 
> Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

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

Miquel

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

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

* Re: [PATCH v2 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res()
  2020-04-24 16:44 ` [PATCH v2 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res() Miquel Raynal
@ 2020-05-10 20:06   ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:06 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Fri, 2020-04-24 at 16:44:57 UTC, Miquel Raynal wrote:
> Switch from the old platform_get_resource()/devm_ioremap_resource()
> couple to the newer devm_platform_ioremap_resource() helper.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

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

Miquel

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

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

* Re: [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code
  2020-04-24 16:44 ` [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code Miquel Raynal
@ 2020-05-10 20:06   ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2020-05-10 20:06 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Tudor Ambarus, linux-mtd
  Cc: Boris Brezillon, Thomas Petazzoni

On Fri, 2020-04-24 at 16:44:56 UTC, Miquel Raynal wrote:
> In a previous fix, I changed the condition on which the timeout of an
> IRQ is reached from:
> 
>     if (!ret)
> 
> into:
> 
>     if (ret && !pending)
> 
> While having a non-zero return code is usual in the Linux kernel, here
> ret comes from a wait_for_completion_timeout() which returns 0 when
> the waiting period is too long.
> 
> Hence, the revised condition should be:
> 
>     if (!ret && !pending)
> 
> The faulty patch did not produce any error because of the !pending
> condition so this change is finally purely cosmetic and does not
> change the actual driver behavior.
> 
> Fixes: cafb56dd741e ("mtd: rawnand: marvell: prevent timeouts on a loaded machine")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

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

Miquel

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

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

end of thread, other threads:[~2020-05-10 20:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24 16:44 [PATCH v2 0/6] Misc Marvell NAND controller driver changes Miquel Raynal
2020-04-24 16:44 ` [PATCH v2 1/6] mtd: rawnand: marvell: Fix the condition on a return code Miquel Raynal
2020-05-10 20:06   ` Miquel Raynal
2020-04-24 16:44 ` [PATCH v2 2/6] mtd: rawnand: marvell: Use devm_platform_ioremap_res() Miquel Raynal
2020-05-10 20:06   ` Miquel Raynal
2020-04-24 16:44 ` [PATCH v2 3/6] mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-24 16:44 ` [PATCH v2 4/6] mtd: rawnand: marvell: Fix probe error path Miquel Raynal
2020-04-25  8:29   ` Boris Brezillon
2020-05-10 20:05   ` Miquel Raynal
2020-04-24 16:45 ` [PATCH v2 5/6] mtd: rawnand: marvell: Rename a function to clarify Miquel Raynal
2020-05-10 20:05   ` Miquel Raynal
2020-04-24 16:45 ` [PATCH v2 6/6] mtd: rawnand: marvell: Rename the ->correct() function Miquel Raynal
2020-05-10 20:05   ` 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.