stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Martin Schiller <ms@dev.tdt.de>,
	hauke@hauke-m.de, rdunlap@infradead.org, robh@kernel.org,
	bhelgaas@google.com, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] MIPS: pci: lantiq: restore reset gpio polarity
Date: Wed, 12 Jun 2024 08:38:33 -0700	[thread overview]
Message-ID: <ZmnA-fifJkEBt0lH@google.com> (raw)
In-Reply-To: <ZmhbQgXxyhZ7shBh@alpha.franken.de>

Hi Thomas, Martin,

On Tue, Jun 11, 2024 at 04:12:18PM +0200, Thomas Bogendoerfer wrote:
> On Fri, Jun 07, 2024 at 11:04:00AM +0200, Martin Schiller wrote:
> > Commit 90c2d2eb7ab5 ("MIPS: pci: lantiq: switch to using gpiod API") not
> > only switched to the gpiod API, but also inverted / changed the polarity
> > of the GPIO.
> > 
> > According to the PCI specification, the RST# pin is an active-low
> > signal. However, most of the device trees that have been widely used for
> > a long time (mainly in the openWrt project) define this GPIO as
> > active-high and the old driver code inverted the signal internally.
> > 
> > Apparently there are actually boards where the reset gpio must be
> > operated inverted. For this reason, we cannot use the GPIOD_OUT_LOW/HIGH
> > flag for initialization. Instead, we must explicitly set the gpio to
> > value 1 in order to take into account any "GPIO_ACTIVE_LOW" flag that
> > may have been set.
> > 
> > In order to remain compatible with all these existing device trees, we
> > should therefore keep the logic as it was before the commit.
> > 
> > Fixes: 90c2d2eb7ab5 ("MIPS: pci: lantiq: switch to using gpiod API")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Martin Schiller <ms@dev.tdt.de>
> > ---
> >  arch/mips/pci/pci-lantiq.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> applied to mips-fixes

The patch is unfortunately also wrong as it will break any board that
actually has correct polarity annotation.

I will prepare a quirk for drivers/gpio/gpiolib-of.c to force the
polarity to low for this GPIO.

Thanks.

-- 
Dmitry

  reply	other threads:[~2024-06-12 15:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07  9:04 [PATCH] MIPS: pci: lantiq: restore reset gpio polarity Martin Schiller
2024-06-11 14:12 ` Thomas Bogendoerfer
2024-06-12 15:38   ` Dmitry Torokhov [this message]
2024-06-12 17:47 ` Dmitry Torokhov
2024-06-12 18:39   ` Martin Schiller
2024-06-12 19:47     ` Martin Schiller
2024-06-12 21:45       ` Dmitry Torokhov
2024-06-12 23:32         ` Dmitry Torokhov
2024-06-13  6:01           ` Martin Schiller
2024-06-13  6:29             ` Dmitry Torokhov
2024-06-13 20:06       ` Hauke Mehrtens
2024-06-14  8:43         ` Martin Schiller
2024-06-20  0:54           ` Dmitry Torokhov
2024-06-24  8:16             ` Martin Schiller
2024-06-13  8:10     ` Thomas Bogendoerfer

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=ZmnA-fifJkEBt0lH@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=hauke@hauke-m.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=ms@dev.tdt.de \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.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 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).