Skip to contentSkip to conversation

mtd: rawnand: gpmi: Fix suspend/resume problem

PATCH Applied Esben Haabendal 6 participants 15 messages Jan 2, 2020 – Jan 17, 2020

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mtd: rawnand: gpmi: Fix suspend/resume problem

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +6 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
 	struct resources *r = &this->resources;
 	int ret;
 
+	ret = pm_runtime_get_sync(this->dev);
+	if (ret < 0)
+		return ret;
+
 	ret = gpmi_reset_block(r->gpmi_regs, false);
 	if (ret)
 		goto err_out;
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
 	return 0;
 err_out:
+	pm_runtime_mark_last_busy(this->dev);
+	pm_runtime_put_autosuspend(this->dev);
 	return ret;
 }
 
Signature · 6 lines
2.24.1


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

PATCH 2/2 mtd: rawnand: gpmi: Restore nfc timing setup after suspend/resume

As we reset the GPMI block at resume, the timing parameters setup by a previous exec_op is lost. Rewriting GPMI timing registers on first exec_op after resume fixes the problem.

---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +4 -0
index 7ac8c8b95afc..fcc7325f2a10 100644
@@ -2728,6 +2728,10 @@ static int gpmi_pm_resume(struct device *dev)
 		return ret;
 	}
 
+	/* Set flag to get timing setup restored for next exec_op */
+	if (this->hw.clk_rate)
+		this->hw.must_apply_timings = true;
+
 	/* re-init the BCH registers */
 	ret = bch_set_geometry(this);
 	if (ret) {
Signature · 6 lines
2.24.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] mtd: rawnand: gpmi: Restore nfc timing setup after suspend/resume

Quoted 15 lines · Esben Haabendal

As we reset the GPMI block at resume, the timing parameters setup by a previous exec_op is lost. Rewriting GPMI timing registers on first exec_op after resume fixes the problem.

---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -0
index 7ac8c8b95afc..fcc7325f2a10 100644

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_pm_resume(struct device *dev) · line 2734

Quoted 7 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +4 -0
@@ -2728,6 +2728,10 @@ static int gpmi_pm_resume(struct device *dev)
                return ret;
        }
 
+       /* Set flag to get timing setup restored for next exec_op */
+       if (this->hw.clk_rate)
+               this->hw.must_apply_timings = true;
+
Quoted 10 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -1
        /* re-init the BCH registers */
        ret = bch_set_geometry(this);
        if (ret) {
--

2.24.1

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

Signature · 7 lines
Sincerely,

Han XU

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Applied
#3 lore raw

Re: [PATCH 2/2] mtd: rawnand: gpmi: Restore nfc timing setup after suspend/resume

In reply to Esben Haabendal
Quoted 6 lines · Esben Haabendal

As we reset the GPMI block at resume, the timing parameters setup by a previous exec_op is lost. Rewriting GPMI timing registers on first exec_op after resume fixes the problem.

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

Miquel

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

#4 lore raw
In reply to Esben Haabendal
Quoted 30 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +4 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
        struct resources *r = &this->resources;
        int ret;
 
+       ret = pm_runtime_get_sync(this->dev);
+       if (ret < 0)
+               return ret;
+
        ret = gpmi_reset_block(r->gpmi_regs, false);
        if (ret)
                goto err_out;

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 191

Quoted 7 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -0
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
        return 0;
 err_out:
+       pm_runtime_mark_last_busy(this->dev);
+       pm_runtime_put_autosuspend(this->dev);
        return ret;
 }

I have a similar patch with more fixes, will send out tonight for review.

Quoted 8 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -1
--

2.24.1

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

Signature · 7 lines
Sincerely,

Han XU

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer
#5 lore raw

Hi Han,

Han Xu <[email protected]> wrote on Tue, 7 Jan 2020 13:31:27 -0600:

Quoted 32 lines · Esben Haabendal
Quoted 31 lines

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +4 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
        struct resources *r = &this->resources;
        int ret;
 
+       ret = pm_runtime_get_sync(this->dev);
+       if (ret < 0)
+               return ret;
+
        ret = gpmi_reset_block(r->gpmi_regs, false);
        if (ret)
                goto err_out;
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
Quoted 8 lines

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 191

Quoted 6 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -0
        return 0;
 err_out:
+       pm_runtime_mark_last_busy(this->dev);
+       pm_runtime_put_autosuspend(this->dev);
        return ret;
 }  

I have a similar patch with more fixes, will send out tonight for review.

What should I do with this patch? It seems okay to me, what is your plan? May I take this one for this release and you'll build above with your series, is this fine for you?

Thanks,
Miquèl

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

#6 lore raw
Quoted 46 lines · Miquel Raynal

Hi Han,

Han Xu <[email protected]> wrote on Tue, 7 Jan 2020 13:31:27 -0600:

Quoted 32 lines · Esben Haabendal
Quoted 31 lines

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +4 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
        struct resources *r = &this->resources;
        int ret;
 
+       ret = pm_runtime_get_sync(this->dev);
+       if (ret < 0)
+               return ret;
+
        ret = gpmi_reset_block(r->gpmi_regs, false);
        if (ret)
                goto err_out;
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
Quoted 8 lines

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 191

Quoted 6 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -0
        return 0;
 err_out:
+       pm_runtime_mark_last_busy(this->dev);
+       pm_runtime_put_autosuspend(this->dev);
        return ret;
 }

I have a similar patch with more fixes, will send out tonight for review.

Quoted 3 lines

What should I do with this patch? It seems okay to me, what is your plan? May I take this one for this release and you'll build above with your series, is this fine for you?

Sorry for late, just sent out the patch for review.

Quoted 3 lines

Thanks,
Miquèl

Signature · 7 lines
Sincerely,

Han XU

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Acked-by on v1 1/2
#7 lore raw
In reply to Esben Haabendal
Quoted 30 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +4 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
        struct resources *r = &this->resources;
        int ret;
 
+       ret = pm_runtime_get_sync(this->dev);
+       if (ret < 0)
+               return ret;
+
        ret = gpmi_reset_block(r->gpmi_regs, false);
        if (ret)
                goto err_out;

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 191

Quoted 7 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -0
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
        return 0;
 err_out:
+       pm_runtime_mark_last_busy(this->dev);
+       pm_runtime_put_autosuspend(this->dev);
        return ret;
 }
Quoted 8 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -1
--

2.24.1

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

Signature · 7 lines
Sincerely,

Han XU

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Applied
#8 lore raw
In reply to Esben Haabendal
Quoted 10 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110

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

Miquel

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

#9 lore raw
Quoted 5 lines · Miquel Raynal
Quoted 3 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

Quoted 7 lines
Quoted 7 lines
[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110

Shouldn't this one contain a Fixes tag and be backported to stable?

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

maintainer
#10 lore raw

Hi Fabio,

Fabio Estevam <[email protected]> wrote on Tue, 14 Jan 2020 14:09:21 -0300:

Quoted 11 lines · Miquel Raynal
Quoted 10 lines · Esben Haabendal
Quoted 8 lines

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

Shouldn't this one contain a Fixes tag and be backported to stable?

Does this has ever worked in the past? If yes can someone -Esben, Han- provide a Fixes tag? I'll edit the patch by hand. I plan to send the PR at the end of the week.

Thanks,
Miquèl

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

#11 lore raw

Hi Miquel,

Quoted 1 line · Miquel Raynal

Does this has ever worked in the past? If yes can someone -Esben, Han-

Yes, it works.

Adding "Cc: stable" plus the Fixes tag makes it to go to stable kernels automatically after it reaches Linus' tree.

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

#12 lore raw
In reply to Esben Haabendal

Hi Esben,

Quoted 18 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -0
index 334fe3130285..7ac8c8b95afc 100644

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 153

Quoted 6 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +3 -0
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
 	struct resources *r = &this->resources;
 	int ret;
 
+	ret = pm_runtime_get_sync(this->dev);
+	if (ret < 0)
+		return ret;

This increases the devices usage counter...

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 186

Quoted 7 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1 -0
+
 	ret = gpmi_reset_block(r->gpmi_regs, false);
 	if (ret)
 		goto err_out;
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
 	return 0;

... but doesn't decrease it in the success case. This means this patch effectively disables runtime pm. You should fall through here as fixed in Han Xus patch.

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 190

Quoted 4 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -0
 err_out:
+	pm_runtime_mark_last_busy(this->dev);
+	pm_runtime_put_autosuspend(this->dev);
 	return ret;

Sascha

Signature · 8 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer
#13 lore raw

Hi Esben,

Sascha Hauer <[email protected]> wrote on Wed, 15 Jan 2020 08:46:22 +0100:

Quoted 24 lines

Hi Esben,

Quoted 21 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
 	struct resources *r = &this->resources;
 	int ret;
 
Quoted 5 lines

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 153

Quoted 3 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +3 -0
+	ret = pm_runtime_get_sync(this->dev);
+	if (ret < 0)
+		return ret;  

This increases the devices usage counter...

I'm dropping the two patches for now, please resend with this fixed and the Fixes/Cc:stable tags added.

I'll freeze the PR at the end of the week.

Quoted 12 lines

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 186

Quoted 7 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +1 -0
+
 	ret = gpmi_reset_block(r->gpmi_regs, false);
 	if (ret)
 		goto err_out;
@@ -181,6 +185,8 @@ static int gpmi_init(struct gpmi_nand_data *this)
 
 	return 0;  

... but doesn't decrease it in the success case. This means this patch effectively disables runtime pm. You should fall through here as fixed in Han Xus patch.

Quoted 7 lines

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 190

Quoted 4 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +2 -0
 err_out:
+	pm_runtime_mark_last_busy(this->dev);
+	pm_runtime_put_autosuspend(this->dev);
 	return ret;  

Sascha

Thanks,
Miquèl

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

#14 lore raw
Quoted 35 lines · Miquel Raynal

Hi Esben,

Sascha Hauer <[email protected]> wrote on Wed, 15 Jan 2020 08:46:22 +0100:

Quoted 24 lines

Hi Esben,

Quoted 21 lines · Esben Haabendal

On system resume, the gpmi clock must be enabled before accessing gpmi block. Without this, resume causes something like

[  661.348790] gpmi_reset_block(5cbb0f7e): module reset timeout
[  661.348889] gpmi-nand 1806000.gpmi-nand: Error setting GPMI : -110
[  661.348928] PM: dpm_run_callback(): platform_pm_resume+0x0/0x44 returns -110
[  661.348961] PM: Device 1806000.gpmi-nand failed to resume: error -110
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +0 -0
index 334fe3130285..7ac8c8b95afc 100644
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
 	struct resources *r = &this->resources;
 	int ret;
 
Quoted 5 lines

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c static int gpmi_init(struct gpmi_nand_data *this) · line 153

Quoted 3 lines
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +3 -0
+	ret = pm_runtime_get_sync(this->dev);
+	if (ret < 0)
+		return ret;  

This increases the devices usage counter...

Quoted 4 lines

I'm dropping the two patches for now, please resend with this fixed and the Fixes/Cc:stable tags added.

I'll freeze the PR at the end of the week.

I will send out revised patches tonight.

/Esben

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