linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SPI devices that require lots of small transfers, how?
@ 2008-12-11 15:35 Domen Puncer
  0 siblings, 0 replies; only message in thread
From: Domen Puncer @ 2008-12-11 15:35 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hello!

I'm writing a driver for a 2 Mbit/s wireless chip interfaced via SPI.
Now, transmit isn't a problem, I can push data out at full speed
(interrupt handler just signals with a semaphore that there's a free TX
buffer, then in process context I write the next one).

I'm having trouble with receiving lots of data.
The chip has 3 32-byte buffers, with interrupt per received buffer this
makes about 7800 interrupts/second at full speed.
Offloading RX transfers to userspace doesn't seem to be an option, since
it misses packets; those 3 buffers fill up pretty fast.

If I handle it in interrupt, with spi_async, then I'm not sure how can I
implement this RX loop (pseudocode, to get the idea):
	do {
		spi_device_read_payload()
		spi_device_clear_rx_interrupt()
	} while (spi_device_there_is_more_data())

A recursion with spi_async() callbacks doesn't sound safe.

(Handling in interrupt, without the above loop doesn't seem fast enough
either, I'm losing packets).


Any ideas, suggestions, comments are very much welcome.
Surely someone had to deal with something similar in the past?


	Domen

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/

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

only message in thread, other threads:[~2008-12-11 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-11 15:35 SPI devices that require lots of small transfers, how? Domen Puncer

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