No subject
jgq516 at gmail.com
jgq516 at gmail.com
Fri Nov 19 04:35:42 EST 2010
Hello,
I encountered the kernel warning "MTD do_write_buffer(): software timeout" when copy 20KB file to nor flash with flashcp cmd. The flash type is s29gl256p, and the suitable driver for the flash is cfi_cmdset_0002.c.
I think the issue should caused by the following codes in do_write_buffer func.
if (time_after(jiffies, timeo) && !chip_ready(map, adr))
break;
[snip]
printk(KERN_WARNING "MTD %s(): software timeout\n",
__func__ );
After experiments, I found if flashcp a file less than 12kB, the warning is disappeared. Or add some delay before check the chip is ready or not, then I could flashcp a larger size file, more delay can flashcp more size.
However I don't think add delay it is a good solution, from Figure"Write Buffer Programming Operation" of the flash datasheet, we should perform polling algorithm and check the polling status after write buffer program confirm. and xip_udelay implement the polling algorithm, is it right? But it seems only the arch which support MTD_XIP can use xip_udelay, otherwise UDELAY is defined with cfi_udelay rather than xip_udelay,.
Unfortunately, the cpu in my board doesn't support MTD_XIP now, is this means these archs without MTD_XIP support don't need poll after write buffer? or is there any good idea to handle the warning? Thanks.
Ps: I used 2.6.34 kernel, and the driver doesn't have obviously change after compare with the latest version.
Best Regards,
Xiao Jiang
More information about the linux-mtd
mailing list