linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	joseph.salisbury@canonical.com,
	Nestor Lopez Casado <nlopezcasad@logitech.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Andrew de los Reyes <adlr@chromium.org>,
	linux-input <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-usb@vger.kernel.org, wujun zhou <zwj.echo@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 1/2] Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue""
Date: Fri, 19 Jul 2013 10:35:57 +0200	[thread overview]
Message-ID: <CAN+gG=HKe0eNBmwaf=h6nzR9U3DPC-Hvb1W-uwVqjih5AiKUuQ@mail.gmail.com> (raw)
In-Reply-To: <51E87C1F.1090301@hurleysoftware.com>

Hi Peter,

thanks for forwarding this to the appropriate people & mailing list.

Hi Sarah,

thanks for starting investigating this :)

On Fri, Jul 19, 2013 at 1:37 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
>>>
>>>
>>>
>>> Before we revert to using the workaround, I'd like to suggest that
>>> this new "hidden" problem may be an interaction with the xhci_hcd host
>>> controller driver only.
>>>
>>> Looking at the related bug, the OP indicates the machine only has
>>> USB3 ports. Additionally, comments #7, #100, and #104 of the original
>>> bug report [1] add additional information that would seem to confirm
>>> this suspicion.

Definitively, this is a USB3 problem. However, it is not generic (I
can not reproduce it with my USB3 boards.)

>>
>>
>> Question: does this USB device need a control transfer to reset its
>> endpoints when the endpoints are not actually halted?  If so, yes, that
>> is a known xHCI driver bug that needs to be fixed.  The xHCI host will
>> not accept a Reset Endpoint command when the endpoints are not actually
>> halted, but the USB core will send the control transfer to reset the
>> endpoint.  That means the device and host toggles will be out of sync,
>> and all messages will start to fail with -EPIPE.
>>
>> Can the OP capture a usbmon trace when the device starts failing?  That
>> will reveal whether this actually is the issue.  dmesg output with
>> CONFIG_USB_DEBUG and CONFIG_USB_XHCI_HCD_DEBUGGING turned on would also
>> be helpful.
>

Here is another linux-input thread were you have the usbmon traces:
http://www.spinics.net/lists/linux-input/msg26542.html
Wujun Zhou already did one test of a kernel patch for me (which did
not solve the problem, because I was not at the USB level), so I bet
he will be able to do some testings for you.

In the logs he posted (logitech_work.pcapng.gz), the interesting part
is starting from the capture #45:

#45: SET_REPORT request to switch the receiver to the "DJ" mode (the
receiver stops sending regular HID events, but goes into its
proprietary protocol)
#47: SET_REPORT response -> all good
#48: SET_REPORT request to ask the receiver to enumerate all of his
devices (it is called right after we received the previous response)
#49: SET_REPORT response -> -EPIPE
#50: URB_INTERRUPT_IN (~3 seconds later) -> the device is working normally

The weird thing is that only the first enumeration message failed with
-EPIPE: the device answers later control transfer correctly (#54 /
#55).

>
> Sarah,
>
> I forwarded your usbmon capture request to the OP in the bug report
> (I don't have an email address for the reporter).
>

Here are some other helpful information:
the first "fix" we have done is dcd9006b1b053c7b1c. It is linked to
several bugs:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1072082
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1039143
https://bugzilla.redhat.com/show_bug.cgi?id=840391
https://bugzilla.kernel.org/show_bug.cgi?id=49781

Most of them are people complaining, but in one of the comments,
adding a 500ms wait between the two control transfer (switch to DJ +
enumerate) fixed the -EPIPE problem. I interpreted it as a scheduled
problem (using direct call to usb_control_msg() vs use the scheduled
one usbhid_submit_message()) but it was just delaying the problem out
of the probe. Unfortunately, I missed that as I did not asked for the
usbmon traces at that time.

One last thing, I understood that Linus is also experiencing this
problem... Adding him in CC to let him know of the progress.

Cheers,
Benjamin

  reply	other threads:[~2013-07-19  8:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 13:21 [PATCH 1/2] Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue"" Nestor Lopez Casado
2013-07-18 13:21 ` [PATCH 2/2] HID: hid-logitech-dj, querying_devices was never set Nestor Lopez Casado
2013-08-01 10:09   ` Benjamin Tissoires
2013-08-02  1:11     ` Jiri Kosina
2013-08-02 18:31       ` Benjamin Tissoires
2013-08-05 13:22         ` Jiri Kosina
2013-08-05 14:40           ` Benjamin Tissoires
2013-08-06 21:03             ` Sune Mølgaard
2013-08-09  9:36               ` Jiri Kosina
2013-08-10 17:21               ` Jiri Kosina
2013-07-18 20:28 ` [PATCH 1/2] Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue"" Peter Hurley
2013-07-18 22:09   ` Sarah Sharp
2013-07-18 23:37     ` Peter Hurley
2013-07-19  8:35       ` Benjamin Tissoires [this message]
2013-07-19 14:38       ` Joseph Salisbury
2013-07-19 21:31         ` Peter Hurley
2013-07-22 11:44           ` Jiri Kosina
2013-07-22 14:03             ` Peter Hurley
2013-07-22 15:27               ` Alan Stern
2013-07-19 15:14     ` Alan Stern
2013-07-19 16:43     ` Nestor Lopez Casado
2013-08-12 21:54   ` Peter Wu
2013-08-13 12:13     ` Peter Hurley
2013-08-13 15:42       ` Peter Wu
2013-08-13 16:34         ` Peter Hurley
2013-07-22 14:35 ` Jiri Kosina
2013-07-22 19:21   ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN+gG=HKe0eNBmwaf=h6nzR9U3DPC-Hvb1W-uwVqjih5AiKUuQ@mail.gmail.com' \
    --to=benjamin.tissoires@gmail.com \
    --cc=adlr@chromium.org \
    --cc=jkosina@suse.cz \
    --cc=joseph.salisbury@canonical.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nlopezcasad@logitech.com \
    --cc=peter@hurleysoftware.com \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=zwj.echo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).