Re: [PATCH]: uClinux (MMU-less) patches against 2.5.28

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Jul 26 2002 - 12:27:58 EST


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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:24 EST