public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Claudio Lanconelli <lanconelli.claudio@eptar.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: FAT vs jFFS2 for NAND.
Date: Tue, 20 Jun 2006 19:41:24 +0200	[thread overview]
Message-ID: <1150825284.6780.270.camel@localhost.localdomain> (raw)
In-Reply-To: <44982FC3.8080501@eptar.com>

Claudio,

On Tue, 2006-06-20 at 19:26 +0200, Claudio Lanconelli wrote:
> Thanks Thomas for your tips.
> Here a second try, does it look fine?

Much better now.

> I attached the file instead of inline to avoid tab/space replacement by 
> email client.

> however can I ask you where I find prototype/usage for mtd->block_is_bad()?

Oops, mtd->block_isbad()

	if (mtd->block_isbad(mtd, offset)
		skip_bad_block();
	else
		scan_block()

offs is the offset of the block:
0 for the first block
16384 for the second ...
you certainly have this offset handy in the scan any way

This looks up the bad block table which is created in ram after the NAND
chip has been detected in nand_scan() and helps you to avoid reading bad
blocks. Just skip the block, when the function returns 1.

The only exception I think is block 0, which contains the SSFDC header
and is marked bad for protection.

> And against which tree I need to build it? Be patient, please.

The best is to build against mtd-26.git from git.infradead.org. git
instructions are on the MTD homepage.

I do a thorough review, when you have it running with that tree.

Thanks,

	tglx


> #define ArraySize(x)	( sizeof(x) / sizeof((x)[0]) )

use the existing ARRAY_SIZE() macro please


> //Must be ordered by size

C++

> static const chs_entry_t chs_table[] = {

> /* Read and check for a valid CIS sector */
> static int get_valid_cis_sector(struct mtd_info *mtd)
> {
> 	int ret, k, cis_sector;
> 	size_t retlen;
> 	loff_t offset;
> 	uint8_t sect_buf[SECTOR_SIZE];
> 
> 	/* Look for CIS/IDI sector on the first GOOD block (give up after 4 bad
> 	   blocks). If the first good block doesn't contain CIS number the flash
> 	   is not SSFDC formatted */

	/*
	 * Use this for 
	 * multiline comments please
	 */

  reply	other threads:[~2006-06-20 17:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-28  2:58 FAT vs jFFS2 for NAND Han Chang
2006-05-28  5:54 ` Charles Manning
2006-06-15  0:34   ` Han Chang
2006-06-15  7:53     ` Thomas Gleixner
2006-06-19 18:31       ` Han Chang
2006-06-19 18:38         ` Thomas Gleixner
2006-06-19 20:23         ` David Woodhouse
2006-06-19 21:10           ` Charles Manning
2006-06-20 11:31         ` Claudio Lanconelli
2006-06-20 12:30           ` David Woodhouse
2006-06-20 13:25             ` Claudio Lanconelli
2006-06-20 13:52               ` Thomas Gleixner
2006-06-20 17:26                 ` Claudio Lanconelli
2006-06-20 17:41                   ` Thomas Gleixner [this message]
2006-06-21 14:15                     ` Claudio Lanconelli
2006-06-21 18:19                       ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1150825284.6780.270.camel@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=lanconelli.claudio@eptar.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox