Comment 55 for bug 1326725

Revision history for this message
dualshock3nerd (dualshock3nerd) wrote :

I did a manual bisect of the ubuntu trusty kernel tree and the last "good" (controller working) commit is:

commit 73ffcac5867519fa4b6a54e734ded0fed5b403cc
Author: Jiri Kosina

    HID: hidraw: make comment more accurate and nicer

The first sure "bad" (controller not working) commit I found is:

commit 6d8e891822be26ed5f376287d7c7c5988f4fe425:
Author: Frank Praznik

    HID: Add transport-driver callbacks to the hid_ll_driver struct

Between those two commits there are three more commits.
I could not test by cheking out these three commits one by one because the kernel failed to build.
Here they are:

commit c96bd945d3061dc77b640ceead6f4151983432cf
Author: Benjamin Tissoires

    HID: add inliners for ll_driver transport-layer callbacks

commit b0eff3d87fabad16aad6640703f1e5b6ff6108af
Author: Benjamin Tissoires

    HID: i2c-hid: implement ll_driver transport-layer callbacks

commit aa6c390c4d59c9ff4fffd887e15783b2b793951b
Author: Benjamin Tissoires

    HID: remove hid_get_raw_report in struct hid_device

I then tried to revert these commits in order:
c96bd945d3061dc77b640ceead6f4151983432cf
b0eff3d87fabad16aad6640703f1e5b6ff6108af
aa6c390c4d59c9ff4fffd887e15783b2b793951b

And, after rebuilding the kernel, the controller worked again.

The problem is that those commits (among many others) were pushed to fix http://bugs.launchpad.net/bugs/1305522
By doing so many heavy changes to hid were made.
This broke the hid-sony kernel driver.

After further research I found that the same author of those commits (Benjamin Tissoires) submitted a patch that supposedly fixed the issue:
https://lkml.org/lkml/2014/3/8/270

So I tried to backport that patch.

To make my life easier I fetched the latest version of these files directly from https://github.com/torvalds/linux
drivers/hid/hid-sony.c
drivers/hid/hidraw.c
drivers/hid/usbhid/hid-core.c

And added only a couple of lines to these files:
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
include/linux/hid.h

Recompiled and it worked.
I tested both dualshock 3 and dualshock 4 via usb. Both working.

If anyone would like to test it:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-trusty.git ubuntu-trusty
cp ps3-1326725.diff ubuntu-trusty
cd ubuntu-trusty
git apply ps3-1326725.diff
and recompile the kernel.

I added the patch as an attachment.

Whether to apply/rewrite/properly backport a patch like this or to revert the commits is ubuntu kernel team's choice now.
I Hope this is useful.

Please don't make me recompile the kernel another 20+ times. :)