Skip to content

Commit

Permalink
nand/denali: Add a page check in denali_read_page & denali_read_page_raw
Browse files Browse the repository at this point in the history
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Chuanxiao Dong authored and David Woodhouse committed Aug 12, 2010
1 parent 628bfd4 commit 7d8a26f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/mtd/nand/denali.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,13 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
INTR_STATUS0__ECC_ERR;
bool check_erased_page = false;

if (page != denali->page) {
dev_err(&denali->dev->dev, "IN %s: page %d is not"
" equal to denali->page %d, investigate!!",
__func__, page, denali->page);
BUG();
}

setup_ecc_for_xfer(denali, true, false);

denali_enable_dma(denali, true);
Expand Down Expand Up @@ -1193,6 +1200,13 @@ static int denali_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
uint32_t irq_status = 0;
uint32_t irq_mask = INTR_STATUS0__DMA_CMD_COMP;

if (page != denali->page) {
dev_err(&denali->dev->dev, "IN %s: page %d is not"
" equal to denali->page %d, investigate!!",
__func__, page, denali->page);
BUG();
}

setup_ecc_for_xfer(denali, false, true);
denali_enable_dma(denali, true);

Expand Down

0 comments on commit 7d8a26f

Please sign in to comment.