lkml.org 
[lkml]   [1996]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Accessing copy_to_user() from interrupt handler?
Date

alan@lxorguk.ukuu.org.uk (Alan Cox) writes:

>
> > holding 8k Pixels and it sends an interrupt when it is half full. I
> > have tried to wake up the process in the interrupt handler, but this
> > wasn't reliable under high load (sometimes the wakeup took to long and
> > the FIFO overflowed). Now I would like to try reading half a FIFO
>
> You probably want to buffer the data in the kernel, then the mlock isnt
> a problem (its up to the user).

This brings us back to the problem of kmalloc()ing ca. 1MB reliably. I
prefer allocating the buffer in the ccd_open() rather than in
module_init(). And so far there is no way to tell kmalloc() to page
out a couple of user pages if memory is running low instead of
failing. vmalloc() works, but then you don't want page faults when
reading from the CCD.

> > worth of data from the card and copy it to the mlock()'d user buffer
> > directly in the interrupt handler. Is this possible at all, or do I
>
> Its 'entertaining'.

What do you mean by entertaining (I can see you grinning while typing
this...). Is there a fundamental reason why it wouldn't work?

> The ATM folks have played with this a bit. Another
> approach is to make the device mmap()able and map the kernel CCD buffer
> into user space.

What kind of kernel memory can you mmap() into user space?
kmalloc()'d? Has it to be GFP_DMA? vmalloc()'d? Static?
The CCD has 768*516 pixels with 16 bit each (792.576 bytes). So
kmalloc() doesn't cut it. If you want to mmap() something, it has to
be continuous, right?

> Alan
>

-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@Chemie.Uni-Karlsruhe.De
Institut f. Anorg. Chemie II Tel: 0721 608 3485
Uni Karlsruhe
-------------------------------------------------------------------------

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.134 / U:23.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site