All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	"brgl@bgdev.pl" <brgl@bgdev.pl>,
	"johan@kernel.org" <johan@kernel.org>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	"maz@kernel.org" <maz@kernel.org>,
	Ben Brown <Ben.Brown@alliedtelesis.co.nz>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpiolib: Avoid side effects in gpio_is_visible()
Date: Wed, 17 May 2023 09:05:40 +0800	[thread overview]
Message-ID: <ZGQoZKrEceqlSEtp@sol> (raw)
In-Reply-To: <ZGQkEdZ6DoJbgiFh@sol>

On Wed, May 17, 2023 at 08:47:13AM +0800, Kent Gibson wrote:
> On Tue, May 16, 2023 at 11:50:42PM +0000, Chris Packham wrote:
> > Hi Kent,
> > 
> > The second application is a userspace driver for a L3 network switch 
> > (actually two of them for different silicon vendors). Again this needs 
> > to deal with resets for PHYs connected to the switch that the kernel has 
> > no visibility of as well as the GPIOs for the SFP cages. Again we have a 
> > slightly less simple kernel module that grabs all these GPIOs and 
> > exports them with known names. This time there are considerably more of 
> > these GPIOs (our largest system currently has 96 SFP+ ports with 4 GPIOs 
> > per port) so we're much more reliant on being able to do things like 
> > `for x in port*tx-dis; do echo 1 >$x; done`
> > 
> 
> Given appropriate line names, that is already something you can do with
> the libgpiod v2 tools.  Something like:
> 
> `for x in gpiochip*; do gpioset -c x tx-dis=1; done`
> 

Of course that may only pulse the tx-dis line, depending on how your
driver behaves when the line is released.
(gpioset has options to control the pulse width, if that works for you)

If you need that to persist, independent of device driver behaviour,
then you need a some process holding the lines that your scripts can
communicate with.

Cheers,
Kent.

  reply	other threads:[~2023-05-17  1:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12  4:28 [PATCH] gpiolib: Avoid side effects in gpio_is_visible() Chris Packham
2023-05-12  7:24 ` Johan Hovold
2023-05-14 21:57   ` Chris Packham
2023-05-15  6:43     ` andy.shevchenko
2023-05-15 21:01       ` Chris Packham
2023-05-12  7:56 ` Linus Walleij
2023-05-14 22:27   ` Chris Packham
2023-05-16 13:57     ` Linus Walleij
2023-05-16 22:19       ` Chris Packham
2023-05-16 22:47         ` Kent Gibson
2023-05-16 23:50           ` Chris Packham
2023-05-17  0:47             ` Kent Gibson
2023-05-17  1:05               ` Kent Gibson [this message]
2023-05-17  1:07               ` Chris Packham
2023-05-17  1:21                 ` Kent Gibson
2023-05-17  8:54             ` Andy Shevchenko
2023-05-17  9:10               ` Kent Gibson
2023-05-17 21:30               ` Chris Packham
2023-05-23 16:38                 ` andy.shevchenko
2023-05-23 21:17                   ` Chris Packham
2023-05-24  5:41                     ` Kent Gibson
2023-05-24 23:53                       ` using libgpiod to replace sysfs ABI (was Re: [PATCH] gpiolib: Avoid side effects in gpio_is_visible()) Chris Packham
2023-05-25  1:19                         ` Kent Gibson
2023-05-25  9:13                         ` Andy Shevchenko
2023-05-25 14:35                           ` Bartosz Golaszewski
2023-05-26 12:46                       ` [PATCH] gpiolib: Avoid side effects in gpio_is_visible() Bartosz Golaszewski
2023-05-28 21:04                         ` Chris Packham
2023-05-29  9:19                 ` Linus Walleij
2023-05-29 15:07                   ` Andrew Lunn
2023-05-29  9:07         ` Linus Walleij
2023-05-29 22:00           ` Chris Packham

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=ZGQoZKrEceqlSEtp@sol \
    --to=warthog618@gmail.com \
    --cc=Ben.Brown@alliedtelesis.co.nz \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=johan@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.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.