public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Vitaly Wool <vwool@ru.mvista.com>
Cc: linux-kernel@vger.kernel.org, dpervushin@gmail.com,
	akpm@osdl.org, greg@kroah.com, basicmark@yahoo.com,
	komal_shah802003@yahoo.com, stephen@streetfiresound.com,
	spi-devel-general@lists.sourceforge.net, Joachim_Jaeger@digi.com
Subject: Re: [PATCH 2.6-git] MTD/SPI dataflash driver
Date: Thu, 1 Dec 2005 10:33:41 -0800	[thread overview]
Message-ID: <200512011033.41627.david-b@pacbell.net> (raw)
In-Reply-To: <20051201191837.222fe0b3.vwool@ru.mvista.com>

On Thursday 01 December 2005 8:18 am, Vitaly Wool wrote:
 
> It took about fifteen minutes of mindwork to port the MTD dataflash driver
> posted by David Brownell 11/23 to our SPI core from David's,

Interesting and informative; +1!

Did you have a chance to test this?  There are some post-2.6.15-rc3-mm1
updates to this code, mostly to catch startup fauults better but also to
hotplug reasonably.  The glitches I saw may as easily be JFFS2 integration
issues for the DataFlash code as bitbang adapter problems.  (I think you
started more or less from what's in rc3-mm1.)


> reducing both 
> the size of the source code and the footprint of the object code.
> I'd also like to mention that now it looks significatnly easier to understand
> due to no more use of complicated SPI message structures. The number of variables
> used was also decreased

I think that's all the same issue.  Other than "spi_driver" replacing
"device_driver" (I'd like to see a patch doing that to rc3-mm1), the
main changes seem to be:

  - Move from original atomic requests like this

	{ write command, read response }

    over to two separate requests

	{ write command, and leave CS active }
	{ read response, and leave CS off }

 - Lower the per-request performance ceiling on this driver

      * original code could be implemented in a single DMA chain on
        at least two systems I happen to have handy ... one IRQ.

      * this version requires two separate chains, with an intervening
        task schedule.  (More than twice the cost.)

      * in your framework I still can't be _sure_ it never does memcpy
        for those buffers (the last version I looked at did so).  the
        original code just used normal DMA models, so it "obviously"
        doesn't risk memcpy.

 - Add fault handling problems ... probably an oversight, you call
   routines and don't check for fault reports.  Though I'm not clear
   how the faults between the two requests would be handled (in your
   framework) with any robustness... doing this right could easily
   cost all the codespace you've conserved.

 - I might agree with this being "easier to understand" code, though
   it's debatable.  (The device sees one transaction, why should the
   driver writer have to split it up into two?)  But that doesn't
   matter much:  filesystems are better with "faster to run" code.

 - Chipselect works differently in your code.  You're giving one
   driver control over all the devices sharing a controller, by
   blocking requests going to other devices until your driver yields
   the chipselect.  This seems like a bad idea even if you ignore
   how it produces priority inversions in your framework.  :)

So the way I see it, this is a good example of why my original I/O model
is better.  It provides _flexibility_ in the API so that some drivers
can be really smart, if they want to.  You haven't liked the consequence
of that though:  controller drivers being able to choose how they
represent and manage I/O queues, rather than doing that in your "core".

- Dave




  reply	other threads:[~2005-12-01 18:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01 16:11 [PATCH 2.6-git] SPI core refresh Vitaly Wool
2005-12-01 16:18 ` [PATCH 2.6-git] MTD/SPI dataflash driver Vitaly Wool
2005-12-01 18:33   ` David Brownell [this message]
2005-12-02  6:01     ` Vitaly Wool
2005-12-02 22:07       ` David Brownell
2005-12-01 16:21 ` [PATCH 2.6-git] SPI core refresh Russell King
2005-12-01 16:30   ` Vitaly Wool
2005-12-01 18:04 ` Stephen Street
2005-12-01 18:22 ` Greg KH
2005-12-02  6:06   ` Vitaly Wool
2005-12-02 18:50     ` Mark Underwood
2005-12-02 20:13     ` Greg KH
2005-12-05 18:01 ` Vitaly Wool
2005-12-08  1:59   ` David Brownell
2005-12-08  6:33     ` Vitaly Wool
2005-12-09 22:55       ` David Brownell
2005-12-10 11:15         ` Vitaly Wool
2005-12-11 12:36         ` Vitaly Wool
2005-12-11 17:03           ` [spi-devel-general] " Vitaly Wool
2005-12-11 20:17             ` David Brownell
2005-12-11 22:13               ` Vitaly Wool
2005-12-11 23:54                 ` David Brownell
2005-12-12  7:09                   ` Vitaly Wool
2005-12-11 22:15               ` Vitaly Wool
2005-12-11 22:18               ` Vitaly Wool
  -- strict thread matches above, loose matches on Subject: below --
2005-12-03 11:32 [PATCH 2.6-git] MTD/SPI dataflash driver vitalhome

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=200512011033.41627.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=Joachim_Jaeger@digi.com \
    --cc=akpm@osdl.org \
    --cc=basicmark@yahoo.com \
    --cc=dpervushin@gmail.com \
    --cc=greg@kroah.com \
    --cc=komal_shah802003@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=stephen@streetfiresound.com \
    --cc=vwool@ru.mvista.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