linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Nick Dyer <nick@shmanahar.org>
Cc: Ezequiel Garcia <ezequiel@collabora.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH] Input: atmel_mxt_ts - fix reset-gpio for level based irqs
Date: Mon, 23 Apr 2018 13:43:35 +0200	[thread overview]
Message-ID: <20180423114335.n5n7q4arn2petcnd@earth.universe> (raw)
In-Reply-To: <20180421201137.fyr6eqzjuob765ie@hairyalien>

[-- Attachment #1: Type: text/plain, Size: 2784 bytes --]

Hi,

On Sat, Apr 21, 2018 at 09:11:37PM +0100, Nick Dyer wrote:
> On Fri, Apr 20, 2018 at 09:42:07PM +0200, Sebastian Reichel wrote:
> > On Fri, Apr 20, 2018 at 02:44:02PM -0300, Ezequiel Garcia wrote:
> > > Hi Sebastian,
> > > 
> > > On Fri, 2018-04-20 at 19:24 +0200, Sebastian Reichel wrote:
> > > > The current reset-gpio support triggers an interrupt storm on platforms
> > > > using the maxtouch with level based interrupt. The Motorola Droid 4,
> > > > which I used for some of the tests is not affected, since it uses a level
> > > > based interrupt.
> > > > 
> > > 
> > > I found this confusing. Interrupt storm happen with level-based interrupts,
> > > but the Droid4 is not affected?
> 
> Can I ask what happens during the interrupt storm. Are you getting lots
> of the "failed to read T44 and T5" message, or something else?

I don't get any message (with DEBUG enabled for the driver).
The boot process hangs and after a few seconds the watchdog kicks in.

> > > > This change avoids the interrupt storm by enabling the device while
> > > > its interrupt is disabled. The following mxt_initialize() requires,
> > > > that the device is responsive (at least mxt224E is unresponsive for
> > > > ~22ms), so we wait some time. We don't wait for leaving bootloader
> > > > mode anymore, since mxt_initialize() checks for it anyways.
> > > > 
> > > 
> > > IMHO, having some more or less arbritrary sleeps is almost
> > > always a problem. This value might be enough for some platform,
> > > might be too short for some other, and then it might get too large
> > > for someone else.
> > 
> > The 22ms chip-being-unresponsive are not newly introduced. The
> > same 22ms are also required for soft-reset. I did introduce a
> > new time (MXT_RESET_GPIO_TIME) for the "chip being reset" state,
> > since my randomly chosen 200ms from before were exaggerated
> > considering all mxt datasheets I checked stated only a few nano
> > seconds.
> 
> According to the data sheets there is a period after a reset where the
> CHG line is temporarily set as an input, during which the host should
> ignore it. If you don't, you might get a stray interrupt and try and
> communicate with the device, which might leave it in a bad state. I
> think you mentioned that later in your email.
> 
> The reset time varies per chip, but the 100ms in mxt_soft_reset() was
> based on discussions with app support at Atmel, so should be correct in
> most cases.

Right. This sleep time is missing for the gpio based reset. The
other checks are not required, since the chip initialization
routine is called directly afterwards. I will send a PATCHv2,
that fixes the patch description and uses the same timeout value
for both resets.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-04-23 11:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 17:24 [PATCH] Input: atmel_mxt_ts - fix reset-gpio for level based irqs Sebastian Reichel
2018-04-20 17:44 ` Ezequiel Garcia
2018-04-20 19:42   ` Sebastian Reichel
2018-04-21 20:11     ` Nick Dyer
2018-04-23 11:43       ` Sebastian Reichel [this message]
2018-04-23 11:58 ` [PATCHv2] " Sebastian Reichel
2018-05-03  9:15   ` Sebastian Reichel
2018-05-09 14:25   ` Pavel Machek
2018-05-09 14:40     ` Sebastian Reichel
2018-05-24 16:35   ` Dmitry Torokhov

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=20180423114335.n5n7q4arn2petcnd@earth.universe \
    --to=sebastian.reichel@collabora.co.uk \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ezequiel@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nick@shmanahar.org \
    /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).