linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ned Forrester <nforrester-/d+BM93fTQY@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: spi-devel
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: SPI TX andRX buffer overlap
Date: Thu, 13 Nov 2008 15:02:07 -0500	[thread overview]
Message-ID: <491C87BF.6030905@whoi.edu> (raw)

David,

In DMA mode, pxa2xx_spi.c fails to detect the case where the tx and rx
buffers overlap, and thus it performs dma_map_single incorrectly for
that case.  I am working on a patch for that, but I have a question
about overlapped buffers.

I know that it is legitimate for the tx and rx buffers to be the same;
spidev passes identical tx and rx addresses, for example.  I plan to fix
pxa2xx_spi so that it handles buffers having the same start address
(completely overlapped), in addition to the currently handled case of
completely non-overlapped buffers.  For shared buffers, I plan to call
dma_map_single() and dma_unmap_single() once for the buffer with a
parameter of DMA_BIDIRECTIONAL (let me know if that is not correct).

That said, I would like to know whether I can/should reject the case of
overlapped buffers that do not have the same start address.  As I try to
program for that case, the code is getting ugly.  It would be cleaner to
detect overlapped but unequal buffers and refuse DMA in that case.
Comments?

-- 
Ned Forrester                                       nforrester-/d+BM93fTQY@public.gmane.org
Oceanographic Systems Lab                                  508-289-2226
Applied Ocean Physics and Engineering Dept.
Woods Hole Oceanographic Institution          Woods Hole, MA 02543, USA
http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212
http://www.whoi.edu/hpb/Site.do?id=1532
http://www.whoi.edu/page.do?pid=10079


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

             reply	other threads:[~2008-11-13 20:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 20:02 Ned Forrester [this message]
     [not found] ` <491C87BF.6030905-/d+BM93fTQY@public.gmane.org>
2008-11-14 22:30   ` SPI TX andRX buffer overlap David Brownell
     [not found]     ` <200811141430.53146.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-14 23:01       ` Ned Forrester
     [not found]         ` <491E033E.9010008-/d+BM93fTQY@public.gmane.org>
2008-11-14 23:10           ` Ned Forrester
2008-11-14 23:41           ` David Brownell
     [not found]             ` <200811141541.46799.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-15  3:53               ` Ned Forrester
     [not found]                 ` <491E47BD.5080005-/d+BM93fTQY@public.gmane.org>
2008-11-15  4:41                   ` David Brownell

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=491C87BF.6030905@whoi.edu \
    --to=nforrester-/d+bm93ftqy@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).