Bug 35022

Summary: hid_magicmouse broken
Product: Drivers Reporter: Jérémy Lal (kapouer)
Component: Input DevicesAssignee: Jiri Kosina (jikos)
Status: CLOSED CODE_FIX    
Severity: normal CC: florian, jikos, kapouer, maciej.rutecki, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.39-rc6 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 32012    

Description Jérémy Lal 2011-05-13 14:47:58 UTC
Bluetooth magicmouse works with kernel 2.6.38, whereas 2.6.39 (as far as i remember, started before rc6) gives :

input: Souris de lal as /devices/pci0000:00/0000:00:1a.7/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.0/bluetooth/hci0/hci0:11/input13
magicmouse 0005:05AC:030D.0008: input,hidraw4: BLUETOOTH HID v3.06 Mouse [Souris de lal] on 44:2A:60:CD:FD:7D
magicmouse 0005:05AC:030D.0008: unable to request touch data (-5)
magicmouse: probe of 0005:05AC:030D.0008 failed with error -5

and mouse is not working at all.
Sometimes, repairing fixes the issue, but most of the time it doesn't.

Feel free to ask me for more info.

Jérémy.
Comment 1 Jérémy Lal 2011-05-16 00:18:09 UTC
Disabling the failing test makes the mouse work again. Maybe that could help diagnose the problem.

 	ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature),
 			HID_FEATURE_REPORT);
-	if (ret != sizeof(feature)) {
-		hid_err(hdev, "unable to request touch data (%d)\n", ret);
-		goto err_stop_hw;
-	}
+	// if (ret != sizeof(feature)) {
+		// hid_err(hdev, "unable to request touch data (%d)\n", ret);
+		// goto err_stop_hw;
+	// }
Comment 2 Jérémy Lal 2011-05-19 12:46:25 UTC
I doubt this is a bug in magicmouse driver itself, since on 2.6.38 the code is the same and used to work.
It could be a bug in hid_output_raw_report...
Other bluetooth device like my cell phone connects and provides services without troubles.
Comment 3 Jiri Kosina 2011-05-19 14:59:47 UTC
Please see thread "35022: hid-magicmouse broken" on linux-input mailinglist:

    http://www.spinics.net/lists/linux-input/index.html#15297
Comment 4 Jiri Kosina 2011-05-24 09:48:45 UTC
Fixed by commit 23746a66d7d9e73402c68ef00d708796b97ebd72 in Linus' tree.
Comment 5 Florian Mickler 2011-06-21 11:56:00 UTC
A patch referencing a commit referencing this bug report has been merged in v3.0-rc4:

commit c3a4924565e2eecf2539871abd123d35be6d76d5
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Thu Jun 16 12:21:34 2011 +0200

    Revert "HID: magicmouse: ignore 'ivalid report id' while switching modes"
Comment 6 Florian Mickler 2012-01-12 21:25:49 UTC
A patch referencing this bug report has been merged in Linux v3.1-rc10:

commit 35d851df23b093ee027f827fed2213ae5e88fc7a
Author: Jiri Kosina <jkosina@suse.cz>
Date:   Thu Aug 25 14:21:37 2011 +0200

    HID: magicmouse: ignore 'ivalid report id' while switching modes, v2