]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: sx8654 - use IRQF_NOAUTOEN when requesting interrupt
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 Aug 2024 21:22:13 +0000 (14:22 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 25 Mar 2026 14:53:59 +0000 (07:53 -0700)
Instead of requesting interrupt normally and immediately disabling it
with call to disable_irq() use IRQF_NOAUTOEN to keep it disabled until
it is needed. This avoids a tiny window when interrupt is enabled but
not needed.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/sx8654.c

index b5fe750e42ad27d8325dcaa25d95d78e1e49990e..0d92aaeea3e0e3155a1c9d7421168627f436ca72 100644 (file)
@@ -391,9 +391,13 @@ static int sx8654_probe(struct i2c_client *client)
                return error;
        }
 
+       /*
+        * Start with the interrupt disabled, it will be enabled in
+        * sx8654_open().
+        */
        error = devm_request_threaded_irq(&client->dev, client->irq,
                                          NULL, sx8654->data->irqh,
-                                         IRQF_ONESHOT,
+                                         IRQF_ONESHOT | IRQF_NO_AUTOEN,
                                          client->name, sx8654);
        if (error) {
                dev_err(&client->dev,
@@ -402,9 +406,6 @@ static int sx8654_probe(struct i2c_client *client)
                return error;
        }
 
-       /* Disable the IRQ, we'll enable it in sx8654_open() */
-       disable_irq(client->irq);
-
        error = input_register_device(sx8654->input);
        if (error)
                return error;