On Tue, Jun 28, 2011 at 6:51 AM, Dmitry Torokhov
[off-list ref] wrote:
avid Herrmann [off-list ref] wrote:
quoted
The raw hid output function that is supported by bluetooth low-level
hid driver does not provide an output queue and also may sleep. The
wiimote driver, though, may need to send data in atomic context so
this patch adds a buffered output queue for the wiimote driver.
We use the shared workqueue to send our buffer to the hid device.
There is always only one active worker which reschedules itself until
the wiimote queue is empty. This prevents the worker from occupying
the shared workqueue for too long.
With CWQ this is not a concern anymore, you should be able to flush your buffer at once.
Thanks, I wasn't sure about this. I've now changed:
- if (wdata->head != wdata->tail) {
+ while (wdata->head != wdata->tail) {
and removed the if(...) schedule_work(...);
--
Dmitry
Regards
David