From: Linus Walleij <linus.walleij@linaro.org>
To: Aapo Vienamo <aapo.vienamo@linux.intel.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
Andy Shevchenko <andy@kernel.org>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] gpio: Add Intel Granite Rapids-D vGPIO driver
Date: Fri, 19 Apr 2024 15:11:23 +0200 [thread overview]
Message-ID: <CACRpkdbSB+JTdhGXViWs-SmR3nUnm6dVXt3WzK-d4zFSz63XxQ@mail.gmail.com> (raw)
In-Reply-To: <20240419080555.97343-1-aapo.vienamo@linux.intel.com>
Hi Aapo,
thanks for your patch!
The code is impeccable, not much to say about that.
From that PoV the driver is finished.
I have some technical review comments:
On Fri, Apr 19, 2024 at 10:07 AM Aapo Vienamo
<aapo.vienamo@linux.intel.com> wrote:
> This driver provides a basic GPIO driver for the Intel Granite Rapids-D
> virtual GPIOs. On SoCs with limited physical pins on the package, the
> physical pins controlled by this driver would be exposed on an external
> device such as a BMC or CPLD.
>
> Signed-off-by: Aapo Vienamo <aapo.vienamo@linux.intel.com>
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
OK I get how it works, but not all the way right? We write these registers,
and somehow that results on pins on a completely different piece of
silicon in a different package driving some lines low/high?
So ... can we write something about how the signal gets over there
from where the driver is running? It needs to happen somehow, right?
> +config GPIO_GRANITERAPIDS
> + tristate "Intel Granite Rapids-D vGPIO support"
> + depends on X86 || COMPILE_TEST
> + select GPIOLIB_IRQCHIP
> + help
> + Select this to enable GPIO support on platforms with the following
> + SoCs:
> +
> + - Intel Granite Rapids-D
> +
> + The driver enables basic GPIO functionality and implements interrupt
> + support.
> +
> + To compile this driver as a module, choose M here: the module will
> + be called gpio-graniterapids.
This help text is not as informative as the commit log. Write something
about how the GPIO works here, too.
> +static int gnr_gpio_configure_pad(struct gpio_chip *gc, unsigned int gpio,
> + u32 clear_mask, u32 set_mask)
> +{
> + struct gnr_gpio *priv = gpiochip_get_data(gc);
> + void __iomem *addr = gnr_gpio_get_padcfg_addr(priv, gpio);
> + u32 dw;
> +
> + if (test_bit(gpio, priv->ro_bitmap))
> + return -EACCES;
> +
> + guard(raw_spinlock_irqsave)(&priv->lock);
> +
> + dw = readl(addr);
> + dw &= ~clear_mask;
> + dw |= set_mask;
> + writel(dw, addr);
> +
> + return 0;
> +}
Configure pad sounds like pin control so it's a bit of icky name.
What it really does is configure the direction (in or out) for this
GPIO pad. And it's not really the *pad* that is configured, right?
It is the hardware *driver* for the pad, i.e. what is reflected in
the GPIO line control register.
Can you rename this:
gnr_gpio_configure_direction()?
With the above stuff addressed:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
next prev parent reply other threads:[~2024-04-19 13:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 8:05 [PATCH] gpio: Add Intel Granite Rapids-D vGPIO driver Aapo Vienamo
2024-04-19 13:11 ` Linus Walleij [this message]
2024-04-19 14:42 ` Aapo Vienamo
2024-04-21 18:33 ` Linus Walleij
2024-04-19 13:12 ` Andy Shevchenko
2024-04-19 13:32 ` Aapo Vienamo
2024-04-19 19:59 ` Elliott, Robert (Servers)
2024-04-19 22:02 ` Andy Shevchenko
2024-04-22 10:20 ` Bartosz Golaszewski
2024-04-22 20:59 ` Elliott, Robert (Servers)
2024-04-23 13:47 ` Ilpo Järvinen
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=CACRpkdbSB+JTdhGXViWs-SmR3nUnm6dVXt3WzK-d4zFSz63XxQ@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=aapo.vienamo@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.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;
as well as URLs for NNTP newsgroup(s).