diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/fsl_elbc_nand.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 919c192b8f27..4b69aacdf5ca 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c | |||
@@ -481,7 +481,7 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len) | |||
481 | struct fsl_elbc_ctrl *ctrl = priv->ctrl; | 481 | struct fsl_elbc_ctrl *ctrl = priv->ctrl; |
482 | unsigned int bufsize = mtd->writesize + mtd->oobsize; | 482 | unsigned int bufsize = mtd->writesize + mtd->oobsize; |
483 | 483 | ||
484 | if (len < 0) { | 484 | if (len <= 0) { |
485 | dev_err(ctrl->dev, "write_buf of %d bytes", len); | 485 | dev_err(ctrl->dev, "write_buf of %d bytes", len); |
486 | ctrl->status = 0; | 486 | ctrl->status = 0; |
487 | return; | 487 | return; |
@@ -496,6 +496,15 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len) | |||
496 | } | 496 | } |
497 | 497 | ||
498 | memcpy_toio(&ctrl->addr[ctrl->index], buf, len); | 498 | memcpy_toio(&ctrl->addr[ctrl->index], buf, len); |
499 | /* | ||
500 | * This is workaround for the weird elbc hangs during nand write, | ||
501 | * Scott Wood says: "...perhaps difference in how long it takes a | ||
502 | * write to make it through the localbus compared to a write to IMMR | ||
503 | * is causing problems, and sync isn't helping for some reason." | ||
504 | * Reading back the last byte helps though. | ||
505 | */ | ||
506 | in_8(&ctrl->addr[ctrl->index] + len - 1); | ||
507 | |||
499 | ctrl->index += len; | 508 | ctrl->index += len; |
500 | } | 509 | } |
501 | 510 | ||