All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: pwilshire-j9pdmedNgrk@public.gmane.org
Cc: bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org,
	uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org,
	Hans Eklund <hans-9ai+6vhHfRGzQB+pC5nmwQ@public.gmane.org>,
	Mike Frysinger
	<vapier.adi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [Uclinux-dist-devel] spi_mmc bus concurrency fix
Date: Wed, 27 Feb 2008 21:55:29 -0800	[thread overview]
Message-ID: <200802272155.29706.david-b@pacbell.net> (raw)
In-Reply-To: <47C5B084.6050408-j9pdmedNgrk@public.gmane.org>

On Wednesday 27 February 2008, Phil Wilshire wrote:
> 
> Thats why I wanted an optional callback after each single transfer.

That would preclude using chained DMA requests in those cases, but
presumably that'd be OK in this context.


> So if you are waiting  for a status byte in the spi data
> then the callback would add the a small read transfer a few times while 
> checking the status.

Just a few?  If you're assuming it would add a new spi_transfer after
the existing ones in that message ... that could add up to quite a lot
of additional transfers, presumably ones that are dynamically allocated.

I've seen some MMC/SD cards need quite a lot of polling there...


> When it times out (IE reaches a max retry limit) then the transfer can 
> be halted returning some kind of failure state.
> 
> If the correct status is found then the next transfer can be the data to 
> be written  to the device.
> 
> I thought about the single device queue based in chip select but that 
> looked a but more complex.

That is, one queue per device.  Yes, more complicated than one
shared between devices.  I was just pointing that out as an option
that could be implemented transparently ... albeit not portably.


> With the TRANSFER callback we have a good (IMHO) way to modify the 
> message flow based on the data contents.
> 
> The complete function may need two arguments. One to hold the SPI
> Transfer in progress and the other to hold user state
> (like max read loops and final state).
> 
> Let me know if this would fit in the "overall formal design" and I'll 
> stop hacking a custom solution.

It doesn't seem like the right approach to me.  In the specific use
case of an MMC interface, three'd be a *LOT* of those callbacks, each
adding another transfer to the current message.

And that breaks assumptions like being able to validate entire
messages before starting to process them, bounded memory use,
and so on.  I'd far rather see something that does less damage
to the underlying models.

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2008-02-28  5:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <47C42D50.7020204@rubico.se>
     [not found] ` <47C42D50.7020204-9ai+6vhHfRGzQB+pC5nmwQ@public.gmane.org>
2008-02-27  4:23   ` [Uclinux-dist-devel] spi_mmc bus concurrency fix Bryan Wu
     [not found]     ` <386072610802262023t6bd22875kfeb58c797be66024-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-02-27  4:46       ` David Brownell
     [not found]         ` <200802262046.29906.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-02-27 18:15           ` Mike Frysinger
2008-02-28  3:53           ` Bryan Wu
     [not found] ` <200802271036.07909.david-b@pacbell.net>
     [not found]   ` <47C5B084.6050408@cox.net>
     [not found]     ` <47C5B084.6050408-j9pdmedNgrk@public.gmane.org>
2008-02-28  5:55       ` David Brownell [this message]
     [not found]         ` <200802272155.29706.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-02-28  8:15           ` Phil Wilshire
     [not found]             ` <47C66D8A.3010904-j9pdmedNgrk@public.gmane.org>
2008-03-12 22:01               ` [Uclinux-dist-devel] " David Brownell
     [not found]                 ` <200803121501.19131.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-03-20 11:22                   ` [spi-devel-general] " Hans Eklund
2008-03-25 10:25                   ` Hans Eklund
     [not found] ` <200802270159.33231.david-b@pacbell.net>
     [not found]   ` <386072610802272023o71b99c2bn4d28547bd8783c9c@mail.gmail.com>
     [not found]     ` <386072610802272023o71b99c2bn4d28547bd8783c9c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-02-28  6:04       ` [Uclinux-dist-devel] " David Brownell
2008-03-25 10:25 Hans Eklund

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=200802272155.29706.david-b@pacbell.net \
    --to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
    --cc=bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
    --cc=hans-9ai+6vhHfRGzQB+pC5nmwQ@public.gmane.org \
    --cc=pwilshire-j9pdmedNgrk@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
    --cc=vapier.adi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.