linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Breathitt Gray <wbg@kernel.org>
To: Mark Cave-Ayland <mark.caveayland@nutanix.com>, mwalle@kernel.org
Cc: William Breathitt Gray <wbg@kernel.org>,
	linus.walleij@linaro.org, brgl@bgdev.pl,
	andriy.shevchenko@linux.intel.com, broonie@kernel.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: gpio: gpio-pci-idio-16 regression after LTS upgrade
Date: Tue,  7 Oct 2025 17:16:55 +0900	[thread overview]
Message-ID: <20251007081657.30422-1-wbg@kernel.org> (raw)
In-Reply-To: <9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com>

On Mon, Oct 06, 2025 at 09:37:14AM +0100, Mark Cave-Ayland wrote:
> root@debian12:~# gpioget 0 0
> gpioget: error reading GPIO values: Input/output error
> 
> which also output:
> 
> [  329.529321] gpio-512 (gpioget): gpiod_direction_input: missing
> direction_input() operation and line is output
> 
> My guess is that this is because
> drivers/gpio/gpio-regmap.c::gpio_regmap_get_direction() isn't able to
> can't handle the situation where lines 0-15 are outputs and lines 16-31
> are inputs, compared with the old idio_16_gpio_get_direction() function
> it replaced.
> 
> What would be the best way forward? Possibly add the .get_direction
> callback to the gpio_regmap_config? Or is there another way to have
> mixed inputs and outputs with the gpio_regmap API?

So the intention I had with gpio-idio-16 was to provide reg_dat_base and
reg_set_base to define the input and output bases, and then
reg_mask_xlate would do the translation between input and outputs. I
think this design is allowed by gpio-regmap, is it not Michael?

In theory, gpio_regmap_get_direction should call gpio->reg_mask_xlate()
which is mapped to idio_16_reg_mask_xlate(), and thus set reg and mask
which then is evaluated at the end of gpio_regmap_get_direction() to
determine which direction to return.

Is it possible idio_16_reg_mask_xlate() is returning the wrong values
for reg and mask?

William Breathitt Gray

  reply	other threads:[~2025-10-07  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-06  8:37 gpio: gpio-pci-idio-16 regression after LTS upgrade Mark Cave-Ayland
2025-10-07  8:16 ` William Breathitt Gray [this message]
2025-10-09  9:05   ` Mark Cave-Ayland
2025-10-09  9:49     ` William Breathitt Gray
2025-10-14  9:03       ` Michael Walle
2025-10-14 11:21         ` Ioana Ciornei
2025-10-14 11:25           ` Michael Walle
2025-10-14 11:40             ` Ioana Ciornei
2025-10-12 14:22 ` William Breathitt Gray
2025-10-13 10:32   ` Mark Cave-Ayland

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=20251007081657.30422-1-wbg@kernel.org \
    --to=wbg@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.caveayland@nutanix.com \
    --cc=mwalle@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 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).