From: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
To: Linus Walleij <linusw@kernel.org>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
Donald Shannon <donalds@nvidia.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-usb@vger.kernel.org, llvm@lists.linux.dev,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 06/11] gpio: Add NVIDIA LSTP GPIO driver
Date: Fri, 16 Oct 2026 11:19:16 +0300 [thread overview]
Message-ID: <20261016081917.1958681-4-aambrozewicz@nvidia.com> (raw)
In-Reply-To: <CAD++jLkru2AL2_7ieOdbYrePAhNSFaa3wwEzCagiPsALgG2GwQ@mail.gmail.com>
Hi Linus,
Thanks for the review.
On Wed, Oct 14, 2026 at 1:25 AM Linus Walleij <linusw@kernel.org> wrote:
>> +config GPIO_LSTP
>
> GPIO_USBIO ... GPIO_LSTP?
>
> These should be in alphabetical order.
Will fix, and check the other Kconfig hunks in the series.
>> +#include <uapi/linux/gpio.h>
>
> Do you really need all this?
> Certainly <uapi/linux/gpio.h> is a mistake, look over all of these.
It was there for GPIO_MAX_NAME_SIZE, for a name truncation warning the
driver does not need. Both go, and I'll trim the rest of the includes
here and in the other drivers.
>> +/* clang-format off */
>
> I beg your pardon? What is this?
Markers that stopped clang-format from reflowing hand-formatted blocks.
They don't belong in posted code; they are gone in the next version.
> This looks very dense too..
>
> At least a newline between the enums?
Will do.
>> +struct lstp_gpio_priv {
>
> Just call it lstp_gpio
Will do.
>> + struct lstp_channel *ch;
>> + struct gpio_chip gc;
>
> Why? Normally drivers get the state container from the
> chip not the other way around.
The gpio_chip callbacks do get it from the chip, with
gpiochip_get_data(). The channel pointer is the handle every request
to the device goes through. The only lookup the other way round is the
interrupt event callback: the LSTP core calls it with the channel, so
it takes the state from the channel's private pointer.
> It seems some pins are only input and some are only output.
>
> Have you considered using serialized register access over
> regmap and use regmap-gpio with fixed direction bitmaps?
Yes, the device configuration fixes each pin's direction. I looked at
gpio-regmap: a regmap bus with one register per pin would cover get,
set and the fixed directions. Two parts don't fit well, though.
gpio-regmap has no get_multiple/set_multiple, while the device takes
several pins in one request, so an array access would become one USB
round trip per pin. And interrupts arrive as event packets the device
sends on its own, not as status registers to read, so regmap-irq does
not apply and the irq_chip would stay as it is.
What I would take from it is reading the directions once at probe into
bitmaps, instead of asking the device on every call. Would that be
acceptable, or would you still prefer gpio-regmap despite the lost
batching?
Thanks,
Adrian
next prev parent reply other threads:[~2026-10-16 8:19 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 17:35 [PATCH 00/11] Add NVIDIA LSTP USB adapter drivers Adrian Ambrozewicz
2026-10-12 17:35 ` [PATCH 01/11] dt-bindings: gpio: Add NVIDIA LSTP GPIO Adrian Ambrozewicz
2026-10-13 6:09 ` Krzysztof Kozlowski
2026-10-16 8:44 ` Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 02/11] dt-bindings: i2c: Add NVIDIA LSTP I2C Adrian Ambrozewicz
2026-10-13 6:11 ` Krzysztof Kozlowski
2026-10-12 17:36 ` [PATCH 03/11] dt-bindings: spi: Add NVIDIA LSTP SPI Adrian Ambrozewicz
2026-10-13 6:11 ` Krzysztof Kozlowski
2026-10-12 17:36 ` [PATCH 04/11] dt-bindings: usb: Add NVIDIA LSTP USB adapter Adrian Ambrozewicz
2026-10-13 6:13 ` Krzysztof Kozlowski
2026-10-13 6:17 ` Krzysztof Kozlowski
2026-10-12 17:36 ` [PATCH 05/11] usb: misc: Add NVIDIA LSTP USB adapter driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 06/11] gpio: Add NVIDIA LSTP GPIO driver Adrian Ambrozewicz
2026-10-13 23:25 ` Linus Walleij
2026-10-16 8:19 ` Adrian Ambrozewicz [this message]
2026-10-16 21:14 ` Linus Walleij
2026-10-12 17:36 ` [PATCH 07/11] leds: Add NVIDIA LSTP LED driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 08/11] i2c: Add NVIDIA LSTP I2C driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 09/11] spi: Add NVIDIA LSTP SPI driver Adrian Ambrozewicz
2026-10-12 17:36 ` [PATCH 10/11] tty: Add NVIDIA LSTP UART driver Adrian Ambrozewicz
2026-10-13 5:49 ` Jiri Slaby
2026-10-16 8:19 ` Adrian Ambrozewicz
2026-10-15 1:25 ` kernel test robot
2026-10-16 7:43 ` kernel test robot
2026-10-12 17:36 ` [PATCH 11/11] ipmi: Add NVIDIA LSTP IPMI BMC driver Adrian Ambrozewicz
2026-10-12 21:10 ` Corey Minyard
2026-10-16 8:19 ` Adrian Ambrozewicz
2026-10-16 12:26 ` Corey Minyard
2026-10-13 11:37 ` [PATCH 00/11] Add NVIDIA LSTP USB adapter drivers Greg Kroah-Hartman
2026-10-16 8:44 ` Adrian Ambrozewicz
2026-10-13 11:39 ` Greg Kroah-Hartman
2026-10-14 3:38 ` Jeremy Kerr
2026-10-14 4:53 ` Greg Kroah-Hartman
2026-10-16 8:19 ` Adrian Ambrozewicz
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=20261016081917.1958681-4-aambrozewicz@nvidia.com \
--to=aambrozewicz@nvidia.com \
--cc=brgl@kernel.org \
--cc=donalds@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--cc=justinstitt@google.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
/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
all inboxes | Powered by JetHome®