Thread (9 messages) 9 messages, 3 authors, 2013-11-19

Re: [PATCHv2] HID: sony: Send FF commands in non-atomic context

From: Jiri Kosina <hidden>
Date: 2013-11-19 08:38:25

On Sun, 17 Nov 2013, Sven Eckelmann wrote:
The ff_memless has a timer running which gets run in an atomic context and
calls the play_effect callback. The callback function for sony uses the
hid_output_raw_report (overwritten by sixaxis_usb_output_raw_report) function
to handle differences in the control message format. It is not safe for an
atomic context because it may sleep later in usb_start_wait_urb.

This "scheduling while atomic" can cause the system to lock up. A workaround is
to make the force feedback state update using work_queues and use the
play_effect function only to enqueue the work item.

Reported-by: Simon Wood <redacted>
Reported-by: David Herrmann <redacted>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
This patch can replace
 'Revert "HID: sony: Add force feedback support for Dualshock3 USB"'

It doesn't contain the command changes from <2014555.nmU692BQMt@sven-desktop>.
It would be nice when Simon Wood could test it again with his Intec Wired
controller. When it doesn't work:

 * Try to change to usb_interrupt_msg instead of sc->hdev->hid_output_raw_report
 * Send a interrupt message using buf[10] = 0x02
   (only when buf[3] != 0 || buf[5] != 0) followed by a message with
   buf[10] = 0x1e (always)
Now applied for 3.13. Thanks.

-- 
Jiri Kosina
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help