]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.6.2/mtd-nand-use-the-mirror-bbt-descriptor-when-reading-its-version.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.6.2 / mtd-nand-use-the-mirror-bbt-descriptor-when-reading-its-version.patch
CommitLineData
6cbd67ed
GKH
1From 7bb9c75436212813b38700c34df4bbb6eb82debe Mon Sep 17 00:00:00 2001
2From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
3Date: Sun, 10 Jun 2012 13:58:12 +0300
4Subject: mtd: nand: Use the mirror BBT descriptor when reading its version
5
6From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
7
8commit 7bb9c75436212813b38700c34df4bbb6eb82debe upstream.
9
10The code responsible for reading the version of the mirror bbt was
11incorrectly using the descriptor of the main bbt.
12
13Pass the mirror bbt descriptor to 'scan_read_raw' when reading the
14version of the mirror bbt.
15
16Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
17Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
18Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
19Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22---
23 drivers/mtd/nand/nand_bbt.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26--- a/drivers/mtd/nand/nand_bbt.c
27+++ b/drivers/mtd/nand/nand_bbt.c
28@@ -390,7 +390,7 @@ static int read_abs_bbts(struct mtd_info
29 /* Read the mirror version, if available */
30 if (md && (md->options & NAND_BBT_VERSION)) {
31 scan_read_raw(mtd, buf, (loff_t)md->pages[0] << this->page_shift,
32- mtd->writesize, td);
33+ mtd->writesize, md);
34 md->version[0] = buf[bbt_get_ver_offs(mtd, md)];
35 pr_info("Bad block table at page %d, version 0x%02X\n",
36 md->pages[0], md->version[0]);