I know what Âyou wrote, Âbut Âbefore Âdevice Âis Âremoved Âand Âfreed Âmemory Âautomatically, Âprogramming Âpages may Âdo Âmany Âmany Âtimes.
Assume Âwe Âerase and rewrite a large part of the Âflash, Âthen spinand_program_page() Âmight exhaust Âmemory if memory is not large enough.
In Âfact, ÂOOM Âindeed occured when ÂI Âtested programming Âmulti-pages by mtd_debug tool.
If ÂOOM Âwas not Âcaused Âby Âdevm_kzalloc() in spinand_program_page(), Âwhat Âmay Âexhaust Âmemory?
Best Regards,âââââââââââââââââââââââââ
Jheng-Jhong Wu (Victor Wu)
âââââââââââââââââââââââââ
devm_ resources are freed automatically when the device is removed.
The name devm_ stands for "device" and "managed".
regards,
dan carpenter