Hi,
I guess I'm surprised you're not using txrx_buffers() and having
that whole thing be IRQ driven, so the per-word cost eliminates
the task scheduling. You already paid for IRQ handling ... why
not have it store the rx byte into the buffer, and write the tx
byte froom the other buffer? That'd be cheaper than what you're
doing now ... in both time and code. Only wake up a task at
the end of a given spi_transfer().
I might be completely wrong here, but I was asking myself this very
question, and it looks like that's the way to implement full duplex
transfers.
For txrx_buffers to be properly implemented, you need to take a lot of
things into account. The main idea is not to lose the data in the
receive buffer due to overflow, and thus you need to set up 'Rx buffer
not free' int or whatever similar which will actually trigger after the
first word is sent. So therefore implementing txrx_buffers within these
conditions doesn't make much sense IMHO, unless you meant having a
separate thread to read from the Rx buffer, which is woken up on, say,
half-full Rx buffer.
Vitaly
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]