lkml.org 
[lkml]   [2005]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [spi-devel-general] Re: [PATCH 2.6-git 0/4] SPI core refresh
Looks like we'll have to remove explicit wait_for_completion from 
spi_trasnfer to make it (potentially) work.
Rui, your turn will then be
a) not to use thread async message handling which is the default but
b) use some kind of PIO method for reading from the SPI bus.

The other solution which looks preferable to me is to have a pretty
simple interrupt handler which just wakes up a thread which in turn
reads what it wants not caring much about sleeps (as it's not gonna be
interrupt context any more).

Vitaly

Rui Sousa wrote:

>On Tue, 2005-12-13 at 15:09 +0300, dmitry pervushin wrote:
>
>
>>On Mon, 2005-12-12 at 19:01 +0100, Rui Sousa wrote:
>>
>>
>>>How do you handle IRQ's generated by a SPI device (e.g ack the
>>>interrupt, check if it was the SPI device that generated the
>>>interrupt, ...) if you can't read/write on the SPI bus from interrupt
>>>context?
>>>
>>>
>>Hmm... what do you mean by "cannot read/write" ? Normally you can
>>write/read registers in interrupt context
>>
>>
>
>The registers I want to read are from a SPI device (a SPI slave attached
>to a SPI bus). I need to use SPI bus transfers to access them.
>
>
>
>>, and then set the
>>flag/complete the completion/what else ?
>>
>>
>
>If I read the API correctly reading/writing a byte from the SPI bus
>(synchronously) always implies putting the task doing the read to sleep:
>
>int spi_transfer(struct spi_msg *msg, void (*callback) (struct spi_msg
>*, int))
>{
>
>...
> err = TO_SPI_BUS_DRIVER(bus->driver)->queue(msg);
> wait_for_completion(&msg->sync);
>...
>}
>
>So, how can I, from an interrupt handler, read/write a couple of bytes
>from my SPI device using this API?
>
>
>
>>In other words, could you please share the code that causes problems ?
>>
>>
>>
>
>Rui
>
>
>
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-14 08:00    [W:0.071 / U:1.328 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site