irq, tasklet and i2c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2003-02-04 at 10:23, Markus Schorer wrote:

> 2) i assign a buffer for a single piece of data. reading from the
> device,
> i wait in a wait queue.
> an interrupt schedules a tasklet. the tasklet read the data over i2c, 
> stores it in the buffer and does a wakeup.
> then the read process reads the data out of the buffer.
> works.

In general, it's wrong to sleep in a tasklet. As I understand it,
i2c_master_recv is allowed to sleep (I'm writing my driver on that
assumption, somebody correct me if I'm wrong). I think your first
version is superior, though if you're targeting 2.4 and 2.5 kernels then
a completion is easier than a wait queue.

If you want to do a ringbuffer, consider creating a worker thread and
using semaphores for producer / consumer scheduling.

- Adrian Cox
http://www.humboldt.co.uk/





[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux