linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Nick Dyer <nick.dyer@itdev.co.uk>
Cc: Tom Rini <trini@konsulko.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Henrik Rydberg <rydberg@bitmath.org>,
	simon.raphael@gmail.com, Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH] Input: atmel_mxt_ts - use mxt_acquire_irq in mxt_soft_reset
Date: Mon, 25 Apr 2016 14:28:53 -0700	[thread overview]
Message-ID: <20160425212853.GI26059@dtor-ws> (raw)
In-Reply-To: <1460367105-29258-1-git-send-email-nick.dyer@itdev.co.uk>

On Mon, Apr 11, 2016 at 10:31:45AM +0100, Nick Dyer wrote:
> If using IRQF_TRIGGER_FALLING, then there is a race here: if the reset
> completes before we enable the IRQ, then CHG is already low and touch
> will be broken.
> 
> This has been seen on Chromebook Pixel 2.
> 
> A workaround is to reconfig T18 COMMSCONFIG to enable the RETRIGEN bit
> using mxt-app:
>     mxt-app -W -T18 44
>     mxt-app --backup
> 
> Tested-by: Tom Rini <trini@konsulko.com>
> Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>

Applied, thank you.

> ---
>  drivers/input/touchscreen/atmel_mxt_ts.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
> index 2160512..5af7907 100644
> --- a/drivers/input/touchscreen/atmel_mxt_ts.c
> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c
> @@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
>  	return 0;
>  }
>  
> +static int mxt_acquire_irq(struct mxt_data *data)
> +{
> +	int error;
> +
> +	enable_irq(data->irq);
> +
> +	error = mxt_process_messages_until_invalid(data);
> +	if (error)
> +		return error;
> +
> +	return 0;
> +}
> +
>  static int mxt_soft_reset(struct mxt_data *data)
>  {
>  	struct device *dev = &data->client->dev;
> @@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data)
>  	/* Ignore CHG line for 100ms after reset */
>  	msleep(100);
>  
> -	enable_irq(data->irq);
> +	mxt_acquire_irq(data);
>  
>  	ret = mxt_wait_for_completion(data, &data->reset_completion,
>  				      MXT_RESET_TIMEOUT);
> @@ -1466,19 +1479,6 @@ release_mem:
>  	return ret;
>  }
>  
> -static int mxt_acquire_irq(struct mxt_data *data)
> -{
> -	int error;
> -
> -	enable_irq(data->irq);
> -
> -	error = mxt_process_messages_until_invalid(data);
> -	if (error)
> -		return error;
> -
> -	return 0;
> -}
> -
>  static int mxt_get_info(struct mxt_data *data)
>  {
>  	struct i2c_client *client = data->client;
> -- 
> 2.5.0
> 

-- 
Dmitry

      reply	other threads:[~2016-04-25 21:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 22:52 [PATCH] Revert "Input: atmel_mxt_ts - disable interrupt for 50ms after reset" Tom Rini
2016-04-08  9:10 ` Nick Dyer
2016-04-08 12:14   ` Tom Rini
2016-04-08 12:26     ` Nick Dyer
2016-04-08 12:39       ` Tom Rini
2016-04-08 21:30         ` Nick Dyer
2016-04-08 23:30           ` Tom Rini
2016-04-11  9:31             ` [PATCH] Input: atmel_mxt_ts - use mxt_acquire_irq in mxt_soft_reset Nick Dyer
2016-04-25 21:28               ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160425212853.GI26059@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick.dyer@itdev.co.uk \
    --cc=olof@lixom.net \
    --cc=rydberg@bitmath.org \
    --cc=simon.raphael@gmail.com \
    --cc=trini@konsulko.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).