Re: [linux-dvb] [patch]dma on stack in dib0700

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

On Tue, 2008-08-26 at 19:17 +0200, Patrick Boettcher wrote:
> This seems to be a big issue then: of course not only this driver 
> (dib0700) is affected by that, but also other modules inside the 
> dvb-usb-framework (and maybe other I don't even know).
> Is there is something generic to be done to avoid this problem rather
> than 
> putting a malloc in each micro-function? What I could think of is 
> allocating the buffers "one-time" and re-use them or to allocate them
> at 
> a lower level so that it is not visible and annoying for the
> developer.
> Patrick.
> On Tue, 26 Aug 2008, Oliver Neukum wrote:
> > USB on some architectures cannot do DMA with buffers on the stack.
> > Therefore the dib0700 driver will fail on some architectures. The
> fix is
> > allocating buffers on the stack.

The gspca driver:

- uses wrapping functions to call usb_msg_control for read / write,

- has a small buffer (8 bytes) in the main device descriptor (heap)
  which is used for most USB exchanges. This buffer is naturally
  protected by the mutex which protects the exchanges with the device
  (only one exchange - read or write - at a given time, except data
  flow by ISOC).

- does kmalloc/kfree in the wrapping functions when this buffer is too


Ken ar c'hentañ |             ** Breizh ha Linux atav! **
Jef             |     

v4l-dvb-maintainer mailing list

[Linux Media]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [SSH]     [Linux USB]

Add to Google Powered by Linux

Google PageRank Checking tool