The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Maxim Levitsky <maximlevitsky@gmail.com>
To: "Jörn Engel" <joern@logfs.org>
Cc: Alex Dubov <oakad@yahoo.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	arnd@arndb.de, tglx@linutonix.de
Subject: Re: XD/smartmedia - how to implement it right?
Date: Sat, 12 Dec 2009 01:48:11 +0200	[thread overview]
Message-ID: <1260575291.8536.15.camel@maxim-laptop> (raw)
In-Reply-To: <20091201082236.GA27691@logfs.org>

On Tue, 2009-12-01 at 09:22 +0100, Jörn Engel wrote: 
> On Tue, 1 December 2009 01:04:26 +0200, Maxim Levitsky wrote:
> > 
> > Alex, could you do me a favor, and explain why partial block writes
> > don't work?
> > What happens if its done?
> 
> With the Alauda and the limited set of cards I tried they work.
> 
> Jörn
> 
I have few severe problems in writing the driver, but otherwise its is
almost written. I also suspect that I will have to modify mtd core in
several places to achieve what I need to. I guess Alex was right after
all...

First of all, the device I deal with supports 32 bit dma only, as well
as many other pci devices. (I know that for sure because dma register is
32 bit wide....)

Now, mtd_blkdevs doesn't ask block subsystem for 32 bit bounce, and in
addition to that there is no guarantee that my mtd driver won't be
called on unrelated kernel buffer (for example if ftl layer does
caching....)
So I guess, ether I need to try to map the buffer, and then fail back to
copying into preallocated buffer in 32 bit zone, or always use that
buffer.
MMC core seem to handle the dma bouncing inside.


But that minor problem, other problem, I revealed when I began to think
about how properly to guard against races.
Problem is that mtd core doesn't handle hot-plug well.

Suppose, user has mounted filesystem on xd card and pulls it out.
SD/MMC cards handle that case. There might be fs corruption though, but
that is the user responsibility.

Now if anything has open the mtd_blkdevs, it increments the mtd user
count, thus removal of the mtd device will just fail.
Now I really don't know how to handle that property, but I know that
yanking out usb keys, mmc cards, etc works, and all devices that were
created disappear.

I will eventually figure out how to do that right, but it would be great
if you help me a bit.

Best regards,
Maxim Levitsly 





  parent reply	other threads:[~2009-12-11 23:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-21  0:25 XD/smartmedia - how to implement it right? Maxim Levitsky
2009-11-21 10:25 ` Jörn Engel
2009-11-22 12:58   ` Maxim Levitsky
2009-11-24 23:50     ` Plan for adding XD support in mtd layer Maxim Levitsky
2009-11-25 10:40       ` Jörn Engel
2009-11-25 13:20         ` Maxim Levitsky
2009-11-25 15:34           ` Jörn Engel
2009-11-25 16:17             ` Maxim Levitsky
2009-11-25 20:59               ` Jörn Engel
2009-11-25 23:22                 ` Maxim Levitsky
2009-11-26  8:27                   ` Jörn Engel
2009-11-26 13:02                     ` Maxim Levitsky
2009-11-26 13:42                       ` Jörn Engel
2009-11-26 21:38                         ` Maxim Levitsky
2009-11-28  7:22   ` XD/smartmedia - how to implement it right? Alex Dubov
2009-11-28 10:36     ` Maxim Levitsky
2009-11-30 12:35       ` Alex Dubov
2009-11-30 13:58         ` Maxim Levitsky
2009-11-30 23:04           ` Maxim Levitsky
2009-12-01  8:22             ` Jörn Engel
2009-12-01 16:10               ` Alex Dubov
2009-12-01 16:41                 ` Maxim Levitsky
2009-12-11 23:48               ` Maxim Levitsky [this message]
2009-12-05 19:09           ` Pavel Machek
2009-12-06 21:27             ` Maxim Levitsky
2009-12-07 15:13               ` Arnd Bergmann

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=1260575291.8536.15.camel@maxim-laptop \
    --to=maximlevitsky@gmail.com \
    --cc=arnd@arndb.de \
    --cc=joern@logfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oakad@yahoo.com \
    --cc=tglx@linutonix.de \
    /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