Re: [PATCH try #2] Blackfin on-chip NAND Flash Controller driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bryan Wu
Date: Tuesday, September 11, 2007 - 2:04 am

On Tue, 2007-09-11 at 11:35 +0300, Artem Bityutskiy wrote:

Yes, it makes sense.


Actually, I debugged both oobtest.c and drivers/mtd/nand/nand_base.c

in the kernel nand_base.c
mtd->read_oob() --> nand_read_oob() --> nand_do_read_oob() -->
chip->ecc.read_oob() --> nand_read_oob_std() --> chip->read_buf() -->
bf5xx_nand.c bf5xx_nand_dma_read_buf().

In the calling path, rage check should not be in my driver code
bf5xx_nand_dma_read_buf() like other low level nand controller drivers.
It is already in nand_do_read_oob() as below:

---
	/* Do not allow reads past end of device */
	if (unlikely(from >= mtd->size ||
		     ops->ooboffs + readlen > ((mtd->size >> chip->page_shift) -
					(from >> chip->page_shift)) * len)) {
		DEBUG(MTD_DEBUG_LEVEL0, "nand_read_oob: "
			"Attempt read beyond end of device\n");
		return -EINVAL;
	}
---

maybe this condition testing does not include your case. I am not sure,
still busy at other task.


Good news. Thanks
Best Regards,
- Bryan Wu

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH try #2] Blackfin on-chip NAND Flash Controller ..., Artem Bityutskiy, (Thu Sep 6, 10:52 pm)
Re: [PATCH try #2] Blackfin on-chip NAND Flash Controller ..., Artem Bityutskiy, (Tue Sep 11, 1:35 am)
Re: [PATCH try #2] Blackfin on-chip NAND Flash Controller ..., Bryan Wu, (Tue Sep 11, 2:04 am)