linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin Foster <colin.foster@in-advantage.com>
To: Robert Marko <robert.marko@sartura.hr>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Horatiu Vultur <horatiu.vultur@microchip.com>
Subject: Re: [PATCH 2/2] pinctrl: ocelot: fix pinconf
Date: Wed, 13 Jul 2022 23:20:47 -0700	[thread overview]
Message-ID: <Ys+1v3UKvSgOCD+7@COLIN-DESKTOP1.localdomain> (raw)
In-Reply-To: <CA+HBbNHwbPtxGYW=xnay7zW9nxUgu5EURy6nX9m2rkTPdSELLw@mail.gmail.com>

On Thu, Jul 14, 2022 at 01:07:24AM +0200, Robert Marko wrote:
> On Thu, Jul 14, 2022 at 1:01 AM Colin Foster <colin.foster@in-advantage.com>
> wrote:
> 
> > Hi Robert,
> >
> > On Thu, Jul 14, 2022 at 12:51:51AM +0200, Robert Marko wrote:
> > > Commit "pinctrl: ocelot: convert pinctrl to regmap" moved to using
> > > regmap_read/write, however it neglected to also carry out alignment
> > > to register stride of 4.
> > >
> > > This would cause the following error:
> > > [    1.720873] pinctrl-ocelot 6110101e0.pinctrl: pin_config_set op
> > failed for pin 34
> > > [    1.728110] sdhci-sparx5 600800000.mmc: Error applying setting,
> > reverse things back
> > >
> > > So, regmap_read would return -EINVAL as it was being passed address
> > > of the pin without stride, so for example pin 34 would end up being
> > > 0x22 in hex.
> > >
> > > Fix this by accouting for the stride in register address.
> >
> > Sorry for the bug. Horaitu found this as well and recently submitted
> > patches:
> >
> >
> > https://patchwork.ozlabs.org/project/linux-gpio/patch/20220713193750.4079621-3-horatiu.vultur@microchip.com/
> >
> > The second patch in his set fixes both of these issues (reg_stride and
> > max_register).
> >
> 
> Yeah, I noticed his patch only after sending this.
> Sorry for the noise.

It doesn't bother me. The only difference was your 0xfc for the max
register, while Horatiu's (per my suggestion) was info->desc->npins. 
Just pointing that out in case anyone wants to raise that as a sticking
point.

> 
> Regards,
> Robert
> 

  parent reply	other threads:[~2022-07-13 23:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 22:51 [PATCH 1/2] pinctrl: ocelot: correct pincfg regmap max_register Robert Marko
2022-07-13 22:51 ` [PATCH 2/2] pinctrl: ocelot: fix pinconf Robert Marko
2022-07-14  6:01   ` Colin Foster
2022-07-13 23:09     ` Robert Marko
     [not found]     ` <CA+HBbNHwbPtxGYW=xnay7zW9nxUgu5EURy6nX9m2rkTPdSELLw@mail.gmail.com>
2022-07-14  6:20       ` Colin Foster [this message]
2022-07-18  9:25       ` Linus Walleij

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=Ys+1v3UKvSgOCD+7@COLIN-DESKTOP1.localdomain \
    --to=colin.foster@in-advantage.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.marko@sartura.hr \
    /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).