linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [mtd] possible bug in nandsim
@ 2013-11-07 11:43 Tanya Brokhman
  2013-11-07 14:35 ` Richard Weinberger
  0 siblings, 1 reply; 11+ messages in thread
From: Tanya Brokhman @ 2013-11-07 11:43 UTC (permalink / raw)
  To: dedekind, linux-mtd, dedekind, pratibha

Hi

I've recently started working with the nand simulator. For my testing 
purposes I have to use it with a cache file. Bellow are the commands I run:

modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa 
third_id_byte=0x00 fourth_id_byte=0x15 cache_file=cache_file.txt
modprobe ubi mtd=0 fm_autoconvert=1

Unfortunately, when trying the above I noticed that the next time i load 
nandsim and ubi on top of it the fastmap data is not saved at 
cache_file.txt and the device comes up as clean. Meaning, the cache file 
feature of the nandsim isn't working properly.

So while debugging this I think I found the root cause:
unsigned long *pages_written from struct nandsim also needs saving. 
Otherwise while reading a page (at read_page()) we enter the following 
code flow:

if (!test_bit(ns->regs.row, ns->pages_written)) {
		memset(ns->buf.byte, 0xFF, num);
} else {

thus, ignoring the content of the cache file.

I've fixed this internally in my build by just saving the content of 
pages_written to a file on __exit and reading from that file on __init.

I was wondering if someone had done this in a more elegant way perhaps?

If not, I'll beautify my patch and share.

Thanks,
Tanya Brokhman
-- 
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-02-13 13:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 11:43 [mtd] possible bug in nandsim Tanya Brokhman
2013-11-07 14:35 ` Richard Weinberger
2013-11-07 14:58   ` Ezequiel Garcia
2013-11-07 18:02     ` Tanya Brokhman
2013-11-07 18:47       ` Ezequiel Garcia
2014-02-12  9:51     ` Tanya Brokhman
2014-02-12  9:55       ` Richard Weinberger
2014-02-12 22:42         ` Matthew Gabeler-Lee
2014-02-13 13:06           ` Tanya Brokhman
2014-02-13 13:21             ` Ezequiel Garcia
2014-02-13 13:39               ` Tanya Brokhman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).