Hi Hirofumi,

On Saturday 13 October 2007, Hirofumi Momose wrote:
> Hello Laurent,
>
> On Fri, 12 Oct 2007 01:09:07 +0200
>
> Laurent Pinchart <[EMAIL PROTECTED]> wrote:
> > Looks like it :-/ The problems you report on this mailing list have all
> > been interesting so far, but next time please try to report something
> > trivial, that will be less work for me :-)
>
> ok ok :p
>
> So, I think this may be kernel/usb-driver issue.

My experience with the memory management subsystem is quite limited. I'm not 
sure which of the driver and the memory manager are at fault here (maybe 
both). Allocating 120kB of DMAable memory is probably not a good thing to do 
on memory constrained systems without an IOMMU.

> USB driver requests kernel to get continuous pages. and it fails.
> At first, when kernel passed less uptime, most of pages are continuous
> and driver works well. But these page goes smaller as time passed,
> finally fails.
>
> This usb-driver patch improves some extent, but not completely.
>
> *** /home/momose/linux-2.6.22/drivers/usb/core/buffer.c Thu Sep 13 00:31:41
> 2007 --- ./buffer.c  Tue Oct  9 22:57:40 2007
> ***************
> *** 117,123 ****
>                 if (size <= pool_max [i])
>                         return dma_pool_alloc(hcd->pool [i], mem_flags,
> dma); }
> !       return dma_alloc_coherent(hcd->self.controller, size, dma, 0);
>   }
>
>   void hcd_buffer_free(
> --- 117,123 ----
>                 if (size <= pool_max [i])
>                         return dma_pool_alloc(hcd->pool [i], mem_flags,
> dma); }
> !       return dma_alloc_coherent(hcd->self.controller, size, dma,
> __GFP_WAIT); }
>
>   void hcd_buffer_free(

hcd_buffer_alloc might be called from a non-sleepable context. You should 
replace 0 by mem_flags instead of hardcoding __GFP_WAIT. Either this is a bug 
in the USB stack, or there's something I don't completely understand. Could 
you raise the issue on the linux-usb-devel mailing list ?

> > For high-bandwidth isochronous streaming the driver allocates URB buffers
> > that can grow to 120kB. If this puts too much pressure on your system
> > memory, try to decrease UVC_MAX_ISO_PACKETS in uvcvideo.h.
>
> I will try it. What I am playing with is a small system.

Best regards,

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to