linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/02] 32-bit PIO wrappers for scatterlists
@ 2009-02-06 20:43 Michał Mirosław
  0 siblings, 0 replies; only message in thread
From: Michał Mirosław @ 2009-02-06 20:43 UTC (permalink / raw)
  To: Jens Axboe, Pierre Ossman; +Cc: linux-kernel

Hello,

While writing a driver for CB710 MMC host I had to implement PIO routines
that transferred data to/from buffers described by scatterlists. As it
turned later this scheme is needed for similar devices that can't handle
[scatter-gather] DMA in hardware.

Following is my implementation of such routines that should be generic
enough to use in drivers doing PIO by 32-bit accesses (PCI based devices
or maybe other 32-bit word based busses).

Current implementation has some limitations:
1. it advances scatterlist iterator always by multiple of 4 bytes
2. it silently inserts zeroes after last byte of buffer when transferring
   data to the device (that's actually a good thing for my driver)
3. it silently ignores data that does not fit into specified buffer when
   transferring data from the device (this also is a good thing for the
   driver I wrote)

What those points mean is that driver writer has to know how many bytes
there are available in the buffer if its important, and has to use
multiple-of-4 transfer sizes when doing more than one transfer using
a single iterator.

Patches are against vanilla kernel 2.6.28.

Best Regards,
Michał Mirosław

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-06 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-06 20:43 [PATCH 00/02] 32-bit PIO wrappers for scatterlists Michał Mirosław

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