linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Nestor Lopez Casado <nlopezcasad@logitech.com>,
	Andrew de los Reyes <adlr@chromium.org>,
	joseph.salisbury@canonical.com,
	linux-input <linux-input@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] HID: hid-logitech-dj, querying_devices was never set
Date: Mon, 5 Aug 2013 16:40:42 +0200	[thread overview]
Message-ID: <CAN+gG=Hjd1Ay0=HrJdV9797DxTMf97_13kdkuHNWi24EfPL-ig@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1308051516181.17512@pobox.suse.cz>

On Mon, Aug 5, 2013 at 3:22 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> On Fri, 2 Aug 2013, Benjamin Tissoires wrote:
>
>> > Could you please elaborate? (and put an elaborate description to revert
>> > commit log perhaps?)
>>
>> Sure, so here is the revert commit log:
>>
>> --
>>
>> Commit "HID: hid-logitech-dj, querying_devices was never set" activate
>> a flag which guarantees that we do not ask the receiver for too many
>> enumeration. When the flag is set, each following enumeration call is
>> discarded (the usb request is not forwarded to the receiver). The flag
>> is then released when the driver receive a pairing information event,
>> which normally follows the enumeration request.
>> However, the USB3 bug makes the driver think the enumeration request
>> has been forwarded to the receiver. However, it is actually not the
>> case because the USB stack returns -EPIPE. So, when a new unknown
>> device appears, the workaround consisting in asking for a new
>> enumeration is not working anymore: this new enumeration is discarded
>> because of the flag, which is never reset.
>>
>> A solution could be to trigger a timeout before releasing it, but for
>> now, let's just revert the patch.
>>
>> --
>
> Thanks Benjamin.
>
> I'd like to have a bit more clarification about the USB3 bug, as this
> whole issue is not completely clear to me.
>
> To be more specific -- when exactly do we receive -EPIPE, why do we
> receive it and why do we not handle it properly?

Sure, I'll try (though the more I think of it, the more it seems
blurry to me :( ).

So the initial probe function in hid-logitech-dj was implemented by
using a direct call to hid_output_raw_report(). This call was
synchronous, so we did get the -EPIPE return code. Then, the probe()
function returns the -EPIPE error, cleaning the receiver and
unregister it from the hid bus.

However, now, we use hid_hw_request(), which is asynchronous (from
what I can read). At least, this code returns "void" as the set_report
command seems to be scheduled for later handling. In usbhid, when the
queue is flushed, I did not found a way to retrieve the error code...

So basically, the -EPIPE is received in usbhid_restart_ctrl_queue(),
but nothing notifies hid-logitech-dj from the error. In the end, the
probe() function returns without error code, but the receiver never
received the notification.

Cheers,
Benjamin

  reply	other threads:[~2013-08-05 14:40 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 [this message]
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
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=Hjd1Ay0=HrJdV9797DxTMf97_13kdkuHNWi24EfPL-ig@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=nlopezcasad@logitech.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).