summaryrefslogtreecommitdiff
path: root/drivers/hid/bpf
diff options
context:
space:
mode:
authorBenjamin Tissoires <bentiss@kernel.org>2024-03-15 17:44:44 +0300
committerBenjamin Tissoires <bentiss@kernel.org>2024-04-10 17:38:37 +0300
commit685dadafbde29dc3d6b7a13be284d684b06d4d4f (patch)
treea3c3ea15f7998a7c241e8d8a8561e94f4e9a52bf /drivers/hid/bpf
parent2c0e8ced7d4bf746923fc424415844d695f07808 (diff)
downloadlinux-685dadafbde29dc3d6b7a13be284d684b06d4d4f.tar.xz
HID: bpf: allow to use bpf_timer_set_sleepable_cb() in tracing callbacks.
Export the sleepable kfuncs we have on HID-BPF in tracing bpf programs, but with the condition of being used in a sleepable context. This allows to use the bpf_timer when used in a sleepable context through bpf_timer_set_sleepable_cb() and initiate work from a device event. Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-7-079c282469d3@kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Diffstat (limited to 'drivers/hid/bpf')
-rw-r--r--drivers/hid/bpf/hid_bpf_dispatch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hid/bpf/hid_bpf_dispatch.c b/drivers/hid/bpf/hid_bpf_dispatch.c
index 83e5c73ce995..79ece3d1b9e2 100644
--- a/drivers/hid/bpf/hid_bpf_dispatch.c
+++ b/drivers/hid/bpf/hid_bpf_dispatch.c
@@ -544,6 +544,11 @@ __bpf_kfunc_end_defs();
*/
BTF_KFUNCS_START(hid_bpf_kfunc_ids)
BTF_ID_FLAGS(func, hid_bpf_get_data, KF_RET_NULL)
+BTF_ID_FLAGS(func, hid_bpf_allocate_context, KF_ACQUIRE | KF_RET_NULL | KF_SLEEPABLE)
+BTF_ID_FLAGS(func, hid_bpf_release_context, KF_RELEASE | KF_SLEEPABLE)
+BTF_ID_FLAGS(func, hid_bpf_hw_request, KF_SLEEPABLE)
+BTF_ID_FLAGS(func, hid_bpf_hw_output_report, KF_SLEEPABLE)
+BTF_ID_FLAGS(func, hid_bpf_input_report, KF_SLEEPABLE)
BTF_KFUNCS_END(hid_bpf_kfunc_ids)
static const struct btf_kfunc_id_set hid_bpf_kfunc_set = {