public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: kangjw@lenovo.com
To: linux-omap-open-source@linux.omap.com
Subject: Help! Omap730 ext2 file system problem?
Date: Tue, 21 Mar 2006 10:41:28 +0800	[thread overview]
Message-ID: <OFC36582A1.D7DA06EC-ON48257138.000EB4AD@LocalDomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]

hi.

I meet a strange problem. my system uses omap730 and 32M Intel Nor flash.
the rootfs is ext2 file system on flash MTD, when I opened a file to write
and save,
always save flash is error, the mtdblock debug info is below:

"mtdblock: erase of region [0x0, 0x20000] on "rootfs" failed
end_request: I/O error, dev mtdblock3, sector 2174 "

from above detail trace, the error of return is -EROFS,
the return is from "do_erase_oneblock" function in file
"cfi_cmdset_0001.c".

The point of return from here:

static int __xipram do_erase_oneblock(struct map_info *map, struct flchip
*chip,
                          unsigned long adr, int len, void *thunk)
{
      .....
     /* We've broken this before. It doesn't hurt to be safe */
     map_write(map, CMD(0x70), adr);
     chip->state = FL_STATUS;
     status = map_read(map, adr);

     /* check for errors */
     if (map_word_bitsset(map, status, CMD(0x3a))) {
          unsigned long chipstatus = MERGESTATUS(status);

          /* Reset the error bits */
          map_write(map, CMD(0x50), adr);
          map_write(map, CMD(0x70), adr);
          xip_enable(map, chip, adr);

          if ((chipstatus & 0x30) == 0x30) {
               printk(KERN_ERR "%s: block erase error: (bad command
sequence, status 0x%lx)\n", map->name, chipstatus);
               ret = -EINVAL;
          } else if (chipstatus & 0x02) {
               /* Protection bit set */
               ret = -EROFS;                 //=================return
error from here.
          } else if (chipstatus & 0x8) {
               /* Voltage */
               printk(KERN_ERR "%s: block erase error: (bad VPP)\n",
map->name);
               ret = -EIO;
          } else if (chipstatus & 0x20 && retries--) {
               printk(KERN_DEBUG "block erase failed at 0x%08lx: status
0x%lx. Retrying...\n", adr, chipstatus);
               timeo = jiffies + HZ;
               put_chip(map, chip, adr);
               spin_unlock(chip->mutex);
               goto retry;
          } else {
               printk(KERN_ERR "%s: block erase failed at 0x%08lx (status
0x%lx)\n", map->name, adr, chipstatus);
               ret = -EIO;
          }
}


But the rootfs is writeable in my system. the file part log of setup is
below:

omapflash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
 Intel/Sharp Extended Query Table at 0x010A
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Creating 4 MTD partitions on "omapflash.0":
0x00000000-0x00020000 : "bootloader"
0x00020000-0x00040000 : "params"
0x00040000-0x00240000 : "kernel"
0x00240000-0x02000000 : "rootfs"


Here is my nor_partitions set.the root partition is write able.

static struct mtd_partition nor_partitions[] = {
     /* bootloader (U-Boot, etc) in first sector */
     {
           .name         = "bootloader",
           .offset       = 0,
           .size         = SZ_128K,
           .mask_flags   = MTD_WRITEABLE, /* force read-only */
     },
     /* bootloader params in the next sector */
     {
           .name         = "params",
           .offset       = MTDPART_OFS_APPEND,
           .size         = SZ_128K,
           .mask_flags   = 0,
     },
     /* kernel */
     {
           .name         = "kernel",
           .offset       = MTDPART_OFS_APPEND,
           .size         = SZ_2M,
           .mask_flags   = 0
     },
     /* rest of flash is a file system */
     {
           .name         = "rootfs",
           .offset       = MTDPART_OFS_APPEND,
           .size         = MTDPART_SIZ_FULL,
           .mask_flags   = 0
     },
};


Please help me and give me some comment!

Best regards.

######################################################
   Andy Kang
   Lenovo Mobile Limited R&D Center,Shanghai Branch
   9F,No.696 Songtao Rd.,Pudong High-Tech,Shanghai
   Tel:+86-21-50504500-8437
------------------------------------------------------

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



                 reply	other threads:[~2006-03-21  2:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=OFC36582A1.D7DA06EC-ON48257138.000EB4AD@LocalDomain \
    --to=kangjw@lenovo.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /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