Re: em28xx problem with 3.10-4.0

Mauro Carvalho Chehab
2015-06-17T11:02:54Z

Em Wed, 17 Jun 2015 08:32:26 +0200
"Gabor Z. Papp" <gzpapp.lists@gmail.com> escreveu:

> * Mauro Carvalho Chehab <mchehab@osg.samsung.com>:
>
> | Nothing. You just ran out of continuous memory. This driver
> | requires long chunks of continuous memory for USB data transfer.
>
> And there is no way to preset some mem?
> Or do something to get the driver work again?
> I don't think I'm using too much memory.
>
> $ free
> total used free shared buffers cached
> Mem: 2073656 625696 1447960 0 21072 231096
> -/+ buffers/cache: 373528 1700128
> Swap: 1004056 0 1004056

>From your error logs, it failed to allocate the 3rd buffer (of a total of 5
buffers) with a continuous block of 165.120 bytes on the DMA range.

In order words, your system needs to have at least 5 non-fragmented buffers
with 256KB each, on a memory region where the CPU can do DMA (e. g.
outside the high memory area).

I'm not a memory management specialist, but I guess you could try to change
some sysctl parameters or use a different memory allocator in order to avoid
memory fragmentation.

If you're a C programmer, an option would be to change the driver's code
to optimize it for low memory usage, for example, to reduce the buffer size
and increasing the number of buffers (at the cost of requiring more CPU
and/or reducing the maximum size of the image). Another alternative would be
to reserve the memory at the time the driver gets loaded.

Regards,
Mauro