All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Arnd Bergmann <arnd@kernel.org>,
	Alexander Aring <alex.aring@gmail.com>,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] [v2] at86rf230: convert to gpio descriptors
Date: Wed, 1 Feb 2023 09:33:32 +0100	[thread overview]
Message-ID: <20230201093332.15b0ff9a@xps-13> (raw)
In-Reply-To: <CAKdAkRSuDJgdsSQqy9Cc_eUYuOfFsLmBJ8Rd93uQhY6HV8nN4w@mail.gmail.com>

Hi Dmitry,

dmitry.torokhov@gmail.com wrote on Tue, 31 Jan 2023 16:50:07 -0800:

> On Tue, Jan 31, 2023 at 3:52 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Arnd,
> >
> > On Thu, Jan 26, 2023 at 8:32 AM Arnd Bergmann <arnd@kernel.org> wrote:  
> > >
> > >         /* Reset */
> > > -       if (gpio_is_valid(rstn)) {
> > > +       if (rstn) {
> > >                 udelay(1);
> > > -               gpio_set_value_cansleep(rstn, 0);
> > > +               gpiod_set_value_cansleep(rstn, 0);
> > >                 udelay(1);
> > > -               gpio_set_value_cansleep(rstn, 1);
> > > +               gpiod_set_value_cansleep(rstn, 1);  
> >
> > For gpiod conversions, if we are not willing to chase whether existing
> > DTSes specify polarities
> > properly and create workarounds in case they are wrong, we should use
> > gpiod_set_raw_value*()
> > (my preference would be to do the work and not use "raw" variants).
> >
> > In this particular case, arch/arm/boot/dts/vf610-zii-dev-rev-c.dts
> > defines reset line as active low,
> > so you are leaving the device in reset state.

You mean the semantics of gpio_set_value() gpiod_set_value() are
different? Looking at your patch it looks like gpio_set_value() asserts
a physical line state (high or low) while gpiod_set_value() would
actually try to assert a logical state (enabled or disabled) with the
meaning of those being possibly inverted thanks to the DT polarities.
Am I getting this right?

> > Please review your other conversion patches.  
> 
> We also can not change the names of requested GPIOs from "reset-gpio"
> to "rstn-gpios" and expect
> this to work.

Yep, missed that indeed.

> 
> Stefan, please consider reverting this and applying a couple of
> patches I will send out shortly.

If my above understanding is right, then, yeah, the current
patches need to be fixed.

Thanks,
Miquèl

  reply	other threads:[~2023-02-01  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 16:22 [PATCH] [v2] at86rf230: convert to gpio descriptors Arnd Bergmann
2023-01-28 13:39 ` Stefan Schmidt
2023-01-31 23:52 ` Dmitry Torokhov
2023-02-01  0:50   ` Dmitry Torokhov
2023-02-01  8:33     ` Miquel Raynal [this message]
2023-02-01 16:20       ` Dmitry Torokhov
2023-02-01 12:42     ` Stefan Schmidt
2023-02-01 16:19       ` Dmitry Torokhov
2023-02-01 20:54         ` Stefan Schmidt
2023-02-01 18:45       ` Andy Shevchenko

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=20230201093332.15b0ff9a@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=alex.aring@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stefan@datenfreihafen.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 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.