public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Kugan" <kugan@mediasolv.com>
To: <linux-mtd@lists.infradead.org>, <jffs-dev@axis.com>
Subject: jffs & amd_flash.c
Date: Sun, 16 Sep 2001 20:16:38 -0700	[thread overview]
Message-ID: <000e01c13f27$2f029f60$941373cb@mediasolv.com> (raw)
In-Reply-To: 3B52FE8B.8F2736C6@daniel.com

Hi All
I am new to this mailing list.
I have uClinux 2.0.38 kernel running on Atmel EB63 Evaluation board, there I
have ATMEL AT491604 90 TC flash.  I have partitioned the flash with pnc2000.
after mounting the jffs when i try to create a file on the partitione it is
going into this function and adding the task to waiq and calling and
schedule and seems it is struck there,
Where does this waitq consumed and what could be the mistake????
Thanx in Advance

Kugan

tatic int write_one_word(struct map_info *map, struct flchip *chip,
     unsigned long adr, __u32 datum)
{
 unsigned long timeo = jiffies + HZ;
 struct amd_flash_private *private = map->fldrv_priv;
 DECLARE_WAITQUEUE(wait, current);
 int ret = 0;
 int times_left;

retry:
 spin_lock_bh(chip->mutex);

 if (chip->state != FL_READY){
  printk("%s: waiting for chip to write, state = %d\n",
         map->name, chip->state);
  set_current_state(TASK_UNINTERRUPTIBLE);
  add_wait_queue(&chip->wq, &wait);

  spin_unlock_bh(chip->mutex);

  schedule();
  remove_wait_queue(&chip->wq, &wait);
  printk(KERN_INFO "%s: woke up to write\n", map->name);
  if(signal_pending(current))
   return -EINTR;

  timeo = jiffies + HZ;

  goto retry;
 }

 chip->state = FL_WRITING;

 adr += chip->start;
 ENABLE_VPP(map);
 send_cmd(map, chip->start, CMD_PROGRAM_UNLOCK_DATA);
 wide_write(map, datum, adr);

 times_left = 500000;
 while (times_left-- && flash_is_busy(map, adr, private->interleave))

  if (current->need_resched) {
   spin_unlock_bh(chip->mutex);
   schedule();
   spin_lock_bh(chip->mutex);
  }
 }

 if (!times_left) {
  printk(KERN_WARNING "%s: write to 0x%lx timed out!\n",
         map->name, adr);
  ret = -EIO;
 } else {
  __u32 verify;
  if ((verify = wide_read(map, adr)) != datum) {
   printk(KERN_WARNING "%s: write to 0x%lx failed. "
          "datum = %x, verify = %x\n",
          map->name, adr, datum, verify);
   ret = -EIO;
  }
 }

 DISABLE_VPP(map);
 chip->state = FL_READY;
 wake_up(&chip->wq);
 spin_unlock_bh(chip->mutex);

 return ret;
}

  parent reply	other threads:[~2001-09-17  3:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-16 14:34 JFFS2 Stability problem! Frederic Giasson
2001-07-16 14:42 ` David Woodhouse
2001-07-16 14:47   ` Vipin Malik
2001-07-17  7:11     ` David Woodhouse
2001-09-17  3:16     ` Kugan [this message]
2001-09-18  8:19       ` jffs & amd_flash.c Jarkko Lavinen
2001-09-18  8:37         ` Kugan
2001-09-18  9:00           ` Jarkko Lavinen
2001-07-17 17:00   ` JFFS2 Stability problem! Doron Sandroy

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='000e01c13f27$2f029f60$941373cb@mediasolv.com' \
    --to=kugan@mediasolv.com \
    --cc=jffs-dev@axis.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