From: Greg Kroah-Hartman Date: Mon, 10 Jan 2022 07:04:41 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.4.299~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95d0d6e7e642813f3ffc84923dcd635ad268ac9d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: input-zinitix-make-sure-the-irq-is-allocated-before-it-gets-enabled.patch --- diff --git a/queue-5.10/input-zinitix-make-sure-the-irq-is-allocated-before-it-gets-enabled.patch b/queue-5.10/input-zinitix-make-sure-the-irq-is-allocated-before-it-gets-enabled.patch new file mode 100644 index 00000000000..dfb962e3543 --- /dev/null +++ b/queue-5.10/input-zinitix-make-sure-the-irq-is-allocated-before-it-gets-enabled.patch @@ -0,0 +1,58 @@ +From cf73ed894ee939d6706d65e0cd186e4a64e3af6d Mon Sep 17 00:00:00 2001 +From: Nikita Travkin +Date: Sat, 8 Jan 2022 23:19:19 -0800 +Subject: Input: zinitix - make sure the IRQ is allocated before it gets enabled + +From: Nikita Travkin + +commit cf73ed894ee939d6706d65e0cd186e4a64e3af6d upstream. + +Since irq request is the last thing in the driver probe, it happens +later than the input device registration. This means that there is a +small time window where if the open method is called the driver will +attempt to enable not yet available irq. + +Fix that by moving the irq request before the input device registration. + +Reviewed-by: Linus Walleij +Fixes: 26822652c85e ("Input: add zinitix touchscreen driver") +Signed-off-by: Nikita Travkin +Link: https://lore.kernel.org/r/20220106072840.36851-2-nikita@trvn.ru +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/touchscreen/zinitix.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +--- a/drivers/input/touchscreen/zinitix.c ++++ b/drivers/input/touchscreen/zinitix.c +@@ -488,6 +488,15 @@ static int zinitix_ts_probe(struct i2c_c + return error; + } + ++ error = devm_request_threaded_irq(&client->dev, client->irq, ++ NULL, zinitix_ts_irq_handler, ++ IRQF_ONESHOT, ++ client->name, bt541); ++ if (error) { ++ dev_err(&client->dev, "Failed to request IRQ: %d\n", error); ++ return error; ++ } ++ + error = zinitix_init_input_dev(bt541); + if (error) { + dev_err(&client->dev, +@@ -514,13 +523,6 @@ static int zinitix_ts_probe(struct i2c_c + } + + irq_set_status_flags(client->irq, IRQ_NOAUTOEN); +- error = devm_request_threaded_irq(&client->dev, client->irq, +- NULL, zinitix_ts_irq_handler, +- IRQF_ONESHOT, client->name, bt541); +- if (error) { +- dev_err(&client->dev, "Failed to request IRQ: %d\n", error); +- return error; +- } + + return 0; + } diff --git a/queue-5.10/series b/queue-5.10/series index 9f96c112492..c2fbb6beb99 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -40,3 +40,4 @@ misdn-change-function-names-to-avoid-conflicts.patch drm-amd-display-added-power-down-for-dcn10.patch ipv6-raw-check-passed-optlen-before-reading.patch arm-dts-gpio-ranges-property-is-now-required.patch +input-zinitix-make-sure-the-irq-is-allocated-before-it-gets-enabled.patch