]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mtd: onenand: fix deadlock in onenand_block_markbad
authorAaro Koskinen <aaro.koskinen@iki.fi>
Sat, 20 Feb 2016 20:27:48 +0000 (22:27 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:46:07 +0000 (15:46 -0700)
Orabug: 23331065

[ Upstream commit 5e64c29e98bfbba1b527b0a164f9493f3db9e8cb ]

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>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 084b44e9cbc6eec0b0b13138918fb5935208f3b4)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/mtd/onenand/onenand_base.c

index 43b3392ffee7e255555d88948e4dbe2aa47867d2..652d018328735c6761711b63850106cc70f0e08c 100644 (file)
@@ -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);
+       ret = this->block_markbad(mtd, ofs);
        onenand_release_device(mtd);
        return ret;
 }