summaryrefslogtreecommitdiff
path: root/drivers/input
AgeCommit message (Collapse)Author
2026-10-09Input: twl4030-pwrbutton - drop redundant pwr->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes pwr->dev.parent to the supplied parent device, so the explicit assignment in twl4030_pwrbutton_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: tps65218-pwrbutton - drop redundant idev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in tps6521x_pb_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: retu-pwrbutton - drop redundant idev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in retu_pwrbutton_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: regulator-haptic - drop redundant haptic->input_dev->dev.parent ↵Dmitry Torokhov
assignment devm_input_allocate_device() already initializes haptic->input_dev->dev.parent to the supplied parent device, so the explicit assignment in regulator_haptic_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: pwm-vibra - drop redundant vibrator->input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes vibrator->input->dev.parent to the supplied parent device, so the explicit assignment in pwm_vibrator_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: max8925-onkey - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in max8925_onkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: max77693-haptic - drop redundant haptic->input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes haptic->input_dev->dev.parent to the supplied parent device, so the explicit assignment in max77693_haptic_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: e3x0-button - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in e3x0_button_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: ariel-pwrbutton - drop redundant priv->input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes priv->input->dev.parent to the supplied parent device, so the explicit assignment in ariel_pwrbutton_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: ad714x - drop redundant input->dev.parent assignmentsDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignments in ad714x_probe() are redundant. Remove them. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: ab8500-ponkey - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in ab8500_ponkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: 88pm860x-onkey - drop redundant info->idev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes info->idev->dev.parent to the supplied parent device, so the explicit assignment in pm860x_onkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: tegra-kbc - drop redundant kbc->idev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes kbc->idev->dev.parent to the supplied parent device, so the explicit assignment in tegra_kbc_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: tc3589x-keypad - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in tc3589x_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: stmpe-keypad - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in stmpe_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: st-keyscan - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in keyscan_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: qt1050 - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in qt1050_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: pxa27x-keypad - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in pxa27x_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: mpr121-touchkey - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in mpr_touchkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: max7359-keypad - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in max7359_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: lpc32xx-keys - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in lpc32xx_kscan_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: jornada720-kbd - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in jornada720_kbd_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: imx-keypad - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in imx_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: cros-ec-keyb - drop redundant idev->dev.parent assignmentsDmitry Torokhov
devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignments in cros_ec_keyb_register_bs() and cros_ec_keyb_register_matrix() are redundant. Remove them. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: clps711x-keypad - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in clps711x_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: bcm-keypad - drop redundant input_dev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in bcm_kp_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: adp5520-keys - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in adp5520_keys_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: 88pm860x-ts - drop redundant idev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in pm860x_touch_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: cyapa - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in cyapa_create_input_dev() is redundant. Remove it. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: axp20x-pek - drop redundant idev->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in axp20x_pek_probe_input_device() is redundant. Remove it. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: applespi - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignments in applespi_register_touchpad_device() and applespi_probe() are redundant. Remove them. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: gpio_keys - drop redundant input->dev.parent assignmentDmitry Torokhov
devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in gpio_keys_probe() is redundant. Remove it. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-09Input: ati_remote2 - fix type confusion in device attribute handlersHaotian Zhang
Previously, the channel_mask and mode_mask attributes were registered on the parent usb_device via sysfs_create_group(). When commit b20d6bf8014b ("Input: ati-remote2 - use driver core to instantiate device attributes") converted the driver to let the driver core manage them via dev_groups in struct usb_driver, the attributes moved to the bound usb_interface devices, but the show and store callbacks were not updated accordingly. As a result, the callbacks still invoked to_usb_device() on a device pointer belonging to a struct usb_interface, producing an invalid usb_device pointer. Use to_usb_interface() directly in the attribute handlers to obtain the interface and its driver data. Fixes: b20d6bf8014b ("Input: ati-remote2 - use driver core to instantiate device attributes") Assisted-by: DeepSeek-V4.1-Flash Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Link: https://patch.msgid.link/20261009040302.3087205-1-vulab@iscas.ac.cn Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-08Input: matrix_keypad - propagate error code from matrix_keypad_build_keymap()Dmitry Torokhov
When switching to managed resources in matrix_keypad_probe(), the error return path after matrix_keypad_build_keymap() was replaced with a hardcoded -ENOMEM instead of propagating the real error code. Return the original error so the actual failure reason is preserved. Fixes: 7d0f351da460 ("Input: matrix_keypad - switch to using managed resources") Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/ascss_vYXDPXIxmn@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-03Merge tag 'input-for-v7.3-rc5' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - A fix for the Samsung S6SY761 touchscreen driver to power on the controller before unmasking interrupts during resume and to re-enable touch sensing when the device is open - Updates to the Synaptics touchpad driver to enable SMBus/RMI4 mode on Lenovo ThinkPad T490 and restrict the ThinkPad T440p InterTouch disable quirk to LEN0036 so that ThinkPad L440 retains SMBus support - A quirk for the AT keyboard driver (atkbd) to skip keyboard deactivation on Lenovo IdeaPad Slim 3 15IWC11 so the internal keyboard functions properly - A DMI quirk for the i8042 controller to disable active multiplexing on Fujitsu LIFEBOOK U7410, preventing the internal keyboard and touchpad from dying shortly after boot. * tag 'input-for-v7.3-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: atkbd - skip deactivate for Lenovo IdeaPad Slim 3 15IWC11 Input: s6sy761 - fix resume ordering and restore sensing Input: synaptics - limit T440p InterTouch quirk to LEN0036 Input: i8042 - add nomux quirk for Fujitsu LIFEBOOK U7410 Input: synaptics - add LEN205b entry to smbus_pnp_ids for ThinkPad T490
2026-10-02Input: atkbd - skip deactivate for Lenovo IdeaPad Slim 3 15IWC11Martino Papero
The internal keyboard on the Lenovo IdeaPad Slim 3 15IWC11 (83RR) does not work correctly with the default i8042 settings. Using i8042.nopnp=1 and i8042.dumbkbd=1 restores keyboard input, but prevents the Caps Lock LED from working. Using i8042.nopnp=1 alone does not fix the keyboard. The laptop works correctly when atkbd_deactivate_fixup is used instead. Add a DMI quirk for the 83RR to enable it. This was tested without any i8042 command-line parameters. Keyboard input and the Caps Lock LED work correctly, including after suspend and resume and after a cold boot. Link: https://lore.kernel.org/all/4f43465f-98ba-4722-8e29-03df20315369@kernel.org/ Signed-off-by: Martino Papero <martino.papero@lcb.to.it> Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Link: https://patch.msgid.link/c0b597b8-e7ad-4fba-a2bb-5d252e3dfbd3@lcb.to.it Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-10-01Input: cyttsp5 - convert to DEFINE_SIMPLE_DEV_PM_OPSDiederik de Haas
The use of SIMPLE_DEV_PM_OPS got deprecated in commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") So convert the pm ops to use its replacement: DEFINE_SIMPLE_DEV_PM_OPS. This also allows us to drop the __maybe_unused attributes. Signed-off-by: Diederik de Haas <diederik@cknow-tech.com> Link: https://patch.msgid.link/20261001175415.159900-1-diederik@cknow-tech.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-27Input: s6sy761 - fix resume ordering and restore sensingDavid Heidelberg
System suspend powers the controller off and resume powers it back on, but the resume path enables the interrupt before s6sy761_power_on() checks the boot. The firmware raises its boot-complete event on the interrupt line, the threaded handler consumes it, s6sy761_power_on() then reads an empty event and resume fails with -ENODEV, skipping the touch function setup: s6sy761 2-0048: PM: dpm_run_callback(): s6sy761_resume [s6sy761] returns -19 Power the chip on first and only then unmask the interrupt. Once resume completes the boot handshake the chip comes back with sensing off, as at probe where input_open() turns it on, so the touchscreen stays dead after resume. Send SENSE_ON again when the input device is open. Tested on a Pixel 3 XL over several s2idle cycles: resume succeeds and the touch function and sense status match the pre-suspend state. Assisted-by: LLM Cc: stable@vger.kernel.org Fixes: 0145a7141e59 ("Input: add support for the Samsung S6SY761 touchscreen") Signed-off-by: David Heidelberg <david@ixit.cz> Link: https://patch.msgid.link/20260926-s6sy761-suspend-v2-1-8f00a96ee6e8@ixit.cz Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-27Input: synaptics - limit T440p InterTouch quirk to LEN0036Raphaël Larocque
The ThinkPad L440 also uses board id 2722, but does not have the SMBus initialization problem seen on the T440p. On the L440, the SMBus companion becomes available shortly after psmouse probes, allowing the touchpad to use SMBus/RMI4 normally. The T440p's quirk is currently applied to all Synaptics touchpads with board id 2722, unnecessarily disabling SMBus InterTouch on the L440, as reported by Daniel Salmun. Restrict the quirk to PNP ID LEN0036, which identifies the T440p, so that other devices sharing board id 2722 retain their normal SMBus/RMI4 operation. Reported-by: Daniel Salmun <salmundani@gmail.com> Link: https://lore.kernel.org/all/20260925230039.236786-1-salmundani@gmail.com/ Fixes: 26eb3d92c7a4 ("Input: synaptics - disable InterTouch on ThinkPad T440p (board id 2722)") Cc: stable@vger.kernel.org Signed-off-by: Raphaël Larocque <rlarocque@disroot.org> Link: https://patch.msgid.link/20260927005810.85971-1-rlarocque@disroot.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-25Input: mt - update input_mt_report_slot_state() kerneldocDmitry Torokhov
Commit c258e84b180d ("Input: do not assign new tracking ID when changing tool type") stopped assigning a new tracking ID when the tool type in a slot changes, but left the kerneldoc comment for input_mt_report_slot_state() stating the old behavior. Update the comment to match the implementation. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-21Input: atkbd - use __assign_bit() where applicablePeng Fan
Convert open-coded if/else with __set_bit/__clear_bit to the __assign_bit API. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20260919130741.3041442-1-peng.fan@oss.nxp.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: i8042 - add nomux quirk for Fujitsu LIFEBOOK U7410Lovekesh Solanki
On the Fujitsu LIFEBOOK U7410 the internal keyboard and touchpad die shortly after boot if i8042 multiplexing controller is probed and switched to muxed mode. These multiplexing setup commands disturb the EC emulated keyboard and atkbd reports "Spurious ACK" and "Unknown key pressed" warnings, after which both keyboard and touchpad stop delivering events. Both touchpad and keyboard work in BIOS and GRUB. Disabling multiplexer using i8042.nomux=1 makes both devices work on warm/cold boot. Add a DMI quirk to force nomux mode for this model. Reported-by: Heiko Brey <cico0815@gmx.de> Link: https://lore.kernel.org/all/89f36f3f5e4c2d07b9ff72bc0b355875c336e498.camel@gmx.de/ Signed-off-by: Lovekesh Solanki <lovekeshsolanki00@gmail.com> Link: https://patch.msgid.link/20260920113541.1484808-1-lovekeshsolanki00@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: synaptics - add LEN205b entry to smbus_pnp_ids for ThinkPad T490Lovekesh Solanki
Lenovo ThinkPad T490 has a Synaptics Touchpad that supports SMBus/RMI4 mode, but is not listed in smbus_pnp_ids table. Add LEN205b to smbus_pnp_ids[] passlist. Reported-by: John Rosencutter <rosencutter@gmail.com> Closes: https://lore.kernel.org/all/CAOGuaRh025eKcBf9P8UrvtXNp68vQ0HVF2EbNMp-kpdaC1HNpA@mail.gmail.com/ Signed-off-by: Lovekesh Solanki <lovekeshsolanki00@gmail.com> Link: https://patch.msgid.link/20260920200730.1836756-1-lovekeshsolanki00@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - drop busy-wait and manual interrupt pump on transmitDmitry Torokhov
In gscps2_writeb_output(), after writing data to GSC_XMTDATA, the driver explicitly executed mdelay(6) and manually called gscps2_interrupt() as a polling mechanism to accelerate command responses (such as keyboard ACK or LED updates). On PA-RISC, the PS/2 controller asserts a level interrupt to the system ASIC whenever received data arrives in hardware, and the input/serio subsystem handles command responses asynchronously via completions. Busy-waiting for 6 ms on every transmitted byte introduces significant unnecessary latency during multi-byte command sequences and complicates interrupt handler locking. Remove mdelay(6) and the manual invocation of gscps2_interrupt() from gscps2_writeb_output(), relying on normal hardware interrupt delivery. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-7-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - serialize concurrent interrupt handlersDmitry Torokhov
gscps2_interrupt() may be invoked concurrently from a hardware interrupt on one CPU and from process context via gscps2_writeb_output() on another CPU. In gscps2_report_data(), ps2port->lock is released before calling serio_interrupt() to avoid recursive deadlocks. However, if two execution contexts run gscps2_report_data() concurrently for the same port, they could race to acquire serio->lock inside serio_interrupt(), potentially delivering multi-byte scancodes out of order. Serialize execution of gscps2_interrupt() using gscps2_interrupt_lock with ACQUIRE(spinlock_irqsave_try). Using spin_trylock prevents overlapping executions and guarantees in-order packet delivery without risking recursive deadlocks if an input driver synchronously sends a command back via serio_write(). If the lock cannot be acquired, return IRQ_NONE to preserve spurious interrupt detection on shared IRQ lines. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-6-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - return IRQ_NONE when interrupt is not handledDmitry Torokhov
gscps2_interrupt() is registered with IRQF_SHARED. Unconditionally returning IRQ_HANDLED when no data was pending on any GSC PS/2 port masks unhandled interrupts on the shared interrupt line and prevents the kernel core spurious interrupt detector from identifying runaway interrupt storms. Have gscps2_read_data() return whether any bytes were read, accumulate the handled status in gscps2_interrupt(), and return IRQ_RETVAL(handled). Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-5-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - serialize hardware and buffer access in gscps2_flush()Dmitry Torokhov
gscps2_flush() reads from hardware registers and resets the ring buffer indices ps2port->act and ps2port->append. In gscps2_enable(), the trailing gscps2_flush() was called without holding ps2port->lock, racing with concurrent hardware interrupts and buffer access. Assert that ps2port->lock is held in gscps2_flush() with lockdep_assert_held(), and ensure all callers acquire ps2port->lock so that multi-step hardware sequences remain fully serialized without unprotected windows. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-4-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - protect buffer access in read and report helpersDmitry Torokhov
In gscps2_report_data(), the ring buffer consumer index ps2port->act was read and updated locklessly. When gscps2_interrupt() was called from process context (such as during port write or open) concurrently with a hardware interrupt running on another CPU, two execution contexts could execute gscps2_report_data() simultaneously for the same port, racing on ps2port->act and leading to duplicate, skipped, or out-of-order bytes. Protect buffer access by taking ps2port->lock inside gscps2_read_data() and gscps2_report_data(). In gscps2_report_data(), acquire ps2port->lock only when popping entries from the ring buffer and release it before calling serio_interrupt() to avoid recursive deadlocks if the input driver synchronously sends a command back via serio_write(). Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-3-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - use RCU for ps2port_list and manage it in open/closeDmitry Torokhov
Managing ps2port_list in gscps2_probe() and gscps2_remove() had two issues: - in gscps2_remove(), serio_unregister_port() frees the serio port, but because the port remained in ps2port_list until later in remove, a shared interrupt firing on another CPU could traverse ps2port_list and dereference the freed serio port - ps2port_list additions and deletions in probe/remove raced locklessly against list traversals in gscps2_interrupt(). Convert ps2port_list traversal in gscps2_interrupt() to use RCU, and move list management to gscps2_open() and gscps2_close(). When serio_unregister_port() runs during device removal, serio_close() is invoked, cleanly taking the port out of ps2port_list before the serio structure is destroyed, while maintaining active hardware communication during child driver disconnect. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-2-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2026-09-20Input: gscps2 - clean up driver code style and structureDmitry Torokhov
Clean up code style issues and function ordering in the gscps2 driver: - Reorder functions to place gscps2_interrupt() before its callers, allowing removal of its forward declaration. - Change gscps2_enable() to accept a boolean parameter and remove the ENABLE and DISABLE macro definitions. - Convert printk() calls to dev_dbg() and dev_warn(). - Fix operator spacing and multi-variable assignment. - Add spinlock comment and use cpu_relax() in spin-wait loop. Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-1-c733d4cae7f9@gmail.com Acked-by: Helge Deller <deller@gmx.de> Tested-by: Helge Deller <deller@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>