diff mbox series

[v3,1/2] Input: ilitek_ts_i2c - avoid wrong input subsystem sync

Message ID 20231222183114.30775-2-francesco@dolcini.it (mailing list archive)
State New
Headers show
Series Input: ilitek_ts_i2c - Fix spurious input events | expand

Commit Message

Francesco Dolcini Dec. 22, 2023, 6:31 p.m. UTC
From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

For different reasons i2c transaction may fail or
report id message content may be wrong.
Avoid sync the input subsystem if message cannot be parsed.
An input subsystem sync without points is interpreted as
"nothing is touching the screen" while normally this is not the case.

Fixes: 42370681bd46 ("Input: Add support for ILITEK Lego Series")
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v3: added reviewed by
---
 drivers/input/touchscreen/ilitek_ts_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Torokhov July 31, 2024, 6:59 p.m. UTC | #1
Hi Francesco,

On Fri, Dec 22, 2023 at 07:31:13PM +0100, Francesco Dolcini wrote:
> From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> 
> For different reasons i2c transaction may fail or
> report id message content may be wrong.
> Avoid sync the input subsystem if message cannot be parsed.
> An input subsystem sync without points is interpreted as
> "nothing is touching the screen" while normally this is not the case.
> 
> Fixes: 42370681bd46 ("Input: Add support for ILITEK Lego Series")
> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

If you are adding your sign-off you do not need to have your
reviewed-by, it is assumed that you reviewed the code you are passing
on.

> ---
> v3: added reviewed by
> ---
>  drivers/input/touchscreen/ilitek_ts_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c
> index fc4e39b6651a..250133f0d68f 100644
> --- a/drivers/input/touchscreen/ilitek_ts_i2c.c
> +++ b/drivers/input/touchscreen/ilitek_ts_i2c.c
> @@ -203,9 +203,9 @@ static int ilitek_process_and_report_v6(struct ilitek_ts_data *ts)
>  		ilitek_touch_down(ts, id, x, y);
>  	}
>  
> -err_sync_frame:
>  	input_mt_sync_frame(input);
>  	input_sync(input);
> +err_sync_frame:

You are not syncing the frame, so that label is wrong. If you do not
want to release the contacts just change "goto err_sync_frame" to
direct returns and remove the label.

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c
index fc4e39b6651a..250133f0d68f 100644
--- a/drivers/input/touchscreen/ilitek_ts_i2c.c
+++ b/drivers/input/touchscreen/ilitek_ts_i2c.c
@@ -203,9 +203,9 @@  static int ilitek_process_and_report_v6(struct ilitek_ts_data *ts)
 		ilitek_touch_down(ts, id, x, y);
 	}
 
-err_sync_frame:
 	input_mt_sync_frame(input);
 	input_sync(input);
+err_sync_frame:
 	return error;
 }