From patchwork Sun Nov 17 10:08:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 3193781 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6C76FC045B for ; Sun, 17 Nov 2013 10:08:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C67720859 for ; Sun, 17 Nov 2013 10:08:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 134C720853 for ; Sun, 17 Nov 2013 10:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818Ab3KQKIM (ORCPT ); Sun, 17 Nov 2013 05:08:12 -0500 Received: from narfation.org ([79.140.41.39]:42076 "EHLO v3-1039.vlinux.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799Ab3KQKIK (ORCPT ); Sun, 17 Nov 2013 05:08:10 -0500 Received: from sven-desktop.home.narfation.org (drsd-4d05faee.pool.mediaWays.net [77.5.250.238]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 6C5511100BD; Sun, 17 Nov 2013 11:08:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=20121; t=1384682888; bh=kV4a8S4L+QKCDqX/J+zIIdSfKJzO/3yMI6jbCj8E/sk=; h=From:To:Cc:Subject:Date:From; b=fvXXmUHtYzOkx4wrhlCgPEON3/YZTiqpjIlv1tGUhaHZDroGURWnTjF2fWVIG4nTM v4qmO77uVypU16gicsN/CnYdChqUG+G1Fh1WR1GQtiY4QmBJV3t4AaEySASe/71PiL MvdJK24bWIdhihiDI5gwM8UIBRe+EUAOpE0p4x0s= From: Sven Eckelmann To: linux-input@vger.kernel.org Cc: Jiri Kosina , simon@mungewell.org, Sven Eckelmann Subject: [PATCH] Revert "HID: sony: Add force feedback support for Dualshock3 USB" Date: Sun, 17 Nov 2013 11:08:00 +0100 Message-Id: <1384682880-5960-1-git-send-email-sven@narfation.org> X-Mailer: git-send-email 1.8.4.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. [ 619.529530] BUG: scheduling while atomic: swapper/5/0/0x00000100 [...] [ 619.529707] Call Trace: [ 619.529710] [] ? dump_stack+0x41/0x51 [ 619.529723] [] ? __schedule_bug+0x44/0x51 [ 619.529731] [] ? __schedule+0x53a/0x720 [ 619.529739] [] ? schedule_timeout+0x1c9/0x2d0 [ 619.529756] [] ? ohci_urb_enqueue+0x1ea/0xa40 [ohci_hcd] [ 619.529763] [] ? gart_map_page+0x5a/0x80 [ 619.529786] [] ? usb_hcd_map_urb_for_dma+0x425/0x4b0 [usbcore] [ 619.529794] [] ? wait_for_completion_timeout+0xa1/0x120 [ 619.529801] [] ? wake_up_state+0x10/0x10 [ 619.529825] [] ? usb_start_wait_urb+0x6d/0xd0 [usbcore] [ 619.529848] [] ? usb_control_msg+0xbd/0x100 [usbcore] [ 619.529856] [] ? sony_play_effect+0x170/0x180 [hid_sony] [ 619.529864] [] ? ml_play_effects+0xf3/0x610 [ff_memless] [ 619.529872] [] ? ml_ff_playback+0xa0/0xa0 [ff_memless] [ 619.529880] [] ? ml_effect_timer+0x29/0x470 [ff_memless] [ 619.529888] [] ? call_timer_fn+0x31/0x100 [ 619.529895] [] ? ml_ff_playback+0xa0/0xa0 [ff_memless] [ 619.529903] [] ? run_timer_softirq+0x1c9/0x2b0 [ 619.529910] [] ? __do_softirq+0xf6/0x240 [ 619.529917] [] ? call_softirq+0x1c/0x30 [ 619.529924] [] ? do_softirq+0x55/0x90 [ 619.529930] [] ? irq_exit+0x95/0xa0 [ 619.529937] [] ? do_IRQ+0x49/0xb0 [ 619.529944] [] ? common_interrupt+0x6d/0x6d [ 619.529947] [] ? ktime_get+0x39/0xc0 [ 619.529959] [] ? native_safe_halt+0x2/0x10 [ 619.529966] [] ? default_idle+0x19/0xa0 [ 619.529973] [] ? amd_e400_idle+0x6b/0xf0 [ 619.529980] [] ? cpu_startup_entry+0xc8/0x270 [ 619.529987] [] ? start_secondary+0x1d2/0x230 This reverts commit a08c22c0df0ad23d0df10ae1a9df26643589b3cc. Reported-by: simon@mungewell.org Signed-of-by: Sven Eckelmann --- drivers/hid/Kconfig | 8 -------- drivers/hid/hid-sony.c | 52 -------------------------------------------------- 2 files changed, 60 deletions(-) diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 329fbb9..a27e531 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -618,14 +618,6 @@ config HID_SONY * Sony PS3 Blue-ray Disk Remote Control (Bluetooth) * Logitech Harmony adapter for Sony Playstation 3 (Bluetooth) -config SONY_FF - bool "Sony PS2/3 accessories force feedback support" - depends on HID_SONY - select INPUT_FF_MEMLESS - ---help--- - Say Y here if you have a Sony PS2/3 accessory and want to enable force - feedback support for it. - config HID_SPEEDLINK tristate "Speedlink VAD Cezanne mouse support" depends on HID diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index da551d1..bc37a18 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -614,54 +614,6 @@ static void buzz_remove(struct hid_device *hdev) drv_data->extra = NULL; } -#ifdef CONFIG_SONY_FF -static int sony_play_effect(struct input_dev *dev, void *data, - struct ff_effect *effect) -{ - unsigned char buf[] = { - 0x01, - 0x00, 0xff, 0x00, 0xff, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x03, - 0xff, 0x27, 0x10, 0x00, 0x32, - 0xff, 0x27, 0x10, 0x00, 0x32, - 0xff, 0x27, 0x10, 0x00, 0x32, - 0xff, 0x27, 0x10, 0x00, 0x32, - 0x00, 0x00, 0x00, 0x00, 0x00 - }; - __u8 left; - __u8 right; - struct hid_device *hid = input_get_drvdata(dev); - - if (effect->type != FF_RUMBLE) - return 0; - - left = effect->u.rumble.strong_magnitude / 256; - right = effect->u.rumble.weak_magnitude ? 1 : 0; - - buf[3] = right; - buf[5] = left; - - return hid->hid_output_raw_report(hid, buf, sizeof(buf), - HID_OUTPUT_REPORT); -} - -static int sony_init_ff(struct hid_device *hdev) -{ - struct hid_input *hidinput = list_entry(hdev->inputs.next, - struct hid_input, list); - struct input_dev *input_dev = hidinput->input; - - input_set_capability(input_dev, EV_FF, FF_RUMBLE); - return input_ff_create_memless(input_dev, NULL, sony_play_effect); -} - -#else -static int sony_init_ff(struct hid_device *hdev) -{ - return 0; -} -#endif - static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) { int ret; @@ -711,10 +663,6 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) if (ret < 0) goto err_stop; - ret = sony_init_ff(hdev); - if (ret < 0) - goto err_stop; - return 0; err_stop: hid_hw_stop(hdev);