From neversetsun@ustc.edu Fri Mar 28 09:17:03 2008
Received: from smtp.ustc.edu.cn ([202.38.64.16] helo=ustc.edu.cn)
	by stoneboat.aleph1.co.uk with smtp (Exim 4.63)
	(envelope-from <neversetsun@ustc.edu>) id 1JfAhY-0005HW-Tj
	for yaffs@lists.aleph1.co.uk; Fri, 28 Mar 2008 09:17:03 +0000
Received: (eyou send program); Fri, 28 Mar 2008 17:16:54 +0800
Message-ID: <406695814.23298@ustc.edu.cn>
X-EYOUMAIL-SMTPAUTH: shizheng@mail.ustc.edu.cn
Received: from unknown (HELO [127.0.0.1]) (219.219.218.106)
	by 202.38.64.8 with SMTP; Fri, 28 Mar 2008 17:16:54 +0800
Message-ID: <47ECB76E.8030103@ustc.edu>
Date: Fri, 28 Mar 2008 17:16:30 +0800
From: shizheng <neversetsun@ustc.edu>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To: Charles Manning <manningc2@actrix.gen.nz>
References: <47CD76CA.2050008@ustc.edu>
	<200803051123.16629.manningc2@actrix.gen.nz>
In-Reply-To: <200803051123.16629.manningc2@actrix.gen.nz>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-SA-Exim-Connect-IP: 202.38.64.16
X-SA-Exim-Mail-From: neversetsun@ustc.edu
X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on
	stoneboat.aleph1.co.uk
X-Spam-Level: 
X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,
	MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no version=3.2.3
X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000)
X-SA-Exim-Scanned: Yes (on stoneboat.aleph1.co.uk)
Cc: yaffs@lists.aleph1.co.uk
Subject: Re: [Yaffs] Source code mismatching development notes of Yaffs2?
X-BeenThere: yaffs@lists.aleph1.co.uk
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Discussion of YAFFS NAND flash filesystem <yaffs.lists.aleph1.co.uk>
List-Unsubscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>, 
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=unsubscribe>
List-Archive: <http://lists.aleph1.co.uk/lurker/list/yaffs.html>
List-Post: <mailto:yaffs@lists.aleph1.co.uk>
List-Help: <mailto:yaffs-request@lists.aleph1.co.uk?subject=help>
List-Subscribe: <http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs>,
	<mailto:yaffs-request@lists.aleph1.co.uk?subject=subscribe>
X-List-Received-Date: Fri, 28 Mar 2008 09:17:03 -0000

Hi,
Could you please give any further explanation about bad block handling?
Since it's handled by nand driver, what is confusing?

BTW:
There're two yaffs_mtdif2.c in cvs. One is $(SRC_ROOT)/yaffs_mtdif2.c, 
another one is
$(SRC_ROOT)/patches/yaffs_mtdif2.c. Is the second one still useful under 
linux 2.6.24?

best wishes, shizheng

Charles Manning wrote:
> On Wednesday 05 March 2008 05:20:26 shizheng wrote:
>   
>> I'm viewing the latest source from cvs and I've got
>> a few questions about Yaffs2, especially when I compared
>> the code to the development notes(http://www.yaffs.net/node/38):
>>
>>     
>> 1. tag information stored in NAND oob
>> In the development notes, it says Yaffs2 has these tag information
>> including blockState, chunkId, objectId, nBytes, blockSequence, tagsEcc
>> and ecc.
>> But in yaffs_packedtags2.h, it defines
>> typedef struct {
>> unsigned sequenceNumber;
>> unsigned objectId;
>> unsigned chunkId;
>> unsigned byteCount;
>> } yaffs_PackedTags2TagsPart;
>>
>> typedef struct {
>> yaffs_PackedTags2TagsPart t;
>> yaffs_ECCOther ecc;
>> } yaffs_PackedTags2;
>>
>> and blockState and ecc on data are missing. I have no idea
>> about the MTD layer of linux, so I don't know whether the
>> two tags are handled by MTD.
>>     
>
> The difference is because the one structure is the yaffs_ExtendedTags 
> structure which is an abstracted form of the tags. This is the structure that 
> is passed around within yaffs.
>
> The packed tags are the tags as packed down for writing into NAND. If you look 
> at the yaffs_packedtags2.c file you will see the conversion beween these two 
> forms.
>
> The block state is managed by a slightly different mechanism, by directly 
> querying the nand driver.
>
> This stuff can be a bit confusing at times and I hope to refactor this to be 
> far clearer.
>
>
>   
>> 2. The file $(SRC_ROOT)/patches/yaffs_mtdif2.c isn't useful, is it?
>> I have checkouted the source code, and done make/insmod directly on linux
>> without merging Yaffs into kernel tree.
>>     
> I think I must be missing your point here. THis file converts the more 
> abstract NAND interface into calls to mtd to provide the services.
>
>   
>> The module works well without any patch when simple file operation is
>> tested on NANDSim(2kB page, 64B oob, 512MB chipsize).
>>     
>
> Glad to hear it.
>
>   
>> best wishes, shizheng
>>
>>
>>
>> _______________________________________________
>> yaffs mailing list
>> yaffs@lists.aleph1.co.uk
>> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
>>     
>
>
>
>   



