linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: onenand: fix deadlock in onenand_block_markbad
@ 2016-02-20 17:19 Aaro Koskinen
  2016-02-24 11:59 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Aaro Koskinen @ 2016-02-20 17:19 UTC (permalink / raw)
  To: Artem Bityutskiy, Kyungmin Park, David Woodhouse, linux-mtd; +Cc: Aaro Koskinen

Commit 5942ddbc500d ("mtd: introduce mtd_block_markbad interface")
incorrectly changed onenand_block_markbad() to call mtd_block_markbad
instead of onenand_chip's block_markbad function. As a result the function
will now recurse and deadlock. Fix by reverting the change.

Fixes: 5942ddbc500d ("mtd: introduce mtd_block_markbad interface")
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 drivers/mtd/onenand/onenand_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 43b3392..5bd3da5 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -2599,6 +2599,7 @@ static int onenand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
  */
 static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
 {
+	struct onenand_chip *this = mtd->priv;
 	int ret;
 
 	ret = onenand_block_isbad(mtd, ofs);
@@ -2610,7 +2611,7 @@ static int onenand_block_markbad(struct mtd_info *mtd, loff_t ofs)
 	}
 
 	onenand_get_device(mtd, FL_WRITING);
-	ret = mtd_block_markbad(mtd, ofs);
+	this->block_markbad(mtd, ofs);
 	onenand_release_device(mtd);
 	return ret;
 }
-- 
2.4.0

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

* Re: [PATCH] mtd: onenand: fix deadlock in onenand_block_markbad
  2016-02-20 17:19 [PATCH] mtd: onenand: fix deadlock in onenand_block_markbad Aaro Koskinen
@ 2016-02-24 11:59 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2016-02-24 11:59 UTC (permalink / raw)
  To: Aaro Koskinen, Kyungmin Park, David Woodhouse, linux-mtd

On Sat, 2016-02-20 at 19:19 +0200, Aaro Koskinen wrote:
> -       ret = mtd_block_markbad(mtd, ofs);
> +       this->block_markbad(mtd, ofs);
>         onenand_release_device(mtd);
>         return ret;

What do we return then?

-- 
Best Regards,
Artem Bityutskiy

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

end of thread, other threads:[~2016-02-24 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-20 17:19 [PATCH] mtd: onenand: fix deadlock in onenand_block_markbad Aaro Koskinen
2016-02-24 11:59 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).