mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Ungerer <gerg@snapgear.com>,
	linux-kernel@vger.kernel.org,
	David McCullough <davidm@snapgear.com>
Subject: Re: [PATCH]: uClinux (MMU-less) patches against 2.5.28
Date: 26 Jul 2002 18:27:58 +0100	[thread overview]
Message-ID: <1027704478.14660.66.camel@irongate.swansea.linux.org.uk> (raw)
In-Reply-To: <6881.1027699265@redhat.com>

On Fri, 2002-07-26 at 17:01, David Woodhouse wrote:
> What locks the page? Surely our write() implementation is just using 
> copy_from_user(), to get the data from the user, and each erase and write 
> to the flash chip can be considered atomic -- what's holding a lock, and 
> what's causing the deadlock?

That is going to depend on the exact ordering that is done. You would
need to copy the user data into a temporary memory buffer (possibly
paging) then lock the flash write and restore.

Also a page can be locked because another I/O read is pending on it (ie
its already in someone elses read/page in handling and currently has
invalid data). You would need to be sure we never ended up with
deadlocks for any case where we have 

	process 1 copying page X from flash 2 to flash 1 page Y
	process 2 copying page Y from flash 1 to flash 2 page X

With jffs2 and temporary buffering I guess it works out. 


  parent reply	other threads:[~2002-07-26 16:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-25  6:56 Greg Ungerer
2002-07-25 14:52 ` David Woodhouse
2002-07-26  0:08   ` Greg Ungerer
2002-07-26  1:20   ` Greg Ungerer
2002-07-26  8:19   ` David Woodhouse
2002-07-26  9:39     ` David Woodhouse
2002-07-26  9:58       ` David Woodhouse
2002-07-26 14:03         ` David Woodhouse
2002-07-26 16:01           ` David Woodhouse
2002-07-26 16:27             ` David Woodhouse
2002-07-26 17:27             ` Alan Cox [this message]
2002-07-26 17:11           ` Alan Cox
2002-07-26 14:50         ` Alan Cox
2002-07-26 10:56       ` Alan Cox
2002-07-26 10:39     ` Alan Cox
2002-07-26 15:08     ` gerg
2002-07-26 15:45     ` David Woodhouse

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=1027704478.14660.66.camel@irongate.swansea.linux.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=davidm@snapgear.com \
    --cc=dwmw2@infradead.org \
    --cc=gerg@snapgear.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®