All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: pca953x: Improve interrupt support
Date: Mon, 27 Jan 2025 12:12:20 +0200	[thread overview]
Message-ID: <Z5dcBHtnegX2P9eg@smile.fi.intel.com> (raw)
In-Reply-To: <20240606033102.2271916-1-mark.tomlinson@alliedtelesis.co.nz>

On Thu, Jun 06, 2024 at 03:31:02PM +1200, Mark Tomlinson wrote:
> The GPIO drivers with latch interrupt support (typically types starting
> with PCAL) have interrupt status registers to determine which particular
> inputs have caused an interrupt. Unfortunately there is no atomic
> operation to read these registers and clear the interrupt. Clearing the
> interrupt is done by reading the input registers.
> 
> The code was reading the interrupt status registers, and then reading
> the input registers. If an input changed between these two events it was
> lost.
> 
> The solution in this patch is to revert to the non-latch version of
> code, i.e. remembering the previous input status, and looking for the
> changes. This system results in no more I2C transfers, so is no slower.
> The latch property of the device still means interrupts will still be
> noticed if the input changes back to its initial state.

Sorry for such a delay. I think we are good to go with this and think
about any optimisations later on.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2025-01-27 10:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06  3:31 [PATCH] gpio: pca953x: Improve interrupt support Mark Tomlinson
2024-06-08  9:44 ` Andy Shevchenko
2024-06-09 22:13   ` Mark Tomlinson
2025-01-13 22:02     ` lakabd
2025-01-14  9:36       ` Andy Shevchenko
2025-01-14 15:44         ` work work
2025-01-21 10:11           ` lakabd
2025-01-27  7:47             ` Andy Shevchenko
2025-01-27 10:11               ` Andy Shevchenko
2025-01-27 16:45               ` lakabd
2025-01-27 18:58                 ` Andy Shevchenko
2025-01-28  3:43               ` Mark Tomlinson
2025-01-27 10:12 ` Andy Shevchenko [this message]
2025-02-04 20:27 ` Bartosz Golaszewski

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=Z5dcBHtnegX2P9eg@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.tomlinson@alliedtelesis.co.nz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.