<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/hid/progs/hid.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-11-25T17:21:47Z</updated>
<entry>
<title>Revert "HID: bpf: allow write access to quirks field in struct hid_device"</title>
<updated>2024-11-25T17:21:47Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-11-25T17:21:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=919464deeca24e5bf13b6c8efd0b1d25cc43866f'/>
<id>urn:sha1:919464deeca24e5bf13b6c8efd0b1d25cc43866f</id>
<content type='text'>
This reverts commit 6fd47effe92b, and the related self-test update
commit e14e0eaeb040 ("selftests/hid: add test for assigning a given
device to hid-generic").

It results in things like the scroll wheel on Logitech mice not working
after a reboot due to the kernel being confused about the state of the
high-resolution mode.

Quoting Benjamin Tissoires:
 "The idea of 6fd47effe92b was to be able to call hid_bpf_rdesc_fixup()
  once per reprobe of the device.

  However, because the bpf filter can now change the quirk value, the
  call had to be moved before the driver gets bound (which was
  previously ensuring the unicity of the call).

  The net effect is that now, in the case hid-generic gets loaded first
  and then the specific driver gets loaded once the disk is available,
  the value of -&gt;quirks is not reset, but kept to the value that was set
  by hid-generic (HID_QUIRK_INPUT_PER_APP).

  Once hid-logitech-hidpp kicks in, that quirk is now set, which creates
  two inputs for the single mouse: one keyboard for fancy shortcuts, and
  one mouse node.

  However, hid-logitech-hidpp expects only one input node to be attached
  (it stores it into hidpp-&gt;input), and when a wheel event is received,
  because there is some processing with high-resolution wheel events,
  the wheel event is injected into hidpp-&gt;input.

  And of course, when HID_QUIRK_INPUT_PER_APP is set, hidpp-&gt;input gets
  the keyboard node, which doesn't have wheel event type, and the events
  are ignored"

Reported-and-bisected-by: Mike Galbraith &lt;efault@gmx.de&gt;
Link: https://lore.kernel.org/all/CAHk-=wiUkQM3uheit2cNM0Y0OOY5qqspJgC8LkmOkJ2p2LDxcw@mail.gmail.com/
Acked-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add test for assigning a given device to hid-generic</title>
<updated>2024-10-04T14:10:49Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-10-01T14:30:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e14e0eaeb040899f7cb363cdfdf8fbee84a45f08'/>
<id>urn:sha1:e14e0eaeb040899f7cb363cdfdf8fbee84a45f08</id>
<content type='text'>
We use a well known VID/PID on a driver that doesn't need to talk to
the device, ensures we created the device against the target driver,
then load our program and ensure we have unbound to this driver and use
hid-generic instead.

Reviewed-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Acked-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Link: https://patch.msgid.link/20241001-hid-bpf-hid-generic-v3-9-2ef1019468df@kernel.org
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: fix bpf_wq new API</title>
<updated>2024-07-24T16:27:21Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-07-23T16:21:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff9fbcafbaf13346c742c0d672a22f5ac20b9d92'/>
<id>urn:sha1:ff9fbcafbaf13346c742c0d672a22f5ac20b9d92</id>
<content type='text'>
Since commit f56f4d541eab ("bpf: helpers: fix bpf_wq_set_callback_impl
signature"), the API for bpf_wq changed a bit.

We need to update the selftests/hid code to reflect that or the
bpf program will not load.

Link: https://patch.msgid.link/20240723-fix-6-11-bpf-v1-1-b9d770346784@kernel.org
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add an infinite loop test for hid_bpf_try_input_report</title>
<updated>2024-06-27T09:00:49Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-26T13:46:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d3e15189bfd4d0a9d3a7ad8bd0e6ebb1c0419f93'/>
<id>urn:sha1:d3e15189bfd4d0a9d3a7ad8bd0e6ebb1c0419f93</id>
<content type='text'>
We don't want this call to allow an infinite loop in HID-BPF, so let's
have some tests.

Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-13-cfd60fb6c79f@kernel.org
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add another test for injecting an event from an event hook</title>
<updated>2024-06-27T09:00:49Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-26T13:46:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=62f2e1a096cd4380eca7e55fa4369d50a8536ab8'/>
<id>urn:sha1:62f2e1a096cd4380eca7e55fa4369d50a8536ab8</id>
<content type='text'>
Similar to test_multiply_events_wq: we receive one event and inject a
new one. But given that this time we are already in the event hook, we
can use hid_bpf_try_input_report() directly as this function will not
sleep.

Note that the injected event gets processed before the original one this
way.

Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-12-cfd60fb6c79f@kernel.org
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add wq test for hid_bpf_input_report()</title>
<updated>2024-06-27T09:00:48Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-26T13:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fe8d561db3e82a1130c59ebc143d557b0bdb0cff'/>
<id>urn:sha1:fe8d561db3e82a1130c59ebc143d557b0bdb0cff</id>
<content type='text'>
Now that bpf_wq is available, we can write a test with it. Having
hid_bpf_input_report() waiting for the device means that we can
directly call it, and we get that event when the device is ready.

Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-10-cfd60fb6c79f@kernel.org
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add tests for hid_hw_output_report HID-BPF hooks</title>
<updated>2024-06-27T09:00:48Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-26T13:46:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ac83fcd6e67c86d25040e6818972f2c36b51d23'/>
<id>urn:sha1:3ac83fcd6e67c86d25040e6818972f2c36b51d23</id>
<content type='text'>
We add 3 new tests:
- first, we make sure we can prevent the output_report to happen
- second, we make sure that we can detect that a given hidraw client
  was actually doing the request, and for that client only, call ourself
  hid_bpf_hw_output_report(), returning a custom value
- last, we ensure that we can not loop between hooks for
  hid_hw_output_report() and manual calls to hid_bpf_hw_output_report()
  from that same hook

Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-8-cfd60fb6c79f@kernel.org
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add tests for hid_hw_raw_request HID-BPF hooks</title>
<updated>2024-06-27T09:00:12Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-26T13:46:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=015a4a2a439b285943da471d38b2721bbe4d8b39'/>
<id>urn:sha1:015a4a2a439b285943da471d38b2721bbe4d8b39</id>
<content type='text'>
We add 3 new tests:
- first, we make sure we can prevent the raw_request to happen
- second, we make sure that we can detect that a given hidraw client
  was actually doing the request, and for that client only, call ourself
  hid_bpf_hw_request(), returning a custom value
- last, we ensure that we can not loop between hooks for
  hid_hw_raw_request() and manual calls to hid_bpf_hw_request() from that
  hook

Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-6-cfd60fb6c79f@kernel.org
Acked-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: add subprog call test</title>
<updated>2024-06-14T09:20:20Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-08T09:01:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=05b3b8f19441b6bf039cec1990de3c75bb9dbbd9'/>
<id>urn:sha1:05b3b8f19441b6bf039cec1990de3c75bb9dbbd9</id>
<content type='text'>
I got a weird verifier error with a subprog once, so let's have a test
for it.

Link: https://lore.kernel.org/r/20240608-hid_bpf_struct_ops-v3-9-6ac6ade58329@kernel.org
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/hid: convert the hid_bpf selftests with struct_ops</title>
<updated>2024-06-14T09:20:19Z</updated>
<author>
<name>Benjamin Tissoires</name>
</author>
<published>2024-06-08T09:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7696738d66b4f1379fe77eef61cd1047d7f0773'/>
<id>urn:sha1:d7696738d66b4f1379fe77eef61cd1047d7f0773</id>
<content type='text'>
We drop the need for the attach() bpf syscall, but we need to set up
the hid_id field before calling __load().

The .bpf.c part is mechanical: we create one struct_ops per HID-BPF
program, as all the tests are for one program at a time.

Link: https://lore.kernel.org/r/20240608-hid_bpf_struct_ops-v3-4-6ac6ade58329@kernel.org
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
</feed>
