linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SPI controller bugfixes needed (full duplex + DMA, data corruption)
@ 2008-11-15 22:22 David Brownell
       [not found] ` <200811151422.32748.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: David Brownell @ 2008-11-15 22:22 UTC (permalink / raw)
  To: kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Andrea
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi,

We recently turned up a bug in the pxa2xx SPI driver, which
turns out to also be present in the spi_imx.c and au1550_spi.c
drivers too.

Briefly, full duplex transfers are allowed to share the
same buffer (or partially overlap it), which means that
the dma mapping operations must be done in a safe order:

 - first map the TX buffer, so cache data gets written
   to memory where the DMA will pick it up;

 - then map the RX buffer, so that cache entries (with
   soon-to-be-stale data) get removed.

Doing it the other order, as is done with spi_imx and
with au1550_spi, causes data corruption by discarding
data from the cache *before* writing it to memory.

If you can do it, it'd be good to see this fixed before
the 2.6.28 kernel ships.

- Dave

p.s. Note that full duplex transfers became a bit more
     common after f9b90e39cbc5c4d6ef60022fd1f25d541df0aad1
     merged (in the 2.6.28-rc0 merge frenzy).

-------------------------------------------------------------------------
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=/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-18 22:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-15 22:22 SPI controller bugfixes needed (full duplex + DMA, data corruption) David Brownell
     [not found] ` <200811151422.32748.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-11-18  7:52   ` Sascha Hauer
     [not found]     ` <20081118075215.GD9553-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-11-18  8:30       ` Andrea Paterniani
     [not found]         ` <49227D0A.40506-03BXCEkGbFHYGGNLXY5/rw@public.gmane.org>
2008-11-18 22:04           ` David Brownell

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).