All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Thomas <pthomas8589@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	linux-gpio <linux-gpio@vger.kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH v3 1/3] gpio: pca953x: Rewrite ->get_multiple() function
Date: Tue, 28 Apr 2020 09:09:03 -0400	[thread overview]
Message-ID: <CAD56B7cR9asgW-6PS7V+jZ8O7AYeYuH9egnF1G0uoQQaS9GhMA@mail.gmail.com> (raw)
In-Reply-To: <20200428124129.GR185537@smile.fi.intel.com>

On Tue, Apr 28, 2020 at 8:41 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Tue, Apr 28, 2020 at 02:13:21PM +0200, Linus Walleij wrote:
> > On Tue, Apr 21, 2020 at 5:42 PM Bartosz Golaszewski
> > <bgolaszewski@baylibre.com> wrote:
> > > wt., 21 kwi 2020 o 15:03 Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> napisał(a):
> > > > On Mon, Apr 20, 2020 at 08:27:50PM +0300, Andy Shevchenko wrote:
>
> ...
>
> > I don't mind trying to put in code to optimize use cases
> > when accessing single bytes here either. But I'd like there
> > to be explicit comments in the code saying why these
> > optimizations are there. Can we do those on top of
> > this (hopefully) known working base?
For the record my original get_multiple patch was a known working base.

>
> As I pointed out to Paul, the optimization like he proposed is not bad thing
> per se, the implementation is. On top of that I suggested to take a look to IRQ
> status bits, which presumable will leverage from this optimization as well.
>
> So, After applying this series it would be matter of change one line in the
> ->get_multiple() to replace read_regs() with optimized version or so along with
> IRQ bits changes.

This new function would then at least need to be called with mask as
an additional argument right? Then the bitmap_replace() will set
everything regardless of if it was read, this is fine I suppose
because it doesn't matter if it's setting bits outside of mask. You
just have two loops one in the new function and one in
bitmap_replace(). If this is what people would like to see I can work
on it. I did look into the sparse reads and it seems as though regmap
has a gather_write, but not a gather_read and gather_write isn't in
regmap-i2c.c anyway.

-Paul

  reply	other threads:[~2020-04-28 13:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 17:27 [PATCH v3 1/3] gpio: pca953x: Rewrite ->get_multiple() function Andy Shevchenko
2020-04-20 17:27 ` [PATCH v3 2/3] gpio: pca953x: fix handling of automatic address incrementing Andy Shevchenko
2020-04-20 17:27 ` [PATCH v3 3/3] gpio: pca953x: drop unused parameters of pca953x_recalc_addr() Andy Shevchenko
2020-04-21  3:23 ` [PATCH v3 1/3] gpio: pca953x: Rewrite ->get_multiple() function Paul Thomas
2020-04-21 12:55   ` Andy Shevchenko
2020-04-21 14:06     ` Uwe Kleine-König
2020-04-21 14:21       ` Andy Shevchenko
2020-04-22  4:33         ` Paul Thomas
2020-04-22  8:34           ` Andy Shevchenko
2020-04-21 13:03 ` Andy Shevchenko
2020-04-21 14:31   ` Uwe Kleine-König
2020-04-21 15:42   ` Bartosz Golaszewski
2020-04-28 12:13     ` Linus Walleij
2020-04-28 12:19       ` Uwe Kleine-König
2020-04-28 12:41       ` Andy Shevchenko
2020-04-28 13:09         ` Paul Thomas [this message]
2020-04-28 14:18           ` Andy Shevchenko
2020-04-28 14:58             ` Paul Thomas
2020-04-29 11:21               ` 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=CAD56B7cR9asgW-6PS7V+jZ8O7AYeYuH9egnF1G0uoQQaS9GhMA@mail.gmail.com \
    --to=pthomas8589@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.