Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] Input: assorted bug fixes across input drivers
@ 2026-11-23 18:31 Lee Jones
  2026-11-23 18:31 ` [PATCH 08/10] Input: mt6779-keypad - enable keypad clock before programming registers Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2026-11-23 18:31 UTC (permalink / raw)
  To: lee, Matthias Brugger, AngeloGioacchino Del Regno, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Cheng, Wacom, Ronald Tschalär,
	Uwe Kleine-König (The Capable Hub), Andrew Duggan,
	Andy Shevchenko, Arnd Bergmann, Benjamin Tissoires, Bjorn Helgaas,
	Carlo Caione, Chen-Yu Tsai, Danilo Krummrich, Dmitry Torokhov,
	Dudley Du, Fengping Yu, Greg Kroah-Hartman, Hans de Goede,
	Ian Bridges, Jaya Kumar, Linus Walleij, linux-input, Marco Felsch,
	Marek Vasut, Mattijs Korpershoek, Pawel Zalewski, Sakari Ailus,
	Samuel Holland, Takashi Sakamoto, Vojtech Pavlik

These issues were reported by Sashiko.

None of these changes have been tested on physical hardware.

Cc: "Cheng, Wacom" <pingc@wacom.com>
Cc: "Ronald Tschalär" <ronald@innovation.ch>
Cc: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Andrew Duggan <aduggan@synaptics.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Tissoires <bentiss@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Carlo Caione <carlo@caione.org>
Cc: Chen-Yu Tsai <wens@kernel.org>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dudley Du <dudl@cypress.com>
Cc: Fengping Yu <fengping.yu@mediatek.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Hans de Goede <hansg@kernel.org>
Cc: Ian Bridges <icb@fastmail.org>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: Linus Walleij <linusw@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-input@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
Cc: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Samuel Holland <samuel@sholland.org>
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Vojtech Pavlik <vojtech@ucw.cz>

Lee Jones (10):
  Input: matrix_keypad - validate GPIO counts against matrix limits
  Input: cyapa - validate firmware image size in cyapa_pip_check_fw()
  Input: applespi - cancel touchpad registration work on removal
  Input: matrix_keypad - only stop and start active device across sleep
  Input: stinger - zero-initialise driver state in stinger_connect()
  Input: synaptics-rmi4 - check for NULL drvdata in rmi_set_attn_data()
  Input: axp20x-pek - skip IRQ handling during sleep without input
    device
  Input: mt6779-keypad - enable keypad clock before programming
    registers
  Input: pinephone-keyboard - request IRQ before registering input
    device
  Input: wacom_w8001 - use reinit_completion() in w8001_command()

 drivers/input/joystick/stinger.c            |  2 +-
 drivers/input/keyboard/applespi.c           |  1 +
 drivers/input/keyboard/matrix_keypad.c      | 19 +++++++++++++++----
 drivers/input/keyboard/mt6779-keypad.c      |  8 ++++----
 drivers/input/keyboard/pinephone-keyboard.c | 12 ++++++------
 drivers/input/misc/axp20x-pek.c             |  6 ++++++
 drivers/input/mouse/cyapa_gen5.c            | 15 +++++++++++++++
 drivers/input/rmi4/rmi_driver.c             |  2 +-
 drivers/input/touchscreen/wacom_w8001.c     |  2 +-
 9 files changed, 50 insertions(+), 17 deletions(-)

-- 
2.56.1.750.gf70dc682cf-goog



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 08/10] Input: mt6779-keypad - enable keypad clock before programming registers
  2026-11-23 18:31 [PATCH 00/10] Input: assorted bug fixes across input drivers Lee Jones
@ 2026-11-23 18:31 ` Lee Jones
  2026-11-23 20:25   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2026-11-23 18:31 UTC (permalink / raw)
  To: lee, Mattijs Korpershoek, Dmitry Torokhov, Matthias Brugger,
	AngeloGioacchino Del Regno, Fengping Yu, Marco Felsch,
	Andy Shevchenko, linux-input, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: stable

mt6779_keypad_pdrv_probe() writes the debounce and matrix selection
registers over MMIO before acquiring and enabling the "kpd" clock via
devm_clk_get_enabled().

When the keypad clock is gated off at boot or its clock provider defers
probe, accessing unclocked keypad MMIO registers can trigger a bus abort
or silently drop the configuration writes.

Acquire and enable the "kpd" clock before accessing the keypad
registers.

Fixes: f28af984e771 ("Input: mt6779-keypad - add MediaTek keypad driver")
Closes: https://sashiko.dev/#/bug/linux-fc15622a-407a-48b2-88db-195cdb311dbf
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/input/keyboard/mt6779-keypad.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
index 60e6ad97cf59..a9f62f02439e 100644
--- a/drivers/input/keyboard/mt6779-keypad.c
+++ b/drivers/input/keyboard/mt6779-keypad.c
@@ -195,6 +195,10 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
 
 	input_set_capability(keypad->input_dev, EV_MSC, MSC_SCAN);
 
+	keypad->clk = devm_clk_get_enabled(&pdev->dev, "kpd");
+	if (IS_ERR(keypad->clk))
+		return PTR_ERR(keypad->clk);
+
 	regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE,
 		     (debounce * (1 << 5)) & MTK_KPD_DEBOUNCE_MASK);
 
@@ -208,10 +212,6 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
 	regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_COL,
 			   MTK_KPD_SEL_COLMASK(keypad->n_cols));
 
-	keypad->clk = devm_clk_get_enabled(&pdev->dev, "kpd");
-	if (IS_ERR(keypad->clk))
-		return PTR_ERR(keypad->clk);
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
-- 
2.56.1.750.gf70dc682cf-goog



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 08/10] Input: mt6779-keypad - enable keypad clock before programming registers
  2026-11-23 18:31 ` [PATCH 08/10] Input: mt6779-keypad - enable keypad clock before programming registers Lee Jones
@ 2026-11-23 20:25   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2026-11-23 20:25 UTC (permalink / raw)
  To: Lee Jones
  Cc: Mattijs Korpershoek, Matthias Brugger, AngeloGioacchino Del Regno,
	Fengping Yu, Marco Felsch, Andy Shevchenko, linux-input,
	linux-kernel, linux-arm-kernel, linux-mediatek, stable

On Mon, Nov 23, 2026 at 06:31:14PM +0000, Lee Jones wrote:
> mt6779_keypad_pdrv_probe() writes the debounce and matrix selection
> registers over MMIO before acquiring and enabling the "kpd" clock via
> devm_clk_get_enabled().
> 
> When the keypad clock is gated off at boot or its clock provider defers
> probe, accessing unclocked keypad MMIO registers can trigger a bus abort
> or silently drop the configuration writes.
> 
> Acquire and enable the "kpd" clock before accessing the keypad
> registers.
> 
> Fixes: f28af984e771 ("Input: mt6779-keypad - add MediaTek keypad driver")
> Closes: https://sashiko.dev/#/bug/linux-fc15622a-407a-48b2-88db-195cdb311dbf
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>

Applied, thank you.

-- 
Dmitry


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-23 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 18:31 [PATCH 00/10] Input: assorted bug fixes across input drivers Lee Jones
2026-11-23 18:31 ` [PATCH 08/10] Input: mt6779-keypad - enable keypad clock before programming registers Lee Jones
2026-11-23 20:25   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox