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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <dedekind@...>
Cc: <bryan.wu@...>, David Woodhouse <dwmw2@...>, Thomas Gleixner <tglx@...>, Mike Frysinger <vapier.adi@...>, Robin Getz <rgetz@...>, <linux-mtd@...>, <linux-kernel@...>, <akpm@...>
Date: Tuesday, September 11, 2007 - 5: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 dr..., Bryan Wu, (Tue Sep 11, 5:04 am)