Repository navigation
hid-ayaneo: sync to the upstream v3 state - #11
matmartinez wants to merge 6 commits into
Conversation
The teardown use-after-free fix from v2 is already in the tree; bring over the rest of that round: - bail out of the eject polling loop on fatal command errors instead of burning the full 8s budget; only -ETIMEDOUT keeps polling, since the device goes mute mid-eject - guard the vendor-interface match with hdev->maxcollection so a descriptor with no collections cannot dereference hdev->collection - stop writing the joystick-sensitivity bytes in the config command; leaving them zero preserves the firmware setting instead of clobbering it on every RGB update (verified on hardware) - expose the firmware's fixed breathing effect through the ledtrig-pattern hw_pattern ABI as the two-step pattern "0 <t> <brightness> <t>"; the period is firmware-controlled - document why matching replies by subcommand echo alone is safe Matches the driver as submitted upstream in lore.kernel.org/linux-input/20260824223103.93947-1-hello@matias.me; re-validated on an AYANEO 3. Signed-off-by: Matías Martínez <hello@matias.me>
Replace the bare msleep/loop-bound literals with named constants and a comment recording where the timings come from (the Handheld Daemon implementation of this protocol) and what was validated on hardware. Signed-off-by: Matías Martínez <hello@matias.me>
Keep entry points and driver structure generic so a future device or protocol revision slots in without churn. Wire-protocol constants stay AYA3_* since they are specific to this firmware generation. Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Matías Martínez <hello@matias.me>
Replace the byte-offset defines with packed aya3_config/aya3_resp structs (hid-lenovo-go idiom), static_assert their sizes against the report sizes, and name every firmware vibration level in an enum instead of a lone default define. Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Matías Martínez <hello@matias.me>
Use scoped_cond_guard(mutex_intr, ...) at every interruptible lock site so the unlock cannot be dropped in a future edit. Probe already used scoped_guard. Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Matías Martínez <hello@matias.me>
Lets userspace detect the RGB interface generically, same as hid-msi, hid-oxp and hid-lenovo-go. Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Matías Martínez <hello@matias.me>
pastaq
left a comment
There was a problem hiding this comment.
Since at least one version has been sent to LKML, the regular kernel is more appropriate for these patches. Unstable is generally for not reviewed and not submitted patches as a pre-screen before upstreaming, and for making it easier for users to test before it is upstreamed.
When pulling into the stable kernel, use b4 am -cl <url> to pull in the patches with the ML link, then use git rebase -i <sha> to edit the commit message for each patch and add a preceding [FROM-ML] to the header.
Thanks.
|
@matmartinez, following pastaq's request in
Both named module variants compile with W=1 against the test kernel's 7.2.4 InputPlumber #734 and OGUI #552 are now drafts; the default path will exclude Which v4 base/branch would you like the effect/lifecycle delta reconciled against This coordination note and the local revision were prepared with Codex GPT-6 |
KaFai Wan says: ==================== selftests/bpf: Fix prog_tests framework self-tests Three prog_tests framework self-tests fail depending on how test_progs is invoked: - ./test_progs -t prog_tests_framework/test_fail -v test_prog_tests_framework:FAIL:skip_cnt_check unexpected skip_cnt_check: actual 0 != expected 2 - ./test_progs -t prog_tests_framework_expected_msgs -v Caught signal #11! Stack trace: ./test_progs(crash_handler+0x38)[0x55620006fbb0] - ./test_progs -t prog_tests_framework_compare_text -v test_prog_tests_framework_compare_text:PASS:mismatch_rc 0 nsec Caught signal #11! Stack trace: ./test_progs(crash_handler+0x38)[0x564ddbfcfbb0] Patch #1 counts the subtests that actually ran, so the skip and error count checks no longer fail when -t or -n filters out some subtests. Patches #2 and #3 skip the subtests that inspect the log buffer when the output is not captured, such as with -v in non-parallel mode, instead of crashing on a NULL log_buf. --- ==================== Link: https://patch.msgid.link/20261012140202.2754552-1-kafai.wan@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
The perf_hpp_list was not freed after use. Let's add it for the main
c2c hists list in perf c2c report and a local list in print_pareto().
Previously it was detected by ASAN like below.
=================================================================
==42183==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 1064 byte(s) in 7 object(s) allocated from:
#0 0x7f17334ef24f in calloc (/lib64/libasan.so.8+0xef24f) (BuildId: 61e8165ca90f7a4f06b73f064a938c76deaae079)
OpenGamingCollective#1 0x0000005fa099 in zalloc ../../lib/zalloc.c:8
OpenGamingCollective#2 0x0000004faf6d in get_format tools/perf/builtin-c2c.c:1978
OpenGamingCollective#3 0x0000004fb45e in c2c_hists__init_output tools/perf/builtin-c2c.c:2004
OpenGamingCollective#4 0x0000004fb7de in __hpp_list__parse tools/perf/builtin-c2c.c:2047
OpenGamingCollective#5 0x0000004fbae9 in hpp_list__parse tools/perf/builtin-c2c.c:2085
OpenGamingCollective#6 0x0000004fee13 in print_pareto tools/perf/builtin-c2c.c:2563
OpenGamingCollective#7 0x0000004ffcd7 in perf_c2c__hists_fprintf tools/perf/builtin-c2c.c:2708
OpenGamingCollective#8 0x000000500ab5 in perf_c2c_display tools/perf/builtin-c2c.c:2949
OpenGamingCollective#9 0x0000005045c3 in perf_c2c__report tools/perf/builtin-c2c.c:3522
OpenGamingCollective#10 0x000000505caa in cmd_c2c tools/perf/builtin-c2c.c:3676
OpenGamingCollective#11 0x0000005df50e in run_builtin tools/perf/perf.c:383
OpenGamingCollective#12 0x0000005df9b1 in handle_internal_command tools/perf/perf.c:436
OpenGamingCollective#13 0x0000005dfd7f in run_argv tools/perf/perf.c:480
OpenGamingCollective#14 0x0000005e02d6 in main tools/perf/perf.c:581
OpenGamingCollective#15 0x7f1729450680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 85075e2ae2e13352a1413d41c327dacf6461526c)
OpenGamingCollective#16 0x7f1729450797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 85075e2ae2e13352a1413d41c327dacf6461526c)
OpenGamingCollective#17 0x000000409c34 in _start (tools/perf/perf+0x409c34) (BuildId: 36a64600776d92e4ab7dfd5ca20c92280d72a645)
SUMMARY: AddressSanitizer: 1064 byte(s) leaked in 7 allocation(s).
Fixes: c75540e ("perf c2c report: Add dimension support")
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Dmitry Ilvokhin <d@ilvokhin.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
The perf_hpp_list was not freed after use. Let's add it for the main
c2c hists list in perf c2c report and a local list in print_pareto().
Previously it was detected by ASAN like below.
=================================================================
==42183==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 1064 byte(s) in 7 object(s) allocated from:
#0 0x7f17334ef24f in calloc (/lib64/libasan.so.8+0xef24f) (BuildId: 61e8165ca90f7a4f06b73f064a938c76deaae079)
OpenGamingCollective#1 0x0000005fa099 in zalloc ../../lib/zalloc.c:8
OpenGamingCollective#2 0x0000004faf6d in get_format tools/perf/builtin-c2c.c:1978
OpenGamingCollective#3 0x0000004fb45e in c2c_hists__init_output tools/perf/builtin-c2c.c:2004
OpenGamingCollective#4 0x0000004fb7de in __hpp_list__parse tools/perf/builtin-c2c.c:2047
OpenGamingCollective#5 0x0000004fbae9 in hpp_list__parse tools/perf/builtin-c2c.c:2085
OpenGamingCollective#6 0x0000004fee13 in print_pareto tools/perf/builtin-c2c.c:2563
OpenGamingCollective#7 0x0000004ffcd7 in perf_c2c__hists_fprintf tools/perf/builtin-c2c.c:2708
OpenGamingCollective#8 0x000000500ab5 in perf_c2c_display tools/perf/builtin-c2c.c:2949
OpenGamingCollective#9 0x0000005045c3 in perf_c2c__report tools/perf/builtin-c2c.c:3522
OpenGamingCollective#10 0x000000505caa in cmd_c2c tools/perf/builtin-c2c.c:3676
OpenGamingCollective#11 0x0000005df50e in run_builtin tools/perf/perf.c:383
OpenGamingCollective#12 0x0000005df9b1 in handle_internal_command tools/perf/perf.c:436
OpenGamingCollective#13 0x0000005dfd7f in run_argv tools/perf/perf.c:480
OpenGamingCollective#14 0x0000005e02d6 in main tools/perf/perf.c:581
OpenGamingCollective#15 0x7f1729450680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 85075e2ae2e13352a1413d41c327dacf6461526c)
OpenGamingCollective#16 0x7f1729450797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 85075e2ae2e13352a1413d41c327dacf6461526c)
OpenGamingCollective#17 0x000000409c34 in _start (tools/perf/perf+0x409c34) (BuildId: 36a64600776d92e4ab7dfd5ca20c92280d72a645)
SUMMARY: AddressSanitizer: 1064 byte(s) leaked in 7 allocation(s).
Fixes: c75540e ("perf c2c report: Add dimension support")
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Reviewed-by: Dmitry Ilvokhin <d@ilvokhin.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
An IPTFS state keeps its mode module referenced while mode_data exists.
However, iptfs_destroy_state() drops that reference before returning to
xfrm_state_gc_destroy(), which has no reference covering the callback's
return path.
With CONFIG_XFRM_IPTFS=m and module unloading enabled, deleting the last
IPTFS SA can overlap with ordinary module removal in this order:
XFRM GC worker rmmod xfrm_iptfs
iptfs_destroy_state()
free mode_data
module_put(owner)
<preempted>
delete_module()
xfrm_iptfs_fini()
unregister mode callbacks
free_module()
resume in freed module text
An unload started after the put can finish before the callback resumes.
GC invokes the callback outside an RCU read-side critical section, after
its grace period. The RCU waits in mode unregistration and module
freeing therefore do not protect the callback. The GC mutex only
serializes GC with device state flushes. Resuming the callback can cause
an instruction-fetch fault in the freed module text.
The Oops below was observed on an earlier kernel with scheduling probes
holding the worker in module_put() after the decrement until ordinary
rmmod completed. The fixture created and deleted the SA over
NETLINK_XFRM.
Take an additional reference to the already pinned owner before calling
destroy_state(), and release it in XFRM core after the callback returns.
Cache the owner before the call so releasing the extra reference does
not need to access the callback table after the callback has finished.
Oops report as below:
BUG: unable to handle page fault for address: ffffffffc0407455
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 80a9067 P4D 80a9067 PUD 80ab067 PMD 0
Oops: Oops: 0010 [OpenGamingCollective#1] SMP KASAN NOPTI
CPU: 3 UID: 0 PID: 53 Comm: kworker/3:1 Not tainted 7.2.0-rc5-pmb-xfrm-functional-v1+ OpenGamingCollective#11 PREEMPT(lazy)
Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Workqueue: events xfrm_state_gc_task
RIP: 0010:0xffffffffc0407455
Code: Unable to access opcode bytes at 0xffffffffc040742b.
RSP: 0018:ffff8881013e7aa0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffffffffc02199c0 RCX: ffffffff816fc84e
RDX: ffff8881013c0000 RSI: 0000000000000000 RDI: ffffffff86338344
RBP: ffff8881013e7ba8 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff893e0257 R11: ffff8881013c0000 R12: ffff888107e9ec00
R13: ffff888102b07980 R14: ffff888107412ec0 R15: ffff8881013e7ae0
FS: 0000000000000000(0000) GS:ffff8881fd929000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffc040742b CR3: 00000000080a6006 CR4: 0000000000770ef0
PKRU: 55555554
Call Trace:
<TASK>
? pmbd_gate_maybe+0x47/0x60
? srso_alias_return_thunk+0x5/0xfbef5
? srso_alias_return_thunk+0x5/0xfbef5
? lock_is_held_type+0x8f/0x100
xfrm_state_gc_task+0x17e/0x790
? lock_acquire+0x17b/0x2f0
? __pfx_xfrm_state_gc_task+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? lock_release+0xc8/0x280
? srso_alias_return_thunk+0x5/0xfbef5
process_one_work+0x908/0x19c0
? __pfx_process_one_work+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? lock_is_held_type+0x8f/0x100
? srso_alias_return_thunk+0x5/0xfbef5
worker_thread+0x65c/0xe40
? srso_alias_return_thunk+0x5/0xfbef5
? __kthread_parkme+0x175/0x220
? srso_alias_return_thunk+0x5/0xfbef5
? __pfx_worker_thread+0x10/0x10
kthread+0x34f/0x460
? srso_alias_return_thunk+0x5/0xfbef5
? __pfx_kthread+0x10/0x10
ret_from_fork+0x659/0x940
? __pfx_ret_from_fork+0x10/0x10
? srso_alias_return_thunk+0x5/0xfbef5
? __switch_to+0x74f/0xf80
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1a/0x30
</TASK>
Modules linked in: [last unloaded: xfrm_iptfs]
CR2: ffffffffc0407455
---[ end trace 0000000000000000 ]---
RIP: 0010:0xffffffffc0407455
Code: Unable to access opcode bytes at 0xffffffffc040742b.
RSP: 0018:ffff8881013e7aa0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffffffffc02199c0 RCX: ffffffff816fc84e
RDX: ffff8881013c0000 RSI: 0000000000000000 RDI: ffffffff86338344
RBP: ffff8881013e7ba8 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff893e0257 R11: ffff8881013c0000 R12: ffff888107e9ec00
R13: ffff888102b07980 R14: ffff888107412ec0 R15: ffff8881013e7ae0
FS: 0000000000000000(0000) GS:ffff8881fd929000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffc040742b CR3: 00000000080a6006 CR4: 0000000000770ef0
PKRU: 55555554
Kernel panic - not syncing: Fatal exception
Kernel Offset: disabled
Fixes: 4b3faf6 ("xfrm: iptfs: add new iptfs xfrm mode impl")
Signed-off-by: Cen Zhang <zzzccc427@gmail.com>
Assisted-by: LLM
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) OpenGamingCollective#11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
BPF program freeing currently runs from the system workqueue. With BPF program pack allocations, freeing the last program in a pack can take pack_mutex and call into execmem/vmalloc code to change page permissions. That path may queue a vmalloc purge helper to the same CPU and wait for it to finish. If enough other BPF program free workers are already active on that CPU, they can all block on pack_mutex and consume the system workqueue active slots. The worker holding pack_mutex then waits for the vmalloc purge work, but that purge work cannot run because the queue is full of pack_mutex waiters: [ 24.646667] INFO: task kworker/0:4:1291 blocked for more than 10 seconds. [ 24.646669] Not tainted 7.3.0-00001-gdeaa120a9b25-dirty #11 [ 24.646670] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 24.646671] task:kworker/0:4 state:D stack:0 pid:1291 tgid:1291 ppid:2 task_flags:0x4208060 flags:0x00080000 [ 24.646675] Workqueue: events bpf_prog_free_deferred [ 24.646678] Call Trace: [ 24.646680] <TASK> [ 24.646686] __schedule+0x5bc/0x1430 [ 24.646702] schedule+0x3f/0x100 [ 24.646706] schedule_timeout+0x106/0x110 [ 24.646711] ? srso_alias_return_thunk+0x5/0xfbef5 [ 24.646713] ? mark_held_locks+0x49/0x80 [ 24.646720] ? srso_alias_return_thunk+0x5/0xfbef5 [ 24.646723] ? lockdep_hardirqs_on_prepare+0xdc/0x190 [ 24.646726] ? srso_alias_return_thunk+0x5/0xfbef5 [ 24.646732] __wait_for_common+0xc1/0x1d0 [ 24.646735] ? __pfx_schedule_timeout+0x10/0x10 [ 24.646748] ? __flush_work+0x1f8/0x550 [ 24.646751] __flush_work+0x309/0x550 [ 24.646759] ? __pfx_wq_barrier_func+0x10/0x10 [ 24.646783] __purge_vmap_area_lazy+0x3e4/0x440 [ 24.646796] _vm_unmap_aliases+0x2d5/0x330 [ 24.646810] change_page_attr_set_clr+0xb9/0x580 [ 24.646817] ? srso_alias_return_thunk+0x5/0xfbef5 [ 24.646833] set_memory_nx+0x3b/0x50 [ 24.646838] __execmem_cache_free+0x35/0xb0 [ 24.646848] execmem_free+0x98/0x160 [ 24.646864] bpf_prog_pack_free+0x152/0x190 [ 24.646871] bpf_jit_binary_pack_free+0x17/0x90 [ 24.646876] bpf_jit_free+0x5e/0x130 [ 24.646882] process_one_work+0x289/0x790 [ 24.646886] ? srso_alias_return_thunk+0x5/0xfbef5 [ 24.646888] ? srso_alias_return_thunk+0x5/0xfbef5 [ 24.646902] worker_thread+0x1b3/0x370 [ 24.646908] ? __pfx_worker_thread+0x10/0x10 [ 24.646911] kthread+0xf7/0x130 [ 24.646914] ? __pfx_kthread+0x10/0x10 [ 24.646920] ret_from_fork+0x293/0x300 [ 24.646923] ? __pfx_kthread+0x10/0x10 [ 24.646927] ret_from_fork_asm+0x1a/0x30 [ 24.646947] </TASK> Move deferred freeing of BPF programs, program images, and trampoline images to a dedicated workqueue to avoid this deadlock. Fixes: 7221066 ("mm: vmalloc: offload free_vmap_area_lock lock") Reported-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261109181610.7027-1-emil@etsalapatis.com
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com>
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://lore.kernel.org/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Andi Shyti <andi.shyti@kernel.org> Cc: Andi Shyti <andi.shyti@linux.intel.com> scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+)
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://patch.msgid.link/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Andi Shyti <andi.shyti@kernel.org> scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+)
The kernel provides the __nonnull_args() macro as the preferred form for marking pointer arguments as non-NULL. Add a check suggesting the macro over the raw __attribute__((nonnull)) spelling, consistent with the existing attribute conversion suggestions. Examples: WARNING: Prefer __nonnull_args(1, 2) over __attribute__((nonnull(1, 2))) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:230: +__attribute__((nonnull(1, 2))) WARNING: Prefer __nonnull_args() over __attribute__((nonnull)) #11: FILE: drivers/soc/aspeed/aspeed-lpc-snoop.c:283: +__attribute__((nonnull)) Link: https://patch.msgid.link/bc2cd702455e58feb777cdb230e3ba4f7e1db60f.1793027261.git.d@ilvokhin.com Signed-off-by: Dmitry Ilvokhin <d@ilvokhin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: David Airlie <airlied@gmail.com> Cc: Simona Vetter <simona@ffwll.ch> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tvrtko Ursulin <tursulin@ursulin.net> Cc: Lee Jones <lee@kernel.org> Cc: Pavel Machek <pavel@kernel.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@codeconstruct.com.au> Cc: Ryan Chen <ryan_chen@aspeedtech.com> Cc: Billy Tsai <billy_tsai@aspeedtech.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Kees Cook <kees@kernel.org> Cc: Andy Shevchenko <andy@kernel.org> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Joe Perches <joe@perches.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Miguel Ojeda <ojeda@kernel.org> Cc: Andi Shyti <andi.shyti@kernel.org> scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+)
Follow-up to #3 and #5, as invited. This brings
hid-ayaneoin the tree up to the current upstream submission state: the rest of the LKML v2 round (#5 already carried its teardown-UAF fix), plus everything adopted from @pastaq's review on #3.Commits, in order:
maxcollectionguard before touchinghdev->collection, drop the joystick-sensitivity bytes from the config command so the firmware setting is left alone (hardware-verified), breathing effect via the stockledtrig-patternhw_patternABI, and a comment on reply matching. Matches the v2 series on lore.ayaneo_prefix for driver plumbing (wire constants stayAYA3_*)static_asserts and the vibration levels as an enumscoped_cond_guard(mutex_intr, ...)at every lock siteLED_COLOR_ID_RGBCommits 3 through 6 are the items adopted from the #3 review. The remaining review points are deferred to the upstream v3 cover letter as proposed ABI growth (
rumble_intensityplus index attrs,eject_index, and the hid to ayaneo-ec notification framework, which needs the pdx86 folks on Cc). The RGB debounce question was resolved in the #3 thread with hardware measurements:brightness_set_blockinggets core-level deferral and coalescing, 5.3 ms average command round trip, and 1000 back-to-back sysfs stores complete in 12 ms without blocking the writer.Hardware validation (AYANEO 3, Bazzite 44, kernel 7.2.0-ogc6.1): this exact file builds clean and is what I'm running daily. Module IDs read correctly through the new struct offsets, solid/pulse/off all ACKed (pulse visually confirmed), malformed
hw_patternwrites are rejected, module reload cycles and dmesg are clean, and the teardown fix previously survived repeated unbind-under-brightness-hammer rounds.After this lands the tree matches what will go out as v3 to LKML. v3 additionally grows only the Cc list and cover letter; no further code delta is planned unless upstream review asks for one.