Hi On Sun, Nov 17, 2013 at 10:36 AM, Sven Eckelmann <sven@xxxxxxxxxxxxx> wrote: > On Saturday 16 November 2013 17:30:25 simon@xxxxxxxxxxxxx wrote: >> This patch appears to work OK with my DualShock/SixAxis controller (USB >> connection), but causes a machine lockup when used with my Intec wired >> controller. >> >> The Intec controller works OK up to the point when I start rumble, >> sometimes the motor runs some times it doesn't. I am using SDL2's >> 'testhaptic' application. > > Thanks a lot for this bug report. The testhaptic was a good testcase because > it is a heavy user and can reproduce the problem quite easily. I've only > tested it using testrumble and own programs which didn't seem to trigger the > problem here. The problem is easy to explain: > > * usb_control_msg/usb_interrupt_msg/usb_bulk_msg/... may sleep > * sony_play_effect may gets called in an softirq context (atomic) > > So it is a bad choice to use hid_output_raw_report (which calls > usb_control_msg) in a ff_memless control function. I will just send a revert > patch in some minutes. Yeah, the input-ff callbacks cannot be handled inline. You also get deadlocks with the input-spinlock. In the wiimote driver I simply dispatch the ff-events to a workqueue. You can have a look at drivers/hid/hid-wiimote-modules.c. You can get some ordering-problems then, but these can usually be ignored as they just collapse events. The related commit was: commit f50f9aabf32db7414551ffdfdccc71be5f3d6e7d Author: David Herrmann <dh.herrmann@xxxxxxxxx> Date: Wed Oct 2 13:47:28 2013 +0200 HID: wiimote: fix FF deadlock Thanks David -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html