Thank you Alan for answering.

I had already checked all memory allocation and deallocation but its worth a double and triple check, I'll do that again today.
The tasklet_buffer is deallocated inside the process_data() function, thats because I don't know the exact time when the tasklet gets executed.
I have noticed that the problem is more often when the read urb is getting data very fast, in just a couple of jiffies I could be reading from the urb large bunches of data. This gives me the following questions:


Is there a problem with scheduling a tasklet very often and very quickly in the urb's completion function?
The process_data() function is quite large and complex, could there be a problem with that? are tasklets time critical like interruptions?


The variable process_tasklet used in:

tasklet_init(&process_tasklet, process_data, (unsigned long)tasklet_data);

resides in my driver's structure, in other words, its global for each particular sensor. Does that matter or can it be local?

Do tasklets need to be deallocated of freed after they are completed (is there a tasklet_init counterpart)?

Thank you very much.

On Feb 10, 2005, at 8:53 AM, Alan Stern wrote:

I once had to solve a similar problem with another driver. It would
randomly crash my X server. The answer turned out to be that the driver
was writing to a region of memory that had previously been deallocated.
Maybe your driver is doing something like that.


Incidentally, the code extract you posted shows that the routine doesn't
free tasklet_data if tasklet_data->tasklet_buffer can't be allocated.


Alan Stern

- Ing. Joaquin Durand Gomez http://homepage.mac.com/joakod



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to