Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release()
@ 2020-05-19 12:59 Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
                   ` (61 more replies)
  0 siblings, 62 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd
  Cc: Christophe Kerello, Maxim Levitsky, Jonathan Corbet, Kamal Dasu,
	Stefan Agner, Paul Cercueil, Masahiro Yamada, Harvey Hunt,
	Miquel Raynal, Han Xu, Brian Norris

Hello,

The main goal of this big cleanup series is to get rid of
nand_release(). I am always confused when it comes to use either
nand_cleanup() or nand_release() and I need to check the code in the
core, which is a sign of the API being badly designed.

Historically, there was a "nand_release()" helper only, doing the MTD
device unregistration and cleaning/freeing all objects belonging to
the NAND core. Later (v4.9), nand_cleanup() was been added to take
care of all the NAND cleanup, and was called directly by
nand_release(). This new helper was very useful to cleanup all the
NAND core objects in one go on _probe() error (after a successful
nand_scan()).

Unfortunately, because of the lack of symmetry in the API, a lot of
people also used nand_release wrongly in the _probe() error path.

So now, instead of:

        nand_release(chip);

I would like people to use:

        ret = mtd_device_unregister(mtd);
	WARN_ON(ret);
	nand_cleanup(chip);

Note: as it is currently not possible to handle properly an error on
mtd_device_unregister(), WARN_ON() will at least inform the user.

All of you receiving this cover letter will at least receive one patch
applying this change to the driver you are maintaining.

Thanks,
Miquèl

Note: as the modification are minor, I did not Cc: everybody in the
rest of the series due to the amount of patches.

Changes in v2:
* Removed Piotr and Xiaolei from the Cc: list (bouncing e-mails).
* Fixed a forgotten kfree() in the cs553x_nand.c driver remove path.
* Added Masahiro's Acked-by.
* Rebased on top of the latest nand/next.
* Added Christophe's Reviewed-by.
* Fixed a commit title with "ranwnand" in it.

Miquel Raynal (62):
  mtd: rawnand: ams-delta: Stop using nand_release()
  mtd: rawnand: au1550nd: Stop using nand_release()
  mtd: rawnand: bcm47xx: Stop using nand_release()
  mtd: rawnand: brcmnand: Stop using nand_release()
  mtd: rawnand: cadence: Stop using nand_release()
  mtd: rawnand: cafe: Stop using nand_release()
  mtd: rawnand: cmx270: Stop using nand_release()
  mtd: rawnand: cs553x: Stop using nand_release()
  mtd: rawnand: davinci: Stop using nand_release()
  mtd: rawnand: denali: Delete items from the list in the _remove() path
  mtd: rawnand: denali: Stop using nand_release()
  mtd: rawnand: diskonchip: Fix the probe error path
  mtd: rawnand: diskonchip: Stop using nand_release()
  mtd: rawnand: fsl_elbc: Stop using nand_release()
  mtd: rawnand: fsl_ifc: Stop using nand_release()
  mtd: rawnand: fsl_upm: Stop using nand_release()
  mtd: rawnand: fsmc: Stop using nand_release()
  mtd: rawnand: gpio: Stop using nand_release()
  mtd: rawnand: gpmi: Stop using nand_release()
  mtd: rawnand: hisi504: Stop using nand_release()
  mtd: rawnand: ingenic: Fix the probe error path
  mtd: rawnand: ingenic: Stop using nand_release()
  mtd: rawnand: lpc32xx_mlc: Stop using nand_release()
  mtd: rawnand: lpc32xx_slc: Stop using nand_release()
  mtd: rawnand: marvell: Stop using nand_release()
  mtd: rawnand: mpc5121: Stop using nand_release()
  mtd: rawnand: mtk: Fix the probe error path
  mtd: rawnand: mtk: Stop using nand_release()
  mtd: rawnand: mxc: Stop using nand_release()
  mtd: rawnand: mxic: Stop using nand_release()
  mtd: rawnand: ndfc: Stop using nand_release()
  mtd: rawnand: omap2: Stop using nand_release()
  mtd: rawnand: orion: Fix the probe error path
  mtd: rawnand: orion: Stop using nand_release()
  mtd: rawnand: oxnas: Keep track of registered devices
  mtd: rawnand: oxnas: Fix the probe error path
  mtd: rawnand: oxnas: Unregister all devices on error
  mtd: rawnand: oxnas: Release all devices in the _remove() path
  mtd: rawnand: oxnas: Stop using nand_release()
  mtd: rawnand: pasemi: Fix the probe error path
  mtd: rawnand: pasemi: Stop using nand_release()
  mtd: rawnand: plat_nand: Fix the probe error path
  mtd: rawnand: plat_nand: Stop using nand_release()
  mtd: rawnand: qcom: Stop using nand_release()
  mtd: rawnand: r852: Stop using nand_release()
  mtd: rawnand: s3c2410: Stop using nand_release()
  mtd: rawnand: sh_flctl: Stop using nand_release()
  mtd: rawnand: sharpsl: Fix the probe error path
  mtd: rawnand: sharpsl: Stop using nand_release()
  mtd: rawnand: socrates: Fix the probe error path
  mtd: rawnand: socrates: Stop using nand_release()
  mtd: rawnand: stm32_fmc2: Stop using nand_release()
  mtd: rawnand: sunxi: Fix the probe error path
  mtd: rawnand: sunxi: Stop using nand_release()
  mtd: rawnand: tango: Stop using nand_release()
  mtd: rawnand: tmio: Fix the probe error path
  mtd: rawnand: tmio: Stop using nand_release()
  mtd: rawnand: txx9ndfmc: Stop using nand_release()
  mtd: rawnand: vf610: Stop using nand_release()
  mtd: rawnand: xway: Fix the probe error path
  mtd: rawnand: xway: Stop using nand_release()
  mtd: rawnand: Stop using nand_release()

 Documentation/driver-api/mtdnand.rst          |  6 ++--
 drivers/mtd/nand/raw/ams-delta.c              |  5 ++-
 drivers/mtd/nand/raw/au1550nd.c               |  5 ++-
 drivers/mtd/nand/raw/bcm47xxnflash/main.c     |  6 +++-
 drivers/mtd/nand/raw/brcmnand/brcmnand.c      | 10 ++++--
 .../mtd/nand/raw/cadence-nand-controller.c    |  7 +++-
 drivers/mtd/nand/raw/cafe_nand.c              |  5 ++-
 drivers/mtd/nand/raw/cmx270_nand.c            |  6 +++-
 drivers/mtd/nand/raw/cs553x_nand.c            |  5 ++-
 drivers/mtd/nand/raw/davinci_nand.c           |  6 +++-
 drivers/mtd/nand/raw/denali.c                 | 13 ++++++--
 drivers/mtd/nand/raw/diskonchip.c             | 12 +++----
 drivers/mtd/nand/raw/fsl_elbc_nand.c          |  7 +++-
 drivers/mtd/nand/raw/fsl_ifc_nand.c           |  7 +++-
 drivers/mtd/nand/raw/fsl_upm.c                |  9 +++--
 drivers/mtd/nand/raw/fsmc_nand.c              |  7 +++-
 drivers/mtd/nand/raw/gpio.c                   |  6 +++-
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c    |  6 +++-
 drivers/mtd/nand/raw/hisi504_nand.c           |  6 +++-
 .../mtd/nand/raw/ingenic/ingenic_nand_drv.c   | 17 ++++++----
 drivers/mtd/nand/raw/lpc32xx_mlc.c            |  7 +++-
 drivers/mtd/nand/raw/lpc32xx_slc.c            |  6 +++-
 drivers/mtd/nand/raw/marvell_nand.c           |  7 +++-
 drivers/mtd/nand/raw/mpc5121_nfc.c            |  5 ++-
 drivers/mtd/nand/raw/mtk_nand.c               | 17 ++++++----
 drivers/mtd/nand/raw/mxc_nand.c               |  6 +++-
 drivers/mtd/nand/raw/mxic_nand.c              |  7 +++-
 drivers/mtd/nand/raw/nand_base.c              | 12 -------
 drivers/mtd/nand/raw/ndfc.c                   |  8 +++--
 drivers/mtd/nand/raw/omap2.c                  |  8 +++--
 drivers/mtd/nand/raw/orion_nand.c             |  8 +++--
 drivers/mtd/nand/raw/oxnas_nand.c             | 33 +++++++++++++------
 drivers/mtd/nand/raw/pasemi_nand.c            |  9 +++--
 drivers/mtd/nand/raw/plat_nand.c              |  8 +++--
 drivers/mtd/nand/raw/qcom_nandc.c             | 11 +++++--
 drivers/mtd/nand/raw/r852.c                   |  6 ++--
 drivers/mtd/nand/raw/s3c2410.c                |  3 +-
 drivers/mtd/nand/raw/sh_flctl.c               |  6 +++-
 drivers/mtd/nand/raw/sharpsl.c                | 14 +++++---
 drivers/mtd/nand/raw/socrates_nand.c          |  8 +++--
 drivers/mtd/nand/raw/stm32_fmc2_nand.c        |  6 +++-
 drivers/mtd/nand/raw/sunxi_nand.c             | 11 +++++--
 drivers/mtd/nand/raw/tango_nand.c             | 11 +++++--
 drivers/mtd/nand/raw/tmio_nand.c              |  8 +++--
 drivers/mtd/nand/raw/txx9ndfmc.c              |  6 ++--
 drivers/mtd/nand/raw/vf610_nfc.c              |  6 +++-
 drivers/mtd/nand/raw/xway_nand.c              |  8 +++--
 include/linux/mtd/bbm.h                       |  2 +-
 include/linux/mtd/rawnand.h                   |  2 --
 49 files changed, 290 insertions(+), 110 deletions(-)

-- 
2.20.1


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

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

* [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:09   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
                   ` (60 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/ams-delta.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/ams-delta.c b/drivers/mtd/nand/raw/ams-delta.c
index d66dab25df20..3711e7a0436c 100644
--- a/drivers/mtd/nand/raw/ams-delta.c
+++ b/drivers/mtd/nand/raw/ams-delta.c
@@ -387,12 +387,15 @@ static int gpio_nand_remove(struct platform_device *pdev)
 {
 	struct gpio_nand *priv = platform_get_drvdata(pdev);
 	struct mtd_info *mtd = nand_to_mtd(&priv->nand_chip);
+	int ret;
 
 	/* Apply write protection */
 	gpiod_set_value(priv->gpiod_nwp, 1);
 
 	/* Unregister device */
-	nand_release(mtd_to_nand(mtd));
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(mtd_to_nand(mtd));
 
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 02/62] mtd: rawnand: au1550nd: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:09   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
                   ` (59 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/au1550nd.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/au1550nd.c b/drivers/mtd/nand/raw/au1550nd.c
index 2ac84cb0501d..f7b4f421b2b0 100644
--- a/drivers/mtd/nand/raw/au1550nd.c
+++ b/drivers/mtd/nand/raw/au1550nd.c
@@ -325,8 +325,11 @@ static int au1550nd_remove(struct platform_device *pdev)
 {
 	struct au1550nd_ctx *ctx = platform_get_drvdata(pdev);
 	struct resource *r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	struct nand_chip *chip = &ctx->chip;
 
-	nand_release(&ctx->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	iounmap(ctx->base);
 	release_mem_region(r->start, 0x1000);
 	kfree(ctx);
-- 
2.20.1


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

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

* [PATCH v2 03/62] mtd: rawnand: bcm47xx: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
                   ` (58 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/bcm47xxnflash/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/bcm47xxnflash/main.c b/drivers/mtd/nand/raw/bcm47xxnflash/main.c
index 8dae97c1dbe7..dcc70d9dc6e5 100644
--- a/drivers/mtd/nand/raw/bcm47xxnflash/main.c
+++ b/drivers/mtd/nand/raw/bcm47xxnflash/main.c
@@ -60,8 +60,12 @@ static int bcm47xxnflash_probe(struct platform_device *pdev)
 static int bcm47xxnflash_remove(struct platform_device *pdev)
 {
 	struct bcm47xxnflash *nflash = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &nflash->nand_chip;
+	int ret;
 
-	nand_release(&nflash->nand_chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 04/62] mtd: rawnand: brcmnand: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (2 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 05/62] mtd: rawnand: cadence: " Miquel Raynal
                   ` (57 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Brian Norris, Kamal Dasu, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index fe7cd3aa0cd6..d20aaa036608 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -3045,9 +3045,15 @@ int brcmnand_remove(struct platform_device *pdev)
 {
 	struct brcmnand_controller *ctrl = dev_get_drvdata(&pdev->dev);
 	struct brcmnand_host *host;
+	struct nand_chip *chip;
+	int ret;
 
-	list_for_each_entry(host, &ctrl->host_list, node)
-		nand_release(&host->chip);
+	list_for_each_entry(host, &ctrl->host_list, node) {
+		chip = &host->chip;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
+	}
 
 	clk_disable_unprepare(ctrl->clk);
 
-- 
2.20.1


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

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

* [PATCH v2 05/62] mtd: rawnand: cadence: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (3 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 06/62] mtd: rawnand: cafe: " Miquel Raynal
                   ` (56 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/cadence-nand-controller.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/nand/raw/cadence-nand-controller.c
index e7abb15c7253..c405722adfe1 100644
--- a/drivers/mtd/nand/raw/cadence-nand-controller.c
+++ b/drivers/mtd/nand/raw/cadence-nand-controller.c
@@ -2780,9 +2780,14 @@ static int cadence_nand_chip_init(struct cdns_nand_ctrl *cdns_ctrl,
 static void cadence_nand_chips_cleanup(struct cdns_nand_ctrl *cdns_ctrl)
 {
 	struct cdns_nand_chip *entry, *temp;
+	struct nand_chip *chip;
+	int ret;
 
 	list_for_each_entry_safe(entry, temp, &cdns_ctrl->chips, node) {
-		nand_release(&entry->chip);
+		chip = &entry->chip;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
 		list_del(&entry->node);
 	}
 }
-- 
2.20.1


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

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

* [PATCH v2 06/62] mtd: rawnand: cafe: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (4 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 05/62] mtd: rawnand: cadence: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 07/62] mtd: rawnand: cmx270: " Miquel Raynal
                   ` (55 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/cafe_nand.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/cafe_nand.c b/drivers/mtd/nand/raw/cafe_nand.c
index 2a0df13df5f3..92173790f20b 100644
--- a/drivers/mtd/nand/raw/cafe_nand.c
+++ b/drivers/mtd/nand/raw/cafe_nand.c
@@ -807,11 +807,14 @@ static void cafe_nand_remove(struct pci_dev *pdev)
 	struct mtd_info *mtd = pci_get_drvdata(pdev);
 	struct nand_chip *chip = mtd_to_nand(mtd);
 	struct cafe_priv *cafe = nand_get_controller_data(chip);
+	int ret;
 
 	/* Disable NAND IRQ in global IRQ mask register */
 	cafe_writel(cafe, ~1 & cafe_readl(cafe, GLOBAL_IRQ_MASK), GLOBAL_IRQ_MASK);
 	free_irq(pdev->irq, mtd);
-	nand_release(chip);
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	free_rs(cafe->rs);
 	pci_iounmap(pdev, cafe->mmio);
 	dma_free_coherent(&cafe->pdev->dev, 2112, cafe->dmabuf, cafe->dmaaddr);
-- 
2.20.1


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

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

* [PATCH v2 07/62] mtd: rawnand: cmx270: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (5 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 06/62] mtd: rawnand: cafe: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 08/62] mtd: rawnand: cs553x: " Miquel Raynal
                   ` (54 subsequent siblings)
  61 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/cmx270_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/cmx270_nand.c b/drivers/mtd/nand/raw/cmx270_nand.c
index 045b6175ae79..42c4cc030be3 100644
--- a/drivers/mtd/nand/raw/cmx270_nand.c
+++ b/drivers/mtd/nand/raw/cmx270_nand.c
@@ -219,8 +219,12 @@ module_init(cmx270_init);
  */
 static void __exit cmx270_cleanup(void)
 {
+	int ret;
+
 	/* Release resources, unregister device */
-	nand_release(mtd_to_nand(cmx270_nand_mtd));
+	ret = mtd_device_unregister(cmx270_nand_mtd);
+	WARN_ON(ret);
+	nand_cleanup(mtd_to_nand(cmx270_nand_mtd));
 
 	gpio_free(GPIO_NAND_RB);
 	gpio_free(GPIO_NAND_CS);
-- 
2.20.1


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

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

* [PATCH v2 08/62] mtd: rawnand: cs553x: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (6 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 07/62] mtd: rawnand: cmx270: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 09/62] mtd: rawnand: davinci: " Miquel Raynal
                   ` (53 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/cs553x_nand.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/cs553x_nand.c b/drivers/mtd/nand/raw/cs553x_nand.c
index df5e24a2bbd7..9472bf798ed5 100644
--- a/drivers/mtd/nand/raw/cs553x_nand.c
+++ b/drivers/mtd/nand/raw/cs553x_nand.c
@@ -392,12 +392,15 @@ static void __exit cs553x_cleanup(void)
 		struct cs553x_nand_controller *controller = controllers[i];
 		struct nand_chip *this = &controller->chip;
 		struct mtd_info *mtd = nand_to_mtd(this);
+		int ret;
 
 		if (!mtd)
 			continue;
 
 		/* Release resources, unregister device */
-		nand_release(this);
+		ret = mtd_device_unregister(mtd);
+		WARN_ON(ret);
+		nand_cleanup(this);
 		kfree(mtd->name);
 		controllers[i] = NULL;
 
-- 
2.20.1


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

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

* [PATCH v2 09/62] mtd: rawnand: davinci: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (7 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 08/62] mtd: rawnand: cs553x: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
                   ` (52 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/davinci_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c
index 25c185bea50c..322f9009a01b 100644
--- a/drivers/mtd/nand/raw/davinci_nand.c
+++ b/drivers/mtd/nand/raw/davinci_nand.c
@@ -817,13 +817,17 @@ static int nand_davinci_probe(struct platform_device *pdev)
 static int nand_davinci_remove(struct platform_device *pdev)
 {
 	struct davinci_nand_info *info = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &info->chip;
+	int ret;
 
 	spin_lock_irq(&davinci_nand_lock);
 	if (info->chip.ecc.mode == NAND_ECC_HW_SYNDROME)
 		ecc4_busy = false;
 	spin_unlock_irq(&davinci_nand_lock);
 
-	nand_release(&info->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (8 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 09/62] mtd: rawnand: davinci: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
                   ` (51 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Masahiro Yamada, Miquel Raynal

Denali driver keeps track of devices with a list. Delete items of this
list as long as they are not in use anymore.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 drivers/mtd/nand/raw/denali.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index 7a76b761dd0b..6ac125b9e927 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -1359,10 +1359,12 @@ EXPORT_SYMBOL(denali_init);
 
 void denali_remove(struct denali_controller *denali)
 {
-	struct denali_chip *dchip;
+	struct denali_chip *dchip, *tmp;
 
-	list_for_each_entry(dchip, &denali->chips, node)
+	list_for_each_entry_safe(dchip, tmp, &denali->chips, node) {
 		nand_release(&dchip->chip);
+		list_del(&dchip->node);
+	}
 
 	denali_disable_irq(denali);
 }
-- 
2.20.1


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

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

* [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (9 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
                   ` (50 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Masahiro Yamada, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 drivers/mtd/nand/raw/denali.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index 6ac125b9e927..4e6e1578aa2d 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -1360,9 +1360,14 @@ EXPORT_SYMBOL(denali_init);
 void denali_remove(struct denali_controller *denali)
 {
 	struct denali_chip *dchip, *tmp;
+	struct nand_chip *chip;
+	int ret;
 
 	list_for_each_entry_safe(dchip, tmp, &denali->chips, node) {
-		nand_release(&dchip->chip);
+		chip = &dchip->chip;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
 		list_del(&dchip->node);
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (10 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
                   ` (49 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

Not sure nand_cleanup() is the right function to call here but in any
case it is not nand_release(). Indeed, even a comment says that
calling nand_release() is a bit of a hack as there is no MTD device to
unregister. So switch to nand_cleanup() for now and drop this
comment.

There is no Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense even if it did not intruce
any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/diskonchip.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c
index 97f0b05b47c1..f8ccee797645 100644
--- a/drivers/mtd/nand/raw/diskonchip.c
+++ b/drivers/mtd/nand/raw/diskonchip.c
@@ -1482,13 +1482,10 @@ static int __init doc_probe(unsigned long physadr)
 		numchips = doc2001_init(mtd);
 
 	if ((ret = nand_scan(nand, numchips)) || (ret = doc->late_init(mtd))) {
-		/* DBB note: i believe nand_release is necessary here, as
+		/* DBB note: i believe nand_cleanup is necessary here, as
 		   buffers may have been allocated in nand_base.  Check with
 		   Thomas. FIX ME! */
-		/* nand_release will call mtd_device_unregister, but we
-		   haven't yet added it.  This is handled without incident by
-		   mtd_device_unregister, as far as I can tell. */
-		nand_release(nand);
+		nand_cleanup(nand);
 		goto fail;
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (11 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:08   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
                   ` (48 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/diskonchip.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/diskonchip.c b/drivers/mtd/nand/raw/diskonchip.c
index f8ccee797645..43721863a0d8 100644
--- a/drivers/mtd/nand/raw/diskonchip.c
+++ b/drivers/mtd/nand/raw/diskonchip.c
@@ -1514,13 +1514,16 @@ static void release_nanddoc(void)
 	struct mtd_info *mtd, *nextmtd;
 	struct nand_chip *nand;
 	struct doc_priv *doc;
+	int ret;
 
 	for (mtd = doclist; mtd; mtd = nextmtd) {
 		nand = mtd_to_nand(mtd);
 		doc = nand_get_controller_data(nand);
 
 		nextmtd = doc->nextdoc;
-		nand_release(nand);
+		ret = mtd_device_unregister(mtd);
+		WARN_ON(ret);
+		nand_cleanup(nand);
 		iounmap(doc->virtadr);
 		release_mem_region(doc->physadr, DOC_IOREMAP_LEN);
 		free_rs(doc->rs_decoder);
-- 
2.20.1


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

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

* [PATCH v2 14/62] mtd: rawnand: fsl_elbc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (12 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
                   ` (47 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/fsl_elbc_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsl_elbc_nand.c b/drivers/mtd/nand/raw/fsl_elbc_nand.c
index e1dc675b12bb..088692b2e27a 100644
--- a/drivers/mtd/nand/raw/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_elbc_nand.c
@@ -956,8 +956,13 @@ static int fsl_elbc_nand_remove(struct platform_device *pdev)
 {
 	struct fsl_elbc_fcm_ctrl *elbc_fcm_ctrl = fsl_lbc_ctrl_dev->nand;
 	struct fsl_elbc_mtd *priv = dev_get_drvdata(&pdev->dev);
+	struct nand_chip *chip = &priv->chip;
+	int ret;
+
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
-	nand_release(&priv->chip);
 	fsl_elbc_chip_remove(priv);
 
 	mutex_lock(&fsl_elbc_nand_mutex);
-- 
2.20.1


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

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

* [PATCH v2 15/62] mtd: rawnand: fsl_ifc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (13 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
                   ` (46 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/fsl_ifc_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsl_ifc_nand.c b/drivers/mtd/nand/raw/fsl_ifc_nand.c
index 2af09edf405b..00ae7a910b03 100644
--- a/drivers/mtd/nand/raw/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/raw/fsl_ifc_nand.c
@@ -1093,8 +1093,13 @@ static int fsl_ifc_nand_probe(struct platform_device *dev)
 static int fsl_ifc_nand_remove(struct platform_device *dev)
 {
 	struct fsl_ifc_mtd *priv = dev_get_drvdata(&dev->dev);
+	struct nand_chip *chip = &priv->chip;
+	int ret;
+
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
-	nand_release(&priv->chip);
 	fsl_ifc_chip_remove(priv);
 
 	mutex_lock(&fsl_ifc_nand_mutex);
-- 
2.20.1


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

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

* [PATCH v2 16/62] mtd: rawnand: fsl_upm: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (14 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 17/62] mtd: rawnand: fsmc: " Miquel Raynal
                   ` (45 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/fsl_upm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/fsl_upm.c b/drivers/mtd/nand/raw/fsl_upm.c
index f31fae3a4c68..627deb26db51 100644
--- a/drivers/mtd/nand/raw/fsl_upm.c
+++ b/drivers/mtd/nand/raw/fsl_upm.c
@@ -317,10 +317,13 @@ static int fun_probe(struct platform_device *ofdev)
 static int fun_remove(struct platform_device *ofdev)
 {
 	struct fsl_upm_nand *fun = dev_get_drvdata(&ofdev->dev);
-	struct mtd_info *mtd = nand_to_mtd(&fun->chip);
-	int i;
+	struct nand_chip *chip = &fun->chip;
+	struct mtd_info *mtd = nand_to_mtd(chip);
+	int ret, i;
 
-	nand_release(&fun->chip);
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	kfree(mtd->name);
 
 	for (i = 0; i < fun->mchip_count; i++) {
-- 
2.20.1


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

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

* [PATCH v2 17/62] mtd: rawnand: fsmc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (15 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 18/62] mtd: rawnand: gpio: " Miquel Raynal
                   ` (44 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/fsmc_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/fsmc_nand.c b/drivers/mtd/nand/raw/fsmc_nand.c
index 2a9222e99bcc..3909752b14c5 100644
--- a/drivers/mtd/nand/raw/fsmc_nand.c
+++ b/drivers/mtd/nand/raw/fsmc_nand.c
@@ -1136,7 +1136,12 @@ static int fsmc_nand_remove(struct platform_device *pdev)
 	struct fsmc_nand_data *host = platform_get_drvdata(pdev);
 
 	if (host) {
-		nand_release(&host->nand);
+		struct nand_chip *chip = &host->nand;
+		int ret;
+
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
 		fsmc_nand_disable(host);
 
 		if (host->mode == USE_DMA_ACCESS) {
-- 
2.20.1


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

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

* [PATCH v2 18/62] mtd: rawnand: gpio: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (16 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 17/62] mtd: rawnand: fsmc: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 19/62] mtd: rawnand: gpmi: " Miquel Raynal
                   ` (43 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/gpio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/gpio.c b/drivers/mtd/nand/raw/gpio.c
index f6b12354024f..938077e5c6a9 100644
--- a/drivers/mtd/nand/raw/gpio.c
+++ b/drivers/mtd/nand/raw/gpio.c
@@ -190,8 +190,12 @@ gpio_nand_get_io_sync(struct platform_device *pdev)
 static int gpio_nand_remove(struct platform_device *pdev)
 {
 	struct gpiomtd *gpiomtd = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &gpiomtd->nand_chip;
+	int ret;
 
-	nand_release(&gpiomtd->nand_chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	/* Enable write protection and disable the chip */
 	if (gpiomtd->nwp && !IS_ERR(gpiomtd->nwp))
-- 
2.20.1


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

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

* [PATCH v2 19/62] mtd: rawnand: gpmi: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (17 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 18/62] mtd: rawnand: gpio: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 20/62] mtd: rawnand: hisi504: " Miquel Raynal
                   ` (42 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Han Xu, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Han Xu <han.xu@nxp.com>
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 97b460d8d0c1..0c2763523caf 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -2542,11 +2542,15 @@ static int gpmi_nand_probe(struct platform_device *pdev)
 static int gpmi_nand_remove(struct platform_device *pdev)
 {
 	struct gpmi_nand_data *this = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &this->nand;
+	int ret;
 
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
-	nand_release(&this->nand);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	gpmi_free_dma_buffer(this);
 	release_resources(this);
 	return 0;
-- 
2.20.1


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

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

* [PATCH v2 20/62] mtd: rawnand: hisi504: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (18 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 19/62] mtd: rawnand: gpmi: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
                   ` (41 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/hisi504_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/hisi504_nand.c b/drivers/mtd/nand/raw/hisi504_nand.c
index 0b48be54ba6f..b84238e2268a 100644
--- a/drivers/mtd/nand/raw/hisi504_nand.c
+++ b/drivers/mtd/nand/raw/hisi504_nand.c
@@ -806,8 +806,12 @@ static int hisi_nfc_probe(struct platform_device *pdev)
 static int hisi_nfc_remove(struct platform_device *pdev)
 {
 	struct hinfc_host *host = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &host->chip;
+	int ret;
 
-	nand_release(&host->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (19 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 20/62] mtd: rawnand: hisi504: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
                   ` (40 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Paul Cercueil, Harvey Hunt, stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. Hence, pointing it as the commit to
fix for backporting purposes, even if this commit is not introducing
any bug makes sense.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Harvey Hunt <harveyhuntnexus@gmail.com>
---
 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
index e7bd845fdbf5..3bfb6fa8bad9 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
@@ -376,7 +376,7 @@ static int ingenic_nand_init_chip(struct platform_device *pdev,
 
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (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	[flat|nested] 136+ messages in thread

* [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (20 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
                   ` (39 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Paul Cercueil, Harvey Hunt, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: Harvey Hunt <harveyhuntnexus@gmail.com>
---
 drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
index 3bfb6fa8bad9..2af1b54d5d9d 100644
--- a/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
+++ b/drivers/mtd/nand/raw/ingenic/ingenic_nand_drv.c
@@ -387,13 +387,18 @@ static int ingenic_nand_init_chip(struct platform_device *pdev,
 
 static void ingenic_nand_cleanup_chips(struct ingenic_nfc *nfc)
 {
-	struct ingenic_nand *chip;
+	struct ingenic_nand *ingenic_chip;
+	struct nand_chip *chip;
+	int ret;
 
 	while (!list_empty(&nfc->chips)) {
-		chip = list_first_entry(&nfc->chips,
-					struct ingenic_nand, chip_list);
-		nand_release(&chip->chip);
-		list_del(&chip->chip_list);
+		ingenic_chip = list_first_entry(&nfc->chips,
+						struct ingenic_nand, chip_list);
+		chip = &ingenic_chip->chip;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
+		list_del(&ingenic_chip->chip_list);
 	}
 }
 
-- 
2.20.1


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

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

* [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (21 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
                   ` (38 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/lpc32xx_mlc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c
index 241b58b83240..7521038af2ef 100644
--- a/drivers/mtd/nand/raw/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c
@@ -826,8 +826,13 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 static int lpc32xx_nand_remove(struct platform_device *pdev)
 {
 	struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &host->nand_chip;
+	int ret;
+
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
-	nand_release(&host->nand_chip);
 	free_irq(host->irq, host);
 	if (use_dma)
 		dma_release_channel(host->dma_chan);
-- 
2.20.1


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

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

* [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (22 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:07   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 25/62] mtd: rawnand: marvell: " Miquel Raynal
                   ` (37 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/lpc32xx_slc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/lpc32xx_slc.c b/drivers/mtd/nand/raw/lpc32xx_slc.c
index 163f976353f8..b151fd000815 100644
--- a/drivers/mtd/nand/raw/lpc32xx_slc.c
+++ b/drivers/mtd/nand/raw/lpc32xx_slc.c
@@ -947,8 +947,12 @@ static int lpc32xx_nand_remove(struct platform_device *pdev)
 {
 	uint32_t tmp;
 	struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &host->nand_chip;
+	int ret;
 
-	nand_release(&host->nand_chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	dma_release_channel(host->dma_chan);
 
 	/* Force CE high */
-- 
2.20.1


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

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

* [PATCH v2 25/62] mtd: rawnand: marvell: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (23 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 12:59 ` [PATCH v2 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
                   ` (36 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/marvell_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index a79ce4bdd31c..260a0430313e 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2676,9 +2676,14 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc)
 {
 	struct marvell_nand_chip *entry, *temp;
+	struct nand_chip *chip;
+	int ret;
 
 	list_for_each_entry_safe(entry, temp, &nfc->chips, node) {
-		nand_release(&entry->chip);
+		chip = &entry->chip;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
 		list_del(&entry->node);
 	}
 }
-- 
2.20.1


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

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

* [PATCH v2 26/62] mtd: rawnand: mpc5121: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (24 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 25/62] mtd: rawnand: marvell: " Miquel Raynal
@ 2020-05-19 12:59 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
                   ` (35 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 12:59 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/mpc5121_nfc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/mpc5121_nfc.c b/drivers/mtd/nand/raw/mpc5121_nfc.c
index a2fcb739e5f8..18ecb096a32d 100644
--- a/drivers/mtd/nand/raw/mpc5121_nfc.c
+++ b/drivers/mtd/nand/raw/mpc5121_nfc.c
@@ -805,8 +805,11 @@ static int mpc5121_nfc_remove(struct platform_device *op)
 {
 	struct device *dev = &op->dev;
 	struct mtd_info *mtd = dev_get_drvdata(dev);
+	int ret;
 
-	nand_release(mtd_to_nand(mtd));
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(mtd_to_nand(mtd));
 	mpc5121_nfc_free(dev, mtd);
 
 	return 0;
-- 
2.20.1


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

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

* [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (25 preceding siblings ...)
  2020-05-19 12:59 ` [PATCH v2 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
                   ` (34 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense even if this commit is not
introducing any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/mtk_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c
index e7ec30e784fd..9dad08bed2bb 100644
--- a/drivers/mtd/nand/raw/mtk_nand.c
+++ b/drivers/mtd/nand/raw/mtk_nand.c
@@ -1419,7 +1419,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
 		dev_err(dev, "mtd parse partition error\n");
-		nand_release(nand);
+		nand_cleanup(nand);
 		return ret;
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (26 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 29/62] mtd: rawnand: mxc: " Miquel Raynal
                   ` (33 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/mtk_nand.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c
index 9dad08bed2bb..c1a6e31aabb8 100644
--- a/drivers/mtd/nand/raw/mtk_nand.c
+++ b/drivers/mtd/nand/raw/mtk_nand.c
@@ -1578,13 +1578,18 @@ static int mtk_nfc_probe(struct platform_device *pdev)
 static int mtk_nfc_remove(struct platform_device *pdev)
 {
 	struct mtk_nfc *nfc = platform_get_drvdata(pdev);
-	struct mtk_nfc_nand_chip *chip;
+	struct mtk_nfc_nand_chip *mtk_chip;
+	struct nand_chip *chip;
+	int ret;
 
 	while (!list_empty(&nfc->chips)) {
-		chip = list_first_entry(&nfc->chips, struct mtk_nfc_nand_chip,
-					node);
-		nand_release(&chip->nand);
-		list_del(&chip->node);
+		mtk_chip = list_first_entry(&nfc->chips,
+					    struct mtk_nfc_nand_chip, node);
+		chip = &mtk_chip->nand;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
+		list_del(&mtk_chip->node);
 	}
 
 	mtk_ecc_release(nfc->ecc);
-- 
2.20.1


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

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

* [PATCH v2 29/62] mtd: rawnand: mxc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (27 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 30/62] mtd: rawnand: mxic: " Miquel Raynal
                   ` (32 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/mxc_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index 59554c187e01..09dacb83cb5a 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -1919,8 +1919,12 @@ static int mxcnd_probe(struct platform_device *pdev)
 static int mxcnd_remove(struct platform_device *pdev)
 {
 	struct mxc_nand_host *host = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &host->nand;
+	int ret;
 
-	nand_release(&host->nand);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	if (host->clk_act)
 		clk_disable_unprepare(host->clk);
 
-- 
2.20.1


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

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

* [PATCH v2 30/62] mtd: rawnand: mxic: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (28 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 29/62] mtd: rawnand: mxc: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 31/62] mtd: rawnand: ndfc: " Miquel Raynal
                   ` (31 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/mxic_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/mxic_nand.c b/drivers/mtd/nand/raw/mxic_nand.c
index 5a5a5b3b546d..57f36721f4c6 100644
--- a/drivers/mtd/nand/raw/mxic_nand.c
+++ b/drivers/mtd/nand/raw/mxic_nand.c
@@ -556,8 +556,13 @@ static int mxic_nfc_probe(struct platform_device *pdev)
 static int mxic_nfc_remove(struct platform_device *pdev)
 {
 	struct mxic_nand_ctlr *nfc = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &nfc->chip;
+	int ret;
+
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
-	nand_release(&nfc->chip);
 	mxic_nfc_clk_disable(nfc);
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 31/62] mtd: rawnand: ndfc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (29 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 30/62] mtd: rawnand: mxic: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 32/62] mtd: rawnand: omap2: " Miquel Raynal
                   ` (30 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/ndfc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/ndfc.c b/drivers/mtd/nand/raw/ndfc.c
index d324396ab7ff..ed38338c1383 100644
--- a/drivers/mtd/nand/raw/ndfc.c
+++ b/drivers/mtd/nand/raw/ndfc.c
@@ -244,9 +244,13 @@ static int ndfc_probe(struct platform_device *ofdev)
 static int ndfc_remove(struct platform_device *ofdev)
 {
 	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);
-	struct mtd_info *mtd = nand_to_mtd(&ndfc->chip);
+	struct nand_chip *chip = &ndfc->chip;
+	struct mtd_info *mtd = nand_to_mtd(chip);
+	int ret;
 
-	nand_release(&ndfc->chip);
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	kfree(mtd->name);
 
 	return 0;
-- 
2.20.1


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

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

* [PATCH v2 32/62] mtd: rawnand: omap2: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (30 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 31/62] mtd: rawnand: ndfc: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
                   ` (29 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/omap2.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
index ad77c112a78a..eb7fcfd9276b 100644
--- a/drivers/mtd/nand/raw/omap2.c
+++ b/drivers/mtd/nand/raw/omap2.c
@@ -2283,14 +2283,18 @@ static int omap_nand_remove(struct platform_device *pdev)
 	struct mtd_info *mtd = platform_get_drvdata(pdev);
 	struct nand_chip *nand_chip = mtd_to_nand(mtd);
 	struct omap_nand_info *info = mtd_to_omap(mtd);
+	int ret;
+
 	if (nand_chip->ecc.priv) {
 		nand_bch_free(nand_chip->ecc.priv);
 		nand_chip->ecc.priv = NULL;
 	}
 	if (info->dma)
 		dma_release_channel(info->dma);
-	nand_release(nand_chip);
-	return 0;
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(nand_chip);
+	return ret;
 }
 
 static const struct of_device_id omap_nand_ids[] = {
-- 
2.20.1


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

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

* [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (31 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 32/62] mtd: rawnand: omap2: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
                   ` (28 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense even if this commit is not
introducing any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/orion_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/orion_nand.c b/drivers/mtd/nand/raw/orion_nand.c
index d27b39a7223c..a3dcdf25f5f2 100644
--- a/drivers/mtd/nand/raw/orion_nand.c
+++ b/drivers/mtd/nand/raw/orion_nand.c
@@ -180,7 +180,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
 	mtd->name = "orion_nand";
 	ret = mtd_device_register(mtd, board->parts, board->nr_parts);
 	if (ret) {
-		nand_release(nc);
+		nand_cleanup(nc);
 		goto no_dev;
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (32 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:06   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
                   ` (27 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/orion_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/orion_nand.c b/drivers/mtd/nand/raw/orion_nand.c
index a3dcdf25f5f2..880b54ca1b41 100644
--- a/drivers/mtd/nand/raw/orion_nand.c
+++ b/drivers/mtd/nand/raw/orion_nand.c
@@ -195,8 +195,12 @@ static int orion_nand_remove(struct platform_device *pdev)
 {
 	struct orion_nand_info *info = platform_get_drvdata(pdev);
 	struct nand_chip *chip = &info->chip;
+	int ret;
 
-	nand_release(chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+
+	nand_cleanup(chip);
 
 	clk_disable_unprepare(info->clk);
 
-- 
2.20.1


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

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

* [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (33 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
                   ` (26 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

All initialized and registered devices should be listed somewhere so
that we can unregister/free them in the _remove() path.

This patch is not a fix per-se but is needed to apply three other
fixes coming right after, explaining the Fixes/Cc: stable tags.

Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/oxnas_nand.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
index c43cb4d92d3d..bead5ac70160 100644
--- a/drivers/mtd/nand/raw/oxnas_nand.c
+++ b/drivers/mtd/nand/raw/oxnas_nand.c
@@ -32,6 +32,7 @@ struct oxnas_nand_ctrl {
 	void __iomem *io_base;
 	struct clk *clk;
 	struct nand_chip *chips[OXNAS_NAND_MAX_CHIPS];
+	unsigned int nchips;
 };
 
 static uint8_t oxnas_nand_read_byte(struct nand_chip *chip)
@@ -79,7 +80,6 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 	struct nand_chip *chip;
 	struct mtd_info *mtd;
 	struct resource *res;
-	int nchips = 0;
 	int count = 0;
 	int err = 0;
 
@@ -145,12 +145,12 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 			goto err_release_child;
 		}
 
-		oxnas->chips[nchips] = chip;
-		++nchips;
+		oxnas->chips[oxnas->nchips] = chip;
+		++oxnas->nchips;
 	}
 
 	/* Exit if no chips found */
-	if (!nchips) {
+	if (!oxnas->nchips) {
 		err = -ENODEV;
 		goto err_clk_unprepare;
 	}
-- 
2.20.1


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

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

* [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (34 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
                   ` (25 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

While at it, be consistent and move the function call in the error
path thanks to a goto statement.

Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/oxnas_nand.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
index bead5ac70160..4fadfa118582 100644
--- a/drivers/mtd/nand/raw/oxnas_nand.c
+++ b/drivers/mtd/nand/raw/oxnas_nand.c
@@ -140,10 +140,8 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 			goto err_release_child;
 
 		err = mtd_device_register(mtd, NULL, 0);
-		if (err) {
-			nand_release(chip);
-			goto err_release_child;
-		}
+		if (err)
+			goto err_cleanup_nand;
 
 		oxnas->chips[oxnas->nchips] = chip;
 		++oxnas->nchips;
@@ -159,6 +157,8 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 
 	return 0;
 
+err_cleanup_nand:
+	nand_cleanup(chip);
 err_release_child:
 	of_node_put(nand_np);
 err_clk_unprepare:
-- 
2.20.1


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

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

* [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (35 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
                   ` (24 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

On error, the oxnas probe path just frees the device which failed and
aborts the probe, leaving unreleased resources.

Fix this situation by calling mtd_device_unregister()/nand_cleanup()
on these.

Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/oxnas_nand.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
index 4fadfa118582..25862d62f994 100644
--- a/drivers/mtd/nand/raw/oxnas_nand.c
+++ b/drivers/mtd/nand/raw/oxnas_nand.c
@@ -82,6 +82,7 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 	struct resource *res;
 	int count = 0;
 	int err = 0;
+	int i;
 
 	/* Allocate memory for the device structure (and zero it) */
 	oxnas = devm_kzalloc(&pdev->dev, sizeof(*oxnas),
@@ -161,6 +162,13 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 	nand_cleanup(chip);
 err_release_child:
 	of_node_put(nand_np);
+
+	for (i = 0; i < oxnas->nchips; i++) {
+		chip = oxnas->chips[i];
+		WARN_ON(mtd_device_unregister(nand_to_mtd(chip)));
+		nand_cleanup(chip);
+	}
+
 err_clk_unprepare:
 	clk_disable_unprepare(oxnas->clk);
 	return err;
-- 
2.20.1


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

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

* [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (36 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
                   ` (23 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

oxnans_nand_remove() should release all MTD devices and clean all NAND
devices, not only the first one registered.

Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/oxnas_nand.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
index 25862d62f994..23c222b6c40e 100644
--- a/drivers/mtd/nand/raw/oxnas_nand.c
+++ b/drivers/mtd/nand/raw/oxnas_nand.c
@@ -177,9 +177,13 @@ static int oxnas_nand_probe(struct platform_device *pdev)
 static int oxnas_nand_remove(struct platform_device *pdev)
 {
 	struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev);
+	struct nand_chip *chip;
+	int i;
 
-	if (oxnas->chips[0])
-		nand_release(oxnas->chips[0]);
+	for (i = 0; i < oxnas->nchips; i++) {
+		chip = oxnas->chips[i];
+		nand_release(chip);
+	}
 
 	clk_disable_unprepare(oxnas->clk);
 
-- 
2.20.1


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

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

* [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (37 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
                   ` (22 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/oxnas_nand.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c
index 23c222b6c40e..8d0d76ad319d 100644
--- a/drivers/mtd/nand/raw/oxnas_nand.c
+++ b/drivers/mtd/nand/raw/oxnas_nand.c
@@ -182,7 +182,8 @@ static int oxnas_nand_remove(struct platform_device *pdev)
 
 	for (i = 0; i < oxnas->nchips; i++) {
 		chip = oxnas->chips[i];
-		nand_release(chip);
+		WARN_ON(mtd_device_unregister(nand_to_mtd(chip)));
+		nand_cleanup(chip);
 	}
 
 	clk_disable_unprepare(oxnas->clk);
-- 
2.20.1


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

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

* [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (38 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
                   ` (21 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_cleanup() is supposed to be called on error after a successful
call to nand_scan() to free all NAND resources.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible, hence pointing it as the commit to
fix for backporting purposes, even if this commit is not introducing
any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/pasemi_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c
index 9cfe7395172a..be40b2f32237 100644
--- a/drivers/mtd/nand/raw/pasemi_nand.c
+++ b/drivers/mtd/nand/raw/pasemi_nand.c
@@ -146,7 +146,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
 	if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
 		dev_err(dev, "Unable to register MTD device\n");
 		err = -ENODEV;
-		goto out_lpc;
+		goto out_cleanup_nand;
 	}
 
 	dev_info(dev, "PA Semi NAND flash at %pR, control at I/O %x\n", &res,
@@ -154,6 +154,8 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
 
 	return 0;
 
+out_cleanup:
+	nand_cleanup(chip);
  out_lpc:
 	release_region(lpcctl, 4);
  out_ior:
-- 
2.20.1


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

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

* [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (39 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
                   ` (20 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/pasemi_nand.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/pasemi_nand.c b/drivers/mtd/nand/raw/pasemi_nand.c
index be40b2f32237..37570f0c3a36 100644
--- a/drivers/mtd/nand/raw/pasemi_nand.c
+++ b/drivers/mtd/nand/raw/pasemi_nand.c
@@ -169,6 +169,7 @@ static int pasemi_nand_probe(struct platform_device *ofdev)
 static int pasemi_nand_remove(struct platform_device *ofdev)
 {
 	struct nand_chip *chip;
+	int ret;
 
 	if (!pasemi_nand_mtd)
 		return 0;
@@ -176,7 +177,9 @@ static int pasemi_nand_remove(struct platform_device *ofdev)
 	chip = mtd_to_nand(pasemi_nand_mtd);
 
 	/* Release resources, unregister device */
-	nand_release(chip);
+	ret = mtd_device_unregister(pasemi_nand_mtd);
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	release_region(lpcctl, 4);
 
-- 
2.20.1


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

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

* [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (40 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
                   ` (19 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible, hence pointing it as the commit to
fix for backporting purposes, even if this commit is not introducing
any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/plat_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/plat_nand.c b/drivers/mtd/nand/raw/plat_nand.c
index dc0f3074ddbf..3a495b233443 100644
--- a/drivers/mtd/nand/raw/plat_nand.c
+++ b/drivers/mtd/nand/raw/plat_nand.c
@@ -92,7 +92,7 @@ static int plat_nand_probe(struct platform_device *pdev)
 	if (!err)
 		return err;
 
-	nand_release(&data->chip);
+	nand_cleanup(&data->chip);
 out:
 	if (pdata->ctrl.remove)
 		pdata->ctrl.remove(pdev);
-- 
2.20.1


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

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

* [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (41 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 44/62] mtd: rawnand: qcom: " Miquel Raynal
                   ` (18 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/plat_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/plat_nand.c b/drivers/mtd/nand/raw/plat_nand.c
index 3a495b233443..556182f26057 100644
--- a/drivers/mtd/nand/raw/plat_nand.c
+++ b/drivers/mtd/nand/raw/plat_nand.c
@@ -106,8 +106,12 @@ static int plat_nand_remove(struct platform_device *pdev)
 {
 	struct plat_nand_data *data = platform_get_drvdata(pdev);
 	struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev);
+	struct nand_chip *chip = &data->chip;
+	int ret;
 
-	nand_release(&data->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	if (pdata->ctrl.remove)
 		pdata->ctrl.remove(pdev);
 
-- 
2.20.1


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

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

* [PATCH v2 44/62] mtd: rawnand: qcom: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (42 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:05   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 45/62] mtd: rawnand: r852: " Miquel Raynal
                   ` (17 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/qcom_nandc.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 9ab22c5d4166..f1daf330951b 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -3005,10 +3005,15 @@ static int qcom_nandc_remove(struct platform_device *pdev)
 	struct qcom_nand_controller *nandc = platform_get_drvdata(pdev);
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct qcom_nand_host *host;
+	struct nand_chip *chip;
+	int ret;
 
-	list_for_each_entry(host, &nandc->host_list, node)
-		nand_release(&host->chip);
-
+	list_for_each_entry(host, &nandc->host_list, node) {
+		chip = &host->chip;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
+	}
 
 	qcom_nandc_unalloc(nandc);
 
-- 
2.20.1


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

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

* [PATCH v2 45/62] mtd: rawnand: r852: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (43 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 44/62] mtd: rawnand: qcom: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
                   ` (16 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Maxim Levitsky, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
---
 drivers/mtd/nand/raw/r852.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c
index 77774250fb11..f865e3a47b01 100644
--- a/drivers/mtd/nand/raw/r852.c
+++ b/drivers/mtd/nand/raw/r852.c
@@ -651,7 +651,8 @@ static int r852_register_nand_device(struct r852_device *dev)
 	dev->card_registered = 1;
 	return 0;
 error3:
-	nand_release(dev->chip);
+	WARN_ON(mtd_device_unregister(nand_to_mtd(dev->chip)));
+	nand_cleanup(dev->chip);
 error1:
 	/* Force card redetect */
 	dev->card_detected = 0;
@@ -670,7 +671,8 @@ static void r852_unregister_nand_device(struct r852_device *dev)
 		return;
 
 	device_remove_file(&mtd->dev, &dev_attr_media_type);
-	nand_release(dev->chip);
+	WARN_ON(mtd_device_unregister(mtd));
+	nand_cleanup(dev->chip);
 	r852_engine_disable(dev);
 	dev->card_registered = 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 46/62] mtd: rawnand: s3c2410: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (44 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 45/62] mtd: rawnand: r852: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
                   ` (15 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/s3c2410.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/s3c2410.c b/drivers/mtd/nand/raw/s3c2410.c
index 0009c1820e21..f86dff311464 100644
--- a/drivers/mtd/nand/raw/s3c2410.c
+++ b/drivers/mtd/nand/raw/s3c2410.c
@@ -779,7 +779,8 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
 
 		for (mtdno = 0; mtdno < info->mtd_count; mtdno++, ptr++) {
 			pr_debug("releasing mtd %d (%p)\n", mtdno, ptr);
-			nand_release(&ptr->chip);
+			WARN_ON(mtd_device_unregister(nand_to_mtd(&ptr->chip)));
+			nand_cleanup(&ptr->chip);
 		}
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 47/62] mtd: rawnand: sh_flctl: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (45 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
                   ` (14 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/sh_flctl.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c
index 058e99d0cbcf..a661b8bb2dd5 100644
--- a/drivers/mtd/nand/raw/sh_flctl.c
+++ b/drivers/mtd/nand/raw/sh_flctl.c
@@ -1204,9 +1204,13 @@ static int flctl_probe(struct platform_device *pdev)
 static int flctl_remove(struct platform_device *pdev)
 {
 	struct sh_flctl *flctl = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &flctl->chip;
+	int ret;
 
 	flctl_release_dma(flctl);
-	nand_release(&flctl->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	pm_runtime_disable(&pdev->dev);
 
 	return 0;
-- 
2.20.1


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

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

* [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (46 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
                   ` (13 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/sharpsl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/sharpsl.c b/drivers/mtd/nand/raw/sharpsl.c
index b47a9eaff89b..d8c52a016080 100644
--- a/drivers/mtd/nand/raw/sharpsl.c
+++ b/drivers/mtd/nand/raw/sharpsl.c
@@ -183,7 +183,7 @@ static int sharpsl_nand_probe(struct platform_device *pdev)
 	return 0;
 
 err_add:
-	nand_release(this);
+	nand_cleanup(this);
 
 err_scan:
 	iounmap(sharpsl->io);
-- 
2.20.1


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

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

* [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (47 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path Miquel Raynal
                   ` (12 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/sharpsl.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/sharpsl.c b/drivers/mtd/nand/raw/sharpsl.c
index d8c52a016080..51286f7acf54 100644
--- a/drivers/mtd/nand/raw/sharpsl.c
+++ b/drivers/mtd/nand/raw/sharpsl.c
@@ -199,13 +199,19 @@ static int sharpsl_nand_probe(struct platform_device *pdev)
 static int sharpsl_nand_remove(struct platform_device *pdev)
 {
 	struct sharpsl_nand *sharpsl = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &sharpsl->chip;
+	int ret;
 
-	/* Release resources, unregister device */
-	nand_release(&sharpsl->chip);
+	/* Unregister device */
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+
+	/* Release resources */
+	nand_cleanup(chip);
 
 	iounmap(sharpsl->io);
 
-	/* Free the MTD device structure */
+	/* Free the driver's structure */
 	kfree(sharpsl);
 
 	return 0;
-- 
2.20.1


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

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

* [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (48 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
                   ` (11 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense even if this commit is not
introducing any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/socrates_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/socrates_nand.c b/drivers/mtd/nand/raw/socrates_nand.c
index 20f40c0e812c..7c94fc51a611 100644
--- a/drivers/mtd/nand/raw/socrates_nand.c
+++ b/drivers/mtd/nand/raw/socrates_nand.c
@@ -169,7 +169,7 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 	if (!res)
 		return res;
 
-	nand_release(nand_chip);
+	nand_cleanup(nand_chip);
 
 out:
 	iounmap(host->io_base);
-- 
2.20.1


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

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

* [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (49 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
                   ` (10 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/socrates_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/socrates_nand.c b/drivers/mtd/nand/raw/socrates_nand.c
index 7c94fc51a611..243b34cfbc1b 100644
--- a/drivers/mtd/nand/raw/socrates_nand.c
+++ b/drivers/mtd/nand/raw/socrates_nand.c
@@ -182,8 +182,12 @@ static int socrates_nand_probe(struct platform_device *ofdev)
 static int socrates_nand_remove(struct platform_device *ofdev)
 {
 	struct socrates_nand_host *host = dev_get_drvdata(&ofdev->dev);
+	struct nand_chip *chip = &host->nand_chip;
+	int ret;
 
-	nand_release(&host->nand_chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	iounmap(host->io_base);
 
-- 
2.20.1


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

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

* [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (50 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
                   ` (9 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Christophe Kerello, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Christophe Kerello <christophe.kerello@st.com>
---
 drivers/mtd/nand/raw/stm32_fmc2_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
index e12c58613960..2a474faf854e 100644
--- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c
+++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c
@@ -1983,8 +1983,12 @@ static int stm32_fmc2_nfc_remove(struct platform_device *pdev)
 {
 	struct stm32_fmc2_nfc *nfc = platform_get_drvdata(pdev);
 	struct stm32_fmc2_nand *nand = &nfc->nand;
+	struct nand_chip *chip = &nand->chip;
+	int ret;
 
-	nand_release(&nand->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	if (nfc->dma_ecc_ch)
 		dma_release_channel(nfc->dma_ecc_ch);
-- 
2.20.1


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

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

* [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (51 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
                   ` (8 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/sunxi_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 26d862213cac..9f51fd20a52e 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -2004,7 +2004,7 @@ static int sunxi_nand_chip_init(struct device *dev, struct sunxi_nfc *nfc,
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {
 		dev_err(dev, "failed to register mtd device: %d\n", ret);
-		nand_release(nand);
+		nand_cleanup(nand);
 		return ret;
 	}
 
-- 
2.20.1


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

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

* [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (52 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 55/62] mtd: rawnand: tango: " Miquel Raynal
                   ` (7 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/sunxi_nand.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 9f51fd20a52e..ffbc1651fadc 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -2039,13 +2039,18 @@ static int sunxi_nand_chips_init(struct device *dev, struct sunxi_nfc *nfc)
 static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
 {
 	struct sunxi_nand_chip *sunxi_nand;
+	struct nand_chip *chip;
+	int ret;
 
 	while (!list_empty(&nfc->chips)) {
 		sunxi_nand = list_first_entry(&nfc->chips,
 					      struct sunxi_nand_chip,
 					      node);
-		nand_release(&sunxi_nand->nand);
-		sunxi_nand_ecc_cleanup(&sunxi_nand->nand.ecc);
+		chip = &sunxi_nand->nand;
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
+		sunxi_nand_ecc_cleanup(&chip->ecc);
 		list_del(&sunxi_nand->node);
 	}
 }
-- 
2.20.1


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

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

* [PATCH v2 55/62] mtd: rawnand: tango: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (53 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
                   ` (6 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/tango_nand.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/raw/tango_nand.c b/drivers/mtd/nand/raw/tango_nand.c
index b92de603e6db..246871e01027 100644
--- a/drivers/mtd/nand/raw/tango_nand.c
+++ b/drivers/mtd/nand/raw/tango_nand.c
@@ -600,14 +600,19 @@ static int chip_init(struct device *dev, struct device_node *np)
 
 static int tango_nand_remove(struct platform_device *pdev)
 {
-	int cs;
 	struct tango_nfc *nfc = platform_get_drvdata(pdev);
+	struct nand_chip *chip;
+	int cs, ret;
 
 	dma_release_channel(nfc->chan);
 
 	for (cs = 0; cs < MAX_CS; ++cs) {
-		if (nfc->chips[cs])
-			nand_release(&nfc->chips[cs]->nand_chip);
+		if (nfc->chips[cs]) {
+			chip = &nfc->chips[cs]->nand_chip;
+			ret = mtd_device_unregister(nand_to_mtd(chip));
+			WARN_ON(ret);
+			nand_cleanup(chip);
+		}
 	}
 
 	return 0;
-- 
2.20.1


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

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

* [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (54 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 55/62] mtd: rawnand: tango: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
                   ` (5 subsequent siblings)
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates by far the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense even if this commit is not
introducing any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/tmio_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/tmio_nand.c b/drivers/mtd/nand/raw/tmio_nand.c
index db030f1701ee..4e9a6d94f6e8 100644
--- a/drivers/mtd/nand/raw/tmio_nand.c
+++ b/drivers/mtd/nand/raw/tmio_nand.c
@@ -448,7 +448,7 @@ static int tmio_probe(struct platform_device *dev)
 	if (!retval)
 		return retval;
 
-	nand_release(nand_chip);
+	nand_cleanup(nand_chip);
 
 err_irq:
 	tmio_hw_stop(dev, tmio);
-- 
2.20.1


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

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

* [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (55 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:03   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
                   ` (4 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/tmio_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/tmio_nand.c b/drivers/mtd/nand/raw/tmio_nand.c
index 4e9a6d94f6e8..843a8683b737 100644
--- a/drivers/mtd/nand/raw/tmio_nand.c
+++ b/drivers/mtd/nand/raw/tmio_nand.c
@@ -458,8 +458,12 @@ static int tmio_probe(struct platform_device *dev)
 static int tmio_remove(struct platform_device *dev)
 {
 	struct tmio_nand *tmio = platform_get_drvdata(dev);
+	struct nand_chip *chip = &tmio->chip;
+	int ret;
 
-	nand_release(&tmio->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	tmio_hw_stop(dev, tmio);
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (56 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:03   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 59/62] mtd: rawnand: vf610: " Miquel Raynal
                   ` (3 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/txx9ndfmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c
index 2642d5bb3241..47d966871445 100644
--- a/drivers/mtd/nand/raw/txx9ndfmc.c
+++ b/drivers/mtd/nand/raw/txx9ndfmc.c
@@ -371,7 +371,7 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)
 static int __exit txx9ndfmc_remove(struct platform_device *dev)
 {
 	struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev);
-	int i;
+	int ret, i;
 
 	if (!drvdata)
 		return 0;
@@ -385,7 +385,9 @@ static int __exit txx9ndfmc_remove(struct platform_device *dev)
 		chip = mtd_to_nand(mtd);
 		txx9_priv = nand_get_controller_data(chip);
 
-		nand_release(chip);
+		ret = mtd_device_unregister(nand_to_mtd(chip));
+		WARN_ON(ret);
+		nand_cleanup(chip);
 		kfree(txx9_priv->mtdname);
 		kfree(txx9_priv);
 	}
-- 
2.20.1


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

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

* [PATCH v2 59/62] mtd: rawnand: vf610: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (57 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:03   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
                   ` (2 subsequent siblings)
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Stefan Agner, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Stefan Agner <stefan@agner.ch>
---
 drivers/mtd/nand/raw/vf610_nfc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
index bd9e16de78a2..7248c5901183 100644
--- a/drivers/mtd/nand/raw/vf610_nfc.c
+++ b/drivers/mtd/nand/raw/vf610_nfc.c
@@ -917,8 +917,12 @@ static int vf610_nfc_probe(struct platform_device *pdev)
 static int vf610_nfc_remove(struct platform_device *pdev)
 {
 	struct vf610_nfc *nfc = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &nfc->chip;
+	int ret;
 
-	nand_release(&nfc->chip);
+	ret = mtd_device_unregister(nand_to_mtd(chip));
+	WARN_ON(ret);
+	nand_cleanup(chip);
 	clk_disable_unprepare(nfc->clk);
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (58 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 59/62] mtd: rawnand: vf610: " Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:03   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 62/62] mtd: rawnand: " Miquel Raynal
  61 siblings, 2 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: stable, Miquel Raynal

nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

There is no real Fixes tag applying here as the use of nand_release()
in this driver predates the introduction of nand_cleanup() in
commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
which makes this change possible. However, pointing this commit as the
culprit for backporting purposes makes sense even if this commit is not
introducing any bug.

Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
---
 drivers/mtd/nand/raw/xway_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/xway_nand.c b/drivers/mtd/nand/raw/xway_nand.c
index 834f794816a9..018311dc8fe1 100644
--- a/drivers/mtd/nand/raw/xway_nand.c
+++ b/drivers/mtd/nand/raw/xway_nand.c
@@ -210,7 +210,7 @@ static int xway_nand_probe(struct platform_device *pdev)
 
 	err = mtd_device_register(mtd, NULL, 0);
 	if (err)
-		nand_release(&data->chip);
+		nand_cleanup(&data->chip);
 
 	return err;
 }
-- 
2.20.1


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

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

* [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (59 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-24 19:03   ` Miquel Raynal
  2020-05-19 13:00 ` [PATCH v2 62/62] mtd: rawnand: " Miquel Raynal
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Let's stop using nand_release() by calling mtd_device_unregister() and
nand_cleanup() directly.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/nand/raw/xway_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/xway_nand.c b/drivers/mtd/nand/raw/xway_nand.c
index 018311dc8fe1..94bfba994326 100644
--- a/drivers/mtd/nand/raw/xway_nand.c
+++ b/drivers/mtd/nand/raw/xway_nand.c
@@ -221,8 +221,12 @@ static int xway_nand_probe(struct platform_device *pdev)
 static int xway_nand_remove(struct platform_device *pdev)
 {
 	struct xway_nand_data *data = platform_get_drvdata(pdev);
+	struct nand_chip *chip = &data->chip;
+	int ret;
 
-	nand_release(&data->chip);
+	ret = mtd_device_unregister(mtd);
+	WARN_ON(ret);
+	nand_cleanup(chip);
 
 	return 0;
 }
-- 
2.20.1


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

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

* [PATCH v2 62/62] mtd: rawnand: Stop using nand_release()
  2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
                   ` (60 preceding siblings ...)
  2020-05-19 13:00 ` [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
@ 2020-05-19 13:00 ` Miquel Raynal
  2020-05-27 14:11   ` Miquel Raynal
  61 siblings, 1 reply; 136+ messages in thread
From: Miquel Raynal @ 2020-05-19 13:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: Jonathan Corbet, Miquel Raynal

This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Now that all drivers have been converted to do not use nand_release()
anymore, let's remove this helper.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jonathan Corbet <corbet@lwn.net>
---
 Documentation/driver-api/mtdnand.rst |  6 ++++--
 drivers/mtd/nand/raw/nand_base.c     | 12 ------------
 include/linux/mtd/bbm.h              |  2 +-
 include/linux/mtd/rawnand.h          |  2 --
 4 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/Documentation/driver-api/mtdnand.rst b/Documentation/driver-api/mtdnand.rst
index 55447659b81f..0bf8d6ec3f54 100644
--- a/Documentation/driver-api/mtdnand.rst
+++ b/Documentation/driver-api/mtdnand.rst
@@ -276,8 +276,10 @@ unregisters the partitions in the MTD layer.
     #ifdef MODULE
     static void __exit board_cleanup (void)
     {
-        /* Release resources, unregister device */
-        nand_release (mtd_to_nand(board_mtd));
+        /* Unregister device */
+        WARN_ON(mtd_device_unregister(board_mtd));
+        /* Release resources */
+        nand_cleanup(mtd_to_nand(board_mtd));
 
         /* unmap physical address */
         iounmap(baseaddr);
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index 14387b967e8b..5d8d7c145774 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -6169,18 +6169,6 @@ void nand_cleanup(struct nand_chip *chip)
 
 EXPORT_SYMBOL_GPL(nand_cleanup);
 
-/**
- * nand_release - [NAND Interface] Unregister the MTD device and free resources
- *		  held by the NAND device
- * @chip: NAND chip object
- */
-void nand_release(struct nand_chip *chip)
-{
-	mtd_device_unregister(nand_to_mtd(chip));
-	nand_cleanup(chip);
-}
-EXPORT_SYMBOL_GPL(nand_release);
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Steven J. Hill <sjhill@realitydiluted.com>");
 MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 886e30441c90..d890805f5494 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -98,7 +98,7 @@ struct nand_bbt_descr {
 
 /*
  * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr
- * was allocated dynamicaly and must be freed in nand_release(). Has no meaning
+ * was allocated dynamicaly and must be freed in nand_cleanup(). Has no meaning
  * in nand_chip.bbt_options.
  */
 #define NAND_BBT_DYNAMICSTRUCT	0x80000000
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 45dd57e2a223..12b1c8d0eea1 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -1396,8 +1396,6 @@ void nand_wait_ready(struct nand_chip *chip);
  * sucessful nand_scan().
  */
 void nand_cleanup(struct nand_chip *chip);
-/* Unregister the MTD device and calls nand_cleanup() */
-void nand_release(struct nand_chip *chip);
 
 /*
  * External helper for controller drivers that have to implement the WAITRDY
-- 
2.20.1


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

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

* Re: [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:06   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path
  2020-05-19 12:59 ` [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:08   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    00ad378f304a ("mtd: rawnand: Pass a nand_chip object to nand_scan()")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    00ad378f304a ("mtd: rawnand: Pass a nand_chip object to nand_scan()")
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    1c782b9a8517 ("mtd: nand: mtk: change the compile sequence of mtk_nand.o and mtk_ecc.o")
    263c68afb521 ("mtd: nand: pxa3xx_nand: Update Kconfig information")
    34832dc44d44 ("mtd: nand: gpmi-nand: Remove wrong Kconfig help text")
    577e010c24bc ("mtd: rawnand: atmel: convert driver to nand_scan()")
    7928225ffcb3 ("mtd: rawnand: atmel: clarify NAND addition/removal paths")
    7cce5d835467 ("MAINTAINERS: mtd/nand: update Microchip nand entry")
    7da45139d264 ("mtd: rawnand: better name for the controller structure")
    93db446a424c ("mtd: nand: move raw NAND related code to the raw/ subdir")
    b4525db6f0c6 ("MAINTAINERS: Add entry for Marvell NAND controller driver")
    d7d9f8ec77fe ("mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver")

v4.9.223: Failed to apply! Possible dependencies:
    00ad378f304a ("mtd: rawnand: Pass a nand_chip object to nand_scan()")
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:03   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:05   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    00ad378f304a ("mtd: rawnand: Pass a nand_chip object to nand_scan()")
    107d985a1a94 ("mtd: rawnand: diskonchip: Fix the probe error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    00ad378f304a ("mtd: rawnand: Pass a nand_chip object to nand_scan()")
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    107d985a1a94 ("mtd: rawnand: diskonchip: Fix the probe error path")
    1c782b9a8517 ("mtd: nand: mtk: change the compile sequence of mtk_nand.o and mtk_ecc.o")
    263c68afb521 ("mtd: nand: pxa3xx_nand: Update Kconfig information")
    34832dc44d44 ("mtd: nand: gpmi-nand: Remove wrong Kconfig help text")
    577e010c24bc ("mtd: rawnand: atmel: convert driver to nand_scan()")
    7928225ffcb3 ("mtd: rawnand: atmel: clarify NAND addition/removal paths")
    7cce5d835467 ("MAINTAINERS: mtd/nand: update Microchip nand entry")
    7da45139d264 ("mtd: rawnand: better name for the controller structure")
    93db446a424c ("mtd: nand: move raw NAND related code to the raw/ subdir")
    b4525db6f0c6 ("MAINTAINERS: Add entry for Marvell NAND controller driver")
    d7d9f8ec77fe ("mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver")

v4.9.223: Failed to apply! Possible dependencies:
    00ad378f304a ("mtd: rawnand: Pass a nand_chip object to nand_scan()")
    107d985a1a94 ("mtd: rawnand: diskonchip: Fix the probe error path")
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:05   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path
  2020-05-19 12:59 ` [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:07   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd
  Cc: Paul Cercueil, Harvey Hunt, stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223, v4.4.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")

v4.4.223: Failed to apply! Possible dependencies:
    2cca45574007 ("Merge tag 'topic/drm-misc-2016-06-07' of git://anongit.freedesktop.org/drm-intel into drm-next")
    47cb398dd75a ("Docs: sphinxify device-drivers.tmpl")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    5b996e93aac3 ("Documentation: include sync_file into DocBook")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    eae1760fc838 ("doc: update/fixup dma-buf related DocBook")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:05   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Build OK!
v4.14.180: Failed to apply! Possible dependencies:
    Unable to calculate

v4.9.223: Failed to apply! Possible dependencies:
    Unable to calculate


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:06   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
@ 2020-05-22  0:12   ` Sasha Levin
  2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Sasha Levin @ 2020-05-22  0:12 UTC (permalink / raw)
  To: Sasha Levin, Miquel Raynal, linux-mtd; +Cc: stable, Miquel Raynal

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources").

The bot has tested the following trees: v5.6.13, v5.4.41, v4.19.123, v4.14.180, v4.9.223.

v5.6.13: Build OK!
v5.4.41: Build OK!
v4.19.123: Failed to apply! Possible dependencies:
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")

v4.14.180: Failed to apply! Possible dependencies:
    02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver")
    256c4fc76a80 ("mtd: rawnand: add a way to pass an ID table with nand_scan()")
    39b77c586e17 ("mtd: rawnand: fsl_elbc: fix probe function error path")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    63fa37f0c512 ("mtd: rawnand: Replace printk() with appropriate pr_*() macro")
    97d90da8a886 ("mtd: nand: provide several helpers to do common NAND operations")
    98732da1a08e ("mtd: rawnand: do not export nand_scan_[ident|tail]() anymore")
    acfc33091f7a ("mtd: rawnand: fsl_ifc: fix probe function error path")

v4.9.223: Failed to apply! Possible dependencies:
    24755a55b01f ("Documentation/00-index: update for new core-api folder")
    4ad4b21b1b81 ("docs-rst: convert usb docbooks to ReST")
    59ac276f2227 ("mtd: rawnand: Pass a nand_chip object to nand_release()")
    609f212f6a12 ("docs-rst: convert mtdnand book to ReST")
    66115335fbb4 ("docs: Fix build failure")
    7ddedebb03b7 ("ALSA: doc: ReSTize writing-an-alsa-driver document")
    8551914a5e19 ("ALSA: doc: ReSTize alsa-driver-api document")
    90f9f118b75c ("docs-rst: convert filesystems book to ReST")
    93dc3a112bf8 ("doc: Convert the debugobjects DocBook template to sphinx")
    c441a4781ff1 ("crypto: doc - remove crypto API DocBook")
    d6ba7a9c8b5a ("doc: Sphinxify the tracepoint docbook")
    e7f08ffb1855 ("Documentation/workqueue.txt: convert to ReST markup")
    f3fc83e55533 ("docs: Fix htmldocs build failure")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

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

* Re: [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:03   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:03 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:34 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:03   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:03 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:33 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense even if this commit is not
> introducing any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 59/62] mtd: rawnand: vf610: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 59/62] mtd: rawnand: vf610: " Miquel Raynal
@ 2020-05-24 19:03   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:03 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Stefan Agner

On Tue, 2020-05-19 at 13:00:32 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Stefan Agner <stefan@agner.ch>

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] 136+ messages in thread

* Re: [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
@ 2020-05-24 19:03   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:03 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:31 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:03   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:03 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:30 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:29 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense even if this commit is not
> introducing any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 55/62] mtd: rawnand: tango: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 55/62] mtd: rawnand: tango: " Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:28 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:27 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:26 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Christophe Kerello

On Tue, 2020-05-19 at 13:00:25 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Christophe Kerello <christophe.kerello@st.com>
> Reviewed-by: Christophe Kerello <christophe.kerello@st.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] 136+ messages in thread

* Re: [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:24 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:23 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense even if this commit is not
> introducing any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:22 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:04   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:21 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 47/62] mtd: rawnand: sh_flctl: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:20 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 46/62] mtd: rawnand: s3c2410: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:19 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 45/62] mtd: rawnand: r852: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 45/62] mtd: rawnand: r852: " Miquel Raynal
@ 2020-05-24 19:04   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:04 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Maxim Levitsky

On Tue, 2020-05-19 at 13:00:18 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Maxim Levitsky <maximlevitsky@gmail.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] 136+ messages in thread

* Re: [PATCH v2 44/62] mtd: rawnand: qcom: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 44/62] mtd: rawnand: qcom: " Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:17 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:16 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:05   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:15 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible, hence pointing it as the commit to
> fix for backporting purposes, even if this commit is not introducing
> any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:14 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:05   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:13 UTC, Miquel Raynal wrote:
> nand_cleanup() is supposed to be called on error after a successful
> call to nand_scan() to free all NAND resources.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible, hence pointing it as the commit to
> fix for backporting purposes, even if this commit is not introducing
> any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:12 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path
  2020-05-19 13:00 ` [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:11 UTC, Miquel Raynal wrote:
> oxnans_nand_remove() should release all MTD devices and clean all NAND
> devices, not only the first one registered.
> 
> Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error
  2020-05-19 13:00 ` [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:10 UTC, Miquel Raynal wrote:
> On error, the oxnas probe path just frees the device which failed and
> aborts the probe, leaving unreleased resources.
> 
> Fix this situation by calling mtd_device_unregister()/nand_cleanup()
> on these.
> 
> Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:05   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:09 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> While at it, be consistent and move the function call in the error
> path thanks to a goto statement.
> 
> Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices
  2020-05-19 13:00 ` [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
@ 2020-05-24 19:05   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:05 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:08 UTC, Miquel Raynal wrote:
> All initialized and registered devices should be listed somewhere so
> that we can unregister/free them in the _remove() path.
> 
> This patch is not a fix per-se but is needed to apply three other
> fixes coming right after, explaining the Fixes/Cc: stable tags.
> 
> Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:07 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:06   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:06 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense even if this commit is not
> introducing any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 32/62] mtd: rawnand: omap2: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 32/62] mtd: rawnand: omap2: " Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:05 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 31/62] mtd: rawnand: ndfc: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 31/62] mtd: rawnand: ndfc: " Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:04 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 30/62] mtd: rawnand: mxic: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 30/62] mtd: rawnand: mxic: " Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:03 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 29/62] mtd: rawnand: mxc: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 29/62] mtd: rawnand: mxc: " Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:02 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 13:00:01 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path
  2020-05-19 13:00 ` [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:06   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 13:00:00 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense even if this commit is not
> introducing any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 26/62] mtd: rawnand: mpc5121: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:59 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 25/62] mtd: rawnand: marvell: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 25/62] mtd: rawnand: marvell: " Miquel Raynal
@ 2020-05-24 19:06   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:06 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:58 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:57 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:56 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Paul Cercueil, Harvey Hunt

On Tue, 2020-05-19 at 12:59:55 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Paul Cercueil <paul@crapouillou.net>
> Cc: Harvey Hunt <harveyhuntnexus@gmail.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] 136+ messages in thread

* Re: [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path
  2020-05-19 12:59 ` [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:07   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Paul Cercueil, Harvey Hunt, stable

On Tue, 2020-05-19 at 12:59:54 UTC, Miquel Raynal wrote:
> nand_release() is supposed be called after MTD device registration.
> Here, only nand_scan() happened, so use nand_cleanup() instead.
> 
> There is no real Fixes tag applying here as the use of nand_release()
> in this driver predates the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. Hence, pointing it as the commit to
> fix for backporting purposes, even if this commit is not introducing
> any bug makes sense.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org
> Cc: Paul Cercueil <paul@crapouillou.net>
> Cc: Harvey Hunt <harveyhuntnexus@gmail.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] 136+ messages in thread

* Re: [PATCH v2 20/62] mtd: rawnand: hisi504: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 20/62] mtd: rawnand: hisi504: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:53 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 19/62] mtd: rawnand: gpmi: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 19/62] mtd: rawnand: gpmi: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Han Xu

On Tue, 2020-05-19 at 12:59:52 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Han Xu <han.xu@nxp.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] 136+ messages in thread

* Re: [PATCH v2 18/62] mtd: rawnand: gpio: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 18/62] mtd: rawnand: gpio: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:51 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 17/62] mtd: rawnand: fsmc: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 17/62] mtd: rawnand: fsmc: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:50 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 16/62] mtd: rawnand: fsl_upm: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:49 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 15/62] mtd: rawnand: fsl_ifc: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:48 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 14/62] mtd: rawnand: fsl_elbc: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
@ 2020-05-24 19:07   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:07 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:47 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:46 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path
  2020-05-19 12:59 ` [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
  2020-05-22  0:12   ` Sasha Levin
@ 2020-05-24 19:08   ` Miquel Raynal
  1 sibling, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: stable

On Tue, 2020-05-19 at 12:59:45 UTC, Miquel Raynal wrote:
> Not sure nand_cleanup() is the right function to call here but in any
> case it is not nand_release(). Indeed, even a comment says that
> calling nand_release() is a bit of a hack as there is no MTD device to
> unregister. So switch to nand_cleanup() for now and drop this
> comment.
> 
> There is no Fixes tag applying here as the use of nand_release()
> in this driver predates by far the introduction of nand_cleanup() in
> commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> which makes this change possible. However, pointing this commit as the
> culprit for backporting purposes makes sense even if it did not intruce
> any bug.
> 
> Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: stable@vger.kernel.org

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] 136+ messages in thread

* Re: [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Masahiro Yamada

On Tue, 2020-05-19 at 12:59:44 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.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] 136+ messages in thread

* Re: [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path
  2020-05-19 12:59 ` [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Masahiro Yamada

On Tue, 2020-05-19 at 12:59:43 UTC, Miquel Raynal wrote:
> Denali driver keeps track of devices with a list. Delete items of this
> list as long as they are not in use anymore.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Masahiro Yamada <yamada.masahiro@socionext.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] 136+ messages in thread

* Re: [PATCH v2 09/62] mtd: rawnand: davinci: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 09/62] mtd: rawnand: davinci: " Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:42 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 08/62] mtd: rawnand: cs553x: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 08/62] mtd: rawnand: cs553x: " Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:41 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 06/62] mtd: rawnand: cafe: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 06/62] mtd: rawnand: cafe: " Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:39 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 05/62] mtd: rawnand: cadence: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 05/62] mtd: rawnand: cadence: " Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:38 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 04/62] mtd: rawnand: brcmnand: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Brian Norris, Kamal Dasu

On Tue, 2020-05-19 at 12:59:37 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Brian Norris <computersforpeace@gmail.com>
> Cc: Kamal Dasu <kdasu.kdev@gmail.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] 136+ messages in thread

* Re: [PATCH v2 03/62] mtd: rawnand: bcm47xx: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
@ 2020-05-24 19:08   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:08 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:36 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 02/62] mtd: rawnand: au1550nd: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
@ 2020-05-24 19:09   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:09 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:35 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release()
  2020-05-19 12:59 ` [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
@ 2020-05-24 19:09   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-24 19:09 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd

On Tue, 2020-05-19 at 12:59:34 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Let's stop using nand_release() by calling mtd_device_unregister() and
> nand_cleanup() directly.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.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] 136+ messages in thread

* Re: [PATCH v2 62/62] mtd: rawnand: Stop using nand_release()
  2020-05-19 13:00 ` [PATCH v2 62/62] mtd: rawnand: " Miquel Raynal
@ 2020-05-27 14:11   ` Miquel Raynal
  0 siblings, 0 replies; 136+ messages in thread
From: Miquel Raynal @ 2020-05-27 14:11 UTC (permalink / raw)
  To: Miquel Raynal, linux-mtd; +Cc: Jonathan Corbet

On Tue, 2020-05-19 at 13:00:35 UTC, Miquel Raynal wrote:
> This helper is not very useful and very often people get confused:
> they use nand_release() instead of nand_cleanup().
> 
> Now that all drivers have been converted to do not use nand_release()
> anymore, let's remove this helper.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Jonathan Corbet <corbet@lwn.net>

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] 136+ messages in thread

end of thread, back to index

Thread overview: 136+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 12:59 [PATCH v2 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
2020-05-24 19:09   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
2020-05-24 19:09   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 05/62] mtd: rawnand: cadence: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 06/62] mtd: rawnand: cafe: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 07/62] mtd: rawnand: cmx270: " Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 08/62] mtd: rawnand: cs553x: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 09/62] mtd: rawnand: davinci: " Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
2020-05-24 19:08   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 17/62] mtd: rawnand: fsmc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 18/62] mtd: rawnand: gpio: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 19/62] mtd: rawnand: gpmi: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 20/62] mtd: rawnand: hisi504: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
2020-05-24 19:07   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 25/62] mtd: rawnand: marvell: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 12:59 ` [PATCH v2 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 29/62] mtd: rawnand: mxc: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 30/62] mtd: rawnand: mxic: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 31/62] mtd: rawnand: ndfc: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 32/62] mtd: rawnand: omap2: " Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
2020-05-24 19:06   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 44/62] mtd: rawnand: qcom: " Miquel Raynal
2020-05-24 19:05   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 45/62] mtd: rawnand: r852: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 50/62] mtd: rawnand: socrates: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 55/62] mtd: rawnand: tango: " Miquel Raynal
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:04   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 59/62] mtd: rawnand: vf610: " Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
2020-05-22  0:12   ` Sasha Levin
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
2020-05-24 19:03   ` Miquel Raynal
2020-05-19 13:00 ` [PATCH v2 62/62] mtd: rawnand: " Miquel Raynal
2020-05-27 14:11   ` Miquel Raynal

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git