diff options
author | Marek Vasut <marex@denx.de> | 2012-05-21 16:59:27 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-06-01 15:22:21 -0400 |
commit | 5636ce0f070dee85c1b1203fe436a89648d25d06 (patch) | |
tree | 8b533f99d6fb45e803b752d8e58b8e837323c53d /drivers/mtd | |
parent | 2e929d001e85126d9267de373d4b76014789661d (diff) |
mtd: gpmi-nand: define ecc.strength
Fix an issue which was introduced by the recent addition of ecc.strength.
The ecc.strength wasn't set in gpmi-nand, resulting in the following crash:
[ 2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347!
...
[ 2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4)
[ 2.550000] [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>] (platform_drv_probe+0x14/0x18)
[ 2.550000] [<c01f6618>] (platform_drv_probe+0x14/0x18) from [<c01f55b0>] (driver_probe_device+0x74/0x1fc)
[ 2.550000] [<c01f55b0>] (driver_probe_device+0x74/0x1fc) from [<c01f57cc>] (__driver_attach+0x94/0x98)
[ 2.550000] [<c01f57cc>] (__driver_attach+0x94/0x98) from [<c01f3d40>] (bus_for_each_dev+0x50/0x80)
[ 2.550000] [<c01f3d40>] (bus_for_each_dev+0x50/0x80) from [<c01f4e18>] (bus_add_driver+0x188/0x25c)
[ 2.550000] [<c01f4e18>] (bus_add_driver+0x188/0x25c) from [<c01f5a70>] (driver_register+0x78/0x138)
[ 2.550000] [<c01f5a70>] (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30)
[ 2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>] (do_one_initcall+0x108/0x17c)
[ 2.550000] [<c0008824>] (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc)
[ 2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>] (kernel_thread_exit+0x0/0x8)
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 95f2af848ff0..3eafc68154ed 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -1424,6 +1424,10 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data *this) | |||
1424 | if (ret) | 1424 | if (ret) |
1425 | return ret; | 1425 | return ret; |
1426 | 1426 | ||
1427 | /* Adjust the ECC strength according to the chip. */ | ||
1428 | this->nand.ecc.strength = this->bch_geometry.ecc_strength; | ||
1429 | this->mtd.ecc_strength = this->bch_geometry.ecc_strength; | ||
1430 | |||
1427 | /* NAND boot init, depends on the gpmi_set_geometry(). */ | 1431 | /* NAND boot init, depends on the gpmi_set_geometry(). */ |
1428 | return nand_boot_init(this); | 1432 | return nand_boot_init(this); |
1429 | } | 1433 | } |
@@ -1482,6 +1486,7 @@ static int __devinit gpmi_nfc_init(struct gpmi_nand_data *this) | |||
1482 | chip->options |= NAND_NO_SUBPAGE_WRITE; | 1486 | chip->options |= NAND_NO_SUBPAGE_WRITE; |
1483 | chip->ecc.mode = NAND_ECC_HW; | 1487 | chip->ecc.mode = NAND_ECC_HW; |
1484 | chip->ecc.size = 1; | 1488 | chip->ecc.size = 1; |
1489 | chip->ecc.strength = 8; | ||
1485 | chip->ecc.layout = &gpmi_hw_ecclayout; | 1490 | chip->ecc.layout = &gpmi_hw_ecclayout; |
1486 | 1491 | ||
1487 | /* Allocate a temporary DMA buffer for reading ID in the nand_scan() */ | 1492 | /* Allocate a temporary DMA buffer for reading ID in the nand_scan() */ |