Nand flash: hang after erase

Elizabeth Clarke eclarke at
Thu Jan 24 07:13:22 EST 2002

I'm playing with nandtest on an mtd partition, and found it hangs after
it has erased the first block. Putting in some debug I find that it gets
as far as the schedule call in mtdchar.c mtd_ioctl line 324. Here's a

	  FIXME: Allow INTERRUPTIBLE. Which means
	  not having the wait_queue head on the stack.
	  If the wq_head is on the stack, and we
	  leave because we got interrupted, then the
	  wq_head is no longer there when the
	  callback routine tries to wake us up.
	ret = mtd->erase(mtd, erase);
	if (!ret) {
		add_wait_queue(&waitq, &wait);
		if (erase->state != MTD_ERASE_DONE &&
		    erase->state != MTD_ERASE_FAILED)
		remove_wait_queue(&waitq, &wait);
			ret = (erase->state == MTD_ERASE_FAILED)?-EIO:0;

Since I'm still on the beginning of the learning curve somewhat I have
no idea what this is trying to achieve, or where to go from here. Ideas,
pointers, please?


More information about the linux-mtd mailing list