Merge tag 'input-for-v6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputPull input updates from Dmitry Torokhov: - streamlined logic in input core for handling normal input han
Merge tag 'input-for-v6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputPull input updates from Dmitry Torokhov: - streamlined logic in input core for handling normal input handlers vs input filters - updates to input drivers to allocate memory with sizeof(*pointer) instead of sizeof(type) - change to ads7846 touchscreen driver to use hsync GPIO instead of requiring platform data with special method (which is not compatible with boards using device tree) - update to adc-joystick driver to handle inverted axes - cleanups in various drivers switching them to use the new "guard" and "__free()" facilities - changes to several drivers (adxl34x, atmel_mxt_ts, ati-remote2, omap-keypad, yealink) to stop creating driver-specific device attributes manually and use driver core facilities for this - update to Cypress PS/2 protocol driver to properly handle errors from the PS/2 transport as well as other cleanups - update to edt-ft5x06 driver to support ft5426 variant - update to ektf2127 driver to support ektf2232 variant - update to exc3000 driver to support EXC81W32 variant - update to imagis driver to support IST3038 variant - other assorted driver cleanups.* tag 'input-for-v6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (71 commits) Input: yealink - simplify locking in sysfs attribute handling Input: yealink - use driver core to instantiate device attributes Input: ati-remote2 - use driver core to instantiate device attributes Input: omap-keypad - use driver core to instantiate device attributes Input: atmel_mxt_ts - use driver core to instantiate device attributes Input: exc3000 - add EXC81W32 support dt-bindings: input: touchscreen: exc3000: add EXC81W32 Input: twl4030-pwrbutton - fix kernel-doc warning Input: himax_hx83112b - add support for HX83100A Input: himax_hx83112b - add himax_chip struct for multi-chip support Input: himax_hx83112b - implement MCU register reading Input: himax_hx83112b - use more descriptive register defines dt-bindings: input: touchscreen: himax,hx83112b: add HX83100A Input: do not check number of events in input_pass_values() Input: preallocate memory to hold event values Input: rearrange input_alloc_device() to prepare for preallocating of vals Input: simplify event handling logic Input: make events() method return number of events processed Input: make sure input handlers define only one processing method Input: evdev - remove ->event() method ...
show more ...
kunit: Rename KUNIT_ASSERT_FAILURE to KUNIT_FAIL_AND_ABORT for readabilityBoth KUNIT_FAIL and KUNIT_ASSERT_FAILURE defined to KUNIT_FAIL_ASSERTIONwith different tpye of kunit_assert_type. The curr
kunit: Rename KUNIT_ASSERT_FAILURE to KUNIT_FAIL_AND_ABORT for readabilityBoth KUNIT_FAIL and KUNIT_ASSERT_FAILURE defined to KUNIT_FAIL_ASSERTIONwith different tpye of kunit_assert_type. The current naming ofKUNIT_ASSERT_FAILURE and KUNIT_FAIL_ASSERTION is confusing due to theirsimilarities. To improve readability and symmetry, renamesKUNIT_ASSERT_FAILURE to KUNIT_FAIL_AND_ABORT. Makes the namingconsistent, with KUNIT_FAIL and KUNIT_FAIL_AND_ABORT being symmetrical.Additionally, an explanation for KUNIT_FAIL_AND_ABORT has been added toclarify its usage.Signed-off-by: Eric Chan <ericchancf@google.com>Reviewed-by: David Gow <davidgow@google.com>Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Input: add missing MODULE_DESCRIPTION() macrosOn x86, make allmodconfig && make W=1 C=1 reports:WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/touchscreen/cyttsp_i2c_common.oWARN
Input: add missing MODULE_DESCRIPTION() macrosOn x86, make allmodconfig && make W=1 C=1 reports:WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/touchscreen/cyttsp_i2c_common.oWARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/misc/soc_button_array.oWARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/matrix-keymap.oWARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/vivaldi-fmap.oWARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/tests/input_test.oAdd the missing invocation of the MODULE_DESCRIPTION() macro to allfiles which have a MODULE_LICENSE().This includes drivers/input/misc/sgi_btns.c which, although it did notproduce a warning with the x86 allmodconfig configuration, may causethis warning with other configurations when either CONFIG_SGI_IP22 orCONFIG_SGI_IP32 is enabled.Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>Link: https://lore.kernel.org/r/20240609-md-drivers-input-v1-1-a2f394e0f9d8@quicinc.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: tests - add test to cover all input_grab_device() functionCurrently input_grab_device() isn't covered by any testsThus, adding a test to cover the cases:1. The device is grabbed successful
Input: tests - add test to cover all input_grab_device() functionCurrently input_grab_device() isn't covered by any testsThus, adding a test to cover the cases:1. The device is grabbed successfully2. Trying to grab a device that is already grabbed by another input handleSigned-off-by: Dana Elfassy <dangel101@gmail.com>Tested-by: Javier Martinez Canillas <javierm@redhat.com>Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>Link: https://lore.kernel.org/r/20230522215514.722564-1-dangel101@gmail.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: tests - fix input_test_match_device_id testProperly initialize input_device_id structure ininput_test_match_device_id test to make sure it contains no garbagecausing the test to randomly f
Input: tests - fix input_test_match_device_id testProperly initialize input_device_id structure ininput_test_match_device_id test to make sure it contains no garbagecausing the test to randomly fail.Fixes: fdefcbdd6f36 ("Input: Add KUnit tests for some of the input core helper functions")Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>Link: https://lore.kernel.org/r/ZFLI7T2qZTGJ1UUK@google.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: tests - fix use-after-free and refcount underflow in input_test_exit()With CONFIG_DEBUG_SLAB=y: # Subtest: input_core 1..3 input: Test input device as /devices/virtual/i
Input: tests - fix use-after-free and refcount underflow in input_test_exit()With CONFIG_DEBUG_SLAB=y: # Subtest: input_core 1..3 input: Test input device as /devices/virtual/input/input1 8<--- cut here --- Unable to handle kernel paging request at virtual address 6b6b6dd7 when read ... __lock_acquire from lock_acquire+0x26c/0x300 lock_acquire from _raw_spin_lock_irqsave+0x50/0x64 _raw_spin_lock_irqsave from devres_remove+0x20/0x7c devres_remove from devres_destroy+0x8/0x24 devres_destroy from input_free_device+0x2c/0x60 input_free_device from kunit_try_run_case+0x70/0x94 [kunit]Without CONFIG_DEBUG_SLAB=y: KTAP version 1 # Subtest: input_core 1..3 input: Test input device as /devices/virtual/input/input1 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 694 at lib/refcount.c:28 refcount_warn_saturate+0x54/0x100 refcount_t: underflow; use-after-free. ... Call Trace: [<0037cad4>] dump_stack+0xc/0x10 [<00377614>] __warn+0x7e/0xb4 [<0037768c>] warn_slowpath_fmt+0x42/0x62 [<001eee1c>] refcount_warn_saturate+0x54/0x100 [<000b1d34>] kfree_const+0x0/0x20 [<0036290a>] __kobject_del+0x0/0x6e [<001eee1c>] refcount_warn_saturate+0x54/0x100 [<00362a1a>] kobject_put+0xa2/0xb6 [<11965770>] kunit_generic_run_threadfn_adapter+0x0/0x1c [kunit]As per the comments for input_allocate_device() andinput_register_device(), input_free_device() must be called only to freedevices that have not been registered. input_unregister_device()already calls input_put_device(), thus leading to a use-after-free.Moreover, the kunit_suite.exit() method is called after every test case,even on failures. As the test itself already does cleanups in itsfailure paths, this may lead to a second use-after-free.Fix the first issue by dropping the call to input_allocate_device() frominput_test_exit().Fix the second issue by making the cleanup code conditional on asuccessful test.Fixes: fdefcbdd6f361841 ("Input: Add KUnit tests for some of the input core helper functions")Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>Link: https://lore.kernel.org/r/957b3b309a44d39fb6e38b2a526b250f69ea3d2c.1683022164.git.geert+renesas@glider.beSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: Add KUnit tests for some of the input core helper functionsThe input subsystem doesn't currently have any unit tests, let's add aCONFIG_INPUT_KUNIT_TEST option that builds a test suite to b
Input: Add KUnit tests for some of the input core helper functionsThe input subsystem doesn't currently have any unit tests, let's add aCONFIG_INPUT_KUNIT_TEST option that builds a test suite to be executedwith the KUnit test infrastructure.For now, only three tests were added for some of the input core helperfunctions that are trivial to test: * input_test_polling: set/get poll interval and set-up a poll handler. * input_test_timestamp: set/get input event timestamps. * input_test_match_device_id: match a device by bus, vendor, product, version and events capable of handling.But having the minimal KUnit support allows to add more tests and suitesas follow-up changes. The tests can be run with the following command: $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/input/tests/Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>Tested-by: Enric Balletbo i Serra <eballetbo@redhat.com>config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20230330/202303301815.kRKFM3NH-lkp@intel.com/config)Link: https://lore.kernel.org/r/20230330081831.2291351-1-javierm@redhat.comSigned-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>