From: Hans de Goede <hdegoede@redhat.com>
To: "Filipe Laíns" <lains@archlinux.org>,
linux-input <linux-input@vger.kernel.org>
Cc: Benjamin Tissoires <btissoir@redhat.com>,
Peter Hutterer <peter.hutterer@redhat.com>,
Nestor Lopez Casado <nlopezcasad@logitech.com>,
Jiri Kosina <jikos@kernel.org>,
Bastien Nocera <hadess@hadess.net>,
Julien Hartmann <juli1.hartmann@gmail.com>
Subject: Re: Make the hid-logitech-dj driver remove the HID++ nodes when the device disconnects
Date: Thu, 6 Feb 2020 12:30:31 +0100 [thread overview]
Message-ID: <f2997fc7-1f34-79d3-f0aa-8367ed09f473@redhat.com> (raw)
In-Reply-To: <451e552444483c52a038d3d14391611f897582f4.camel@archlinux.org>
HI,
On 2/6/20 12:14 PM, Filipe Laíns wrote:
> Hello,
>
> Right now the hid-logitech-dj driver will export one node for each
> connected device, even when the device is not connected. That causes
> some trouble because in userspace we don't have have any way to know if
> the device is connected or not, so when we try to communicate, if the
> device is disconnected it will fail.
I'm a bit reluctant to make significant changes to how the
hid-logitech-dj driver works. We have seen a number of regressions
when it was changed to handle the non unifying receivers and I would
like to avoid more regressions.
Some questions:
1. What is the specific use case where you are hitting this?
2. Can't the userspace tools involved by modified to handle the errors
they are getting gracefully?
3. Is there a bugreport open about this somewhere?
> The reason we do this is because otherwise we would loose the first
> packets when the device is turned on by key press. When a device is
> turned on we would have to create the device node, and the packets
> received while we are creating the device node would be lost.
I don't believe that this is the reason, we only create hid child
devices for devices reported by the receiver, but some of the non
unifying hid receiver send a list of all devices paired, rather
then the ones which are actually connected at that time.
> This could solved by buffering those packets, but that is a bad solution as
> it would mess up the timings.
>
> At the moment the created node includes both normal HID and vendor
> usages. To solve this problem, I propose that instead of creating a
> single device node that contains all usages, we create one for normal
> HID, which would exist all the time, and one for the vendor usage,
> which would go away when the device disconnects. >
> This slight behavior change will affect userspace. Two hidraw nodes
> would be created instead of one. We need to make sure the current
> userspace stacks interfacing with this would be able to properly handle
> such changes.
>
> What do you think of this approach? Anyone has a better idea?
The suggested approach sounds fragile and like it adds complexity to
an already not simple driver.
It would be helpful to first describe the actual problem you are trying
to fix (rather then suggesting a solution without clearly defining the
problem) and then we can see from there.
Regards,
Hans
next prev parent reply other threads:[~2020-02-06 11:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-06 11:14 Make the hid-logitech-dj driver remove the HID++ nodes when the device disconnects Filipe Laíns
2020-02-06 11:30 ` Hans de Goede [this message]
2020-02-06 11:51 ` Filipe Laíns
2020-02-06 12:13 ` Hans de Goede
2020-02-06 15:42 ` Filipe Laíns
2020-02-06 17:01 ` Benjamin Tissoires
2020-02-06 17:45 ` Hans de Goede
2020-02-06 18:43 ` Filipe Laíns
2020-02-06 19:02 ` Hans de Goede
2020-02-06 19:43 ` Filipe Laíns
2020-02-13 15:07 ` Benjamin Tissoires
2020-02-13 15:52 ` Hans de Goede
2020-02-07 0:03 ` Peter Hutterer
2020-02-07 0:36 ` Filipe Laíns
2020-02-13 15:12 ` Benjamin Tissoires
2020-02-13 15:24 ` Filipe Laíns
2020-02-13 16:10 ` Benjamin Tissoires
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=f2997fc7-1f34-79d3-f0aa-8367ed09f473@redhat.com \
--to=hdegoede@redhat.com \
--cc=btissoir@redhat.com \
--cc=hadess@hadess.net \
--cc=jikos@kernel.org \
--cc=juli1.hartmann@gmail.com \
--cc=lains@archlinux.org \
--cc=linux-input@vger.kernel.org \
--cc=nlopezcasad@logitech.com \
--cc=peter.hutterer@redhat.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).