Take the 2-minute tour ×

I have a kernel module in which I deal with USB devices.

It happens that I can successfully send a USB bulk message to a device, but that operation is being made under the callback of a binary attribute.

However, there is a specific operation that I need to do when something happens. When that happens, I need to send a bulk message to the device. The place in which that occurs is the own device data income callback. If I send the bulk message in that place I get a kernel panic.

Can someone tell me why?

If that is not a proper place to do such operation, where can I safely do it? How can I signal the operation to be done in another place? A Timer?

Please advice regarding this specific problem.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

I managed to solve the problem I was facing with the following approach:

  • Created a work task
  • Placed the processing that was being made into a work task routine
  • I schedule that work task every time I have enough data to process what I need.

I think this approach leads to a better design since the time spent in the interruption handle is thus reduced.

I can now invoke usb_bulk_msg(...) peacefully since I'm not in an interrupt context anymore. That was indeed the problem.

share|improve this answer
add comment

Your Answer


