diff options
author | Vipin Kumar <vipin.kumar@st.com> | 2012-03-14 02:17:16 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-26 19:59:49 -0400 |
commit | 712c4add03277197168210bb628b8273e36adf76 (patch) | |
tree | 5242f3ea2ad38565e3f975ae84119eeb502bf392 /drivers/mtd | |
parent | 82b9dbe2e0f6870bf385b759b91e403b62a60c5e (diff) |
mtd: nand/fsmc: Use dev_err to report error scenario
fsmc controller takes time to calculate the bch8 codes and the error offsets.
The calculate logic checks for completion upto a timeout. This patch adds a
error print when this timer expires and the ecc or error offsets are not yet
calculated.
Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Reviewed-by: Viresh Kumar <viresh.kumar@st.com>
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/fsmc_nand.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c index 56b661972122..c41f45faa09e 100644 --- a/drivers/mtd/nand/fsmc_nand.c +++ b/drivers/mtd/nand/fsmc_nand.c | |||
@@ -296,6 +296,7 @@ struct fsmc_nand_data { | |||
296 | 296 | ||
297 | struct fsmc_eccplace *ecc_place; | 297 | struct fsmc_eccplace *ecc_place; |
298 | unsigned int bank; | 298 | unsigned int bank; |
299 | struct device *dev; | ||
299 | struct clk *clk; | 300 | struct clk *clk; |
300 | 301 | ||
301 | struct fsmc_nand_timings *dev_timings; | 302 | struct fsmc_nand_timings *dev_timings; |
@@ -457,6 +458,11 @@ static int fsmc_read_hwecc_ecc4(struct mtd_info *mtd, const uint8_t *data, | |||
457 | cond_resched(); | 458 | cond_resched(); |
458 | } while (!time_after_eq(jiffies, deadline)); | 459 | } while (!time_after_eq(jiffies, deadline)); |
459 | 460 | ||
461 | if (time_after_eq(jiffies, deadline)) { | ||
462 | dev_err(host->dev, "calculate ecc timed out\n"); | ||
463 | return -ETIMEDOUT; | ||
464 | } | ||
465 | |||
460 | ecc_tmp = readl(®s->bank_regs[bank].ecc1); | 466 | ecc_tmp = readl(®s->bank_regs[bank].ecc1); |
461 | ecc[0] = (uint8_t) (ecc_tmp >> 0); | 467 | ecc[0] = (uint8_t) (ecc_tmp >> 0); |
462 | ecc[1] = (uint8_t) (ecc_tmp >> 8); | 468 | ecc[1] = (uint8_t) (ecc_tmp >> 8); |
@@ -793,6 +799,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev) | |||
793 | host->select_chip = pdata->select_bank; | 799 | host->select_chip = pdata->select_bank; |
794 | host->partitions = pdata->partitions; | 800 | host->partitions = pdata->partitions; |
795 | host->nr_partitions = pdata->nr_partitions; | 801 | host->nr_partitions = pdata->nr_partitions; |
802 | host->dev = &pdev->dev; | ||
796 | host->dev_timings = pdata->nand_timings; | 803 | host->dev_timings = pdata->nand_timings; |
797 | regs = host->regs_va; | 804 | regs = host->regs_va; |
798 | 805 | ||